Dynamic dataSource on a panel, partial refresh to load values from viewScope or other. set default values on the datasource before loading.
When doing a full refresh on a panel (new window), I used to use beforePageLoad to run a handler class against the datasource and set up or check values before the "document" loaded.
I've moved this into a modal dialog where I set the datasource dynamically and then open the modal. For existing documents I just switched to using postOpenDocument, same handler call, works great! I have tried every other sneaky way and/or event for newDocument none of them run, or I simply cant get a handle on "doc" where doc is: DominoDocument var="doc"
Anyone doing this without using extLib dialogs? (I believe the extLib ajax call would allow me to use beforePageLoad again, but I am trying not to use those, as it may get complicated when I address my mobile setup.
I've tried all the events (that apply, queryNewDocument, postNew, etc). afterRestoreView, beforeRenderResponse (<-cant find a handle to doc, also seems incorrect, but tried) The amount of processing the handler may need to do could be quite a bit so a simple throw catch with scopes probably wont work.
<xp:panel id="dialogWrap" >
<xp:this.data>
<xp:dominoDocument
var="doc"
formName="#{compositeData.formName}"
action="{#viewScope.modalAction}"
documentId="#{viewScope.UNID}"
ignoreRequestParams="true">
<xp:this.postNewDocument><![CDATA[#{javascript:
print("postNewDocument");
if(requestScope.loadDialog){
compositeData.handlerDocument.beforePageLoad(doc);
}
}]]>
</xp:this.postNewDocument>
<xp:this.postOpenDocument><![CDATA[#{javascript:
print("postOpenDocument");
if(requestScope.loadDialog){
compositeData.handlerDocument.beforePageLoad(doc);
}
}]]>
</xp:this.postOpenDocument>
</xp:dominoDocument>
</xp:this.data>
<!--etc...-->
postOpenDocument works for existing records postNewDocument appears to need an additional refresh of the panel to get a handle ??, not working as above.
No error msgs, besides when I try a bunch of invalid handles to doc in the various events and lifecycles.. "expression failure..." I simply can not find a way to call the handler on newDocument, never runs... I would like to not use extLib dialog, or other ajax to iframe method if possible.