1
votes

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.

1
You are partially refreshing a component called "viewContent". Do you have a component with this name?Per Henrik Lausten
@PerHenrikLausten yep. I corrected the partial refresh. I will update my question, now the dialog it's showing, but is like a 'newNote()', the fields are empty.Florin M.
Can you also post the data component that you have used within the dialog? For instance, if you don't use action="editDocument", just documentId would not be enough to show the data. You might also put a computed field into the dialog to test if it passes the value correctly.Serdar Basegmez
@SerdarBasegmez thanks for your response. I will update my question with the data component of the dialog.Florin M.
Dialogs are not native to web applications. So you might be trying a solution for a problem you shouldn't have. The inline edit form and a repeat control might be a better choicestwissel

1 Answers

1
votes

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.)