Florin M.
Florin M.

Reputation: 2169

xpages computed onClick open forms

I'm trying and trying for some time to resolve a viewPanel functionality - var property set to rowData.

Depending on the form name, I want to open the docs. ( which are listed in my viewPanel ) in a normal way and into a <xe:dialog> control. I did found this question Xpages Dynamic dojo dialog control and I'm trying to make it works in my case. the docs which I want to be open in the <xe:dialog>, are also created inside the dialog. By this viewpanel, I want to show/open them using this viewPanel control.

Here is the code from the onClick column event:

var formName = rowData.getDocument().getItemValueString("Form");
var docUNID = rowData.getDocument().getUniversalID();
var href = facesContext.getExternalContext().getRequest().getContextPath();
var pe:NotesViewEntry = rowData

if ( formName == "fmCompanie") // in this case, it works OK.

{ href + "/doc.xsp?documentId=" + docUNID + "&action=openDocument"; }

else if ( formName == "fmPersContact" ) // hmm... Still trying...

{ viewScope.put("dlgDocUnid", pe.getUniversalID())
getComponent("exampleDialog").show(); }

So, by this event I'm trying to set a viewScope variable which uses the UNID for the datasource in my exampleDialog control.

Also: the dialog control ( which lays on the same custom control as the viewPanel) has the documentId:

<xp:this.data>
    <xp:dominoDocument var="Pdoc" formName="fmPersContact"
        ignoreRequestParams="true" scope="request">

        <xp:this.documentId><![CDATA[#{javascript:viewScope.get("dlgDocUnid");}]]></xp:this.documentId>
    </xp:dominoDocument>
</xp:this.data>

Still, when I'm trying to open a doc. ( using form == "fmPersContact") the dialog has all fields empty, even if the doc. is already fill with some field values.

I appreciate your help. Thanks for your time.

Upvotes: 1

Views: 324

Answers (1)

Serdar Basegmez
Serdar Basegmez

Reputation: 3355

The data source in the dialog does not contain action attribute. Therefore it does not respect the documentId parameter and creating a new document within the dialog.

Add action="editDocument" attribute and it will work.

Also, check what you are refreshing with the onclick event. You should partially refresh an area that contains your data (e.g. dialog or the panel in your dialog, etc.)

Upvotes: 1

Related Questions