This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 23, 2011, 4:39 PM
14 Posts
topic has been resolvedResolved

Attempting to show Modal Dialog (in "edit" mode) to create a new Document

  • Category: Extension Library
  • Platform: Windows
  • Release: 8.5.3
  • Role: End user,Developer,Administrator
  • Tags: Modal Dialog
  • Replies: 3
 I have a Xpage that displays Project document information using the Xpages tab container. I created a custom control which launches a modal dialog to create a new Document (deliverable related to the project document). The modal dialog with the deliverable document fields launches properly but does not show the fields as editable. The fields seem to "inherit" the state of the document I am launching the modal dialog from. The deliverable Xpage I am attempting to launch via modal dialog is in a panel bound to document2 as the data source and has a default action of Create Document. 
 
How can I get the modal dialog to show up as a new document?
Any help is appreciated. 
 
source for the dialog below:
 
<xp:panel id="panelnewdeliv">
<xp:this.data>
<xp:dominoDocument var="document2"
formName="x_form_deliverable" action="newDocument">
</xp:dominoDocument>
</xp:this.data>
<xp:button value="Create Deliverable"
id="button22">
<xp:eventHandler event="onclick"
submit="false">
<xp:this.script><![CDATA[XSP.openDialog("#{id:dialog3}");]]></xp:this.script>
</xp:eventHandler>
</xp:button>

<xe:dialog id="dialog3" title="New Deliverable">
<xp:br></xp:br>
<xp:panel style='padding: 10px'>
<xp:table>
<xp:tr>
<xp:td></xp:td>
<xp:td>
<xp:text escape="true"
id="computedField1">
<xp:this.value><![CDATA[#{javascript:sessionScope.get("ParentDocID")}]]></xp:this.value>
</xp:text>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label
value="Projectcode:" id="projectcode_Label2"
for="projectcode1">
</xp:label>
</xp:td>
<xp:td>
<xp:inputText
id="projectcode" value="#{document2.projectcode}">
<xp:this.defaultValue><![CDATA[#{javascript:var db1 = new Array("Intranet/Facing History", "Intranet\\ProjectT.nsf");
var ParentID = sessionScope.get("ParentDocID")


function DbLookupArray(viewname, k, field) {
if (requestScope.get("dblookuparray-"+viewname+"-"+k)) {
return requestScope.get("dblookuparray-"+viewname+"-"+k);
}
var r = @DbLookup("", viewname, k, field);
if (r && typeof r == "string") r = new Array(r);
if (r) requestScope.put("dblookuparray-"+viewname+"-"+k, r);
return r;
}


DbLookupArray("xProjectLookupByID", ParentID, "projectcode")}]]></xp:this.defaultValue>
</xp:inputText>
</xp:td>
</xp:tr>
</xp:table>
<xp:table>
<xp:tr>
<xp:td>
<xp:label
value="Fiscalyear:" id="fiscalyear_Label1"
for="fiscalyear1">
</xp:label>
</xp:td>
<xp:td>
<xp:inputText
value="#{document2.fiscalyear}" id="fiscalyear">
<xp:this.defaultValue><![CDATA[#{javascript:var db1 = new Array("Intranet/Facing History", "Intranet\\ProjectT.nsf");
var ParentID = sessionScope.get("ParentDocID")


function DbLookupArray(viewname, k, field) {
if (requestScope.get("dblookuparray-"+viewname+"-"+k)) {
return requestScope.get("dblookuparray-"+viewname+"-"+k);
}
var r = @DbLookup("", viewname, k, field);
if (r && typeof r == "string") r = new Array(r);
if (r) requestScope.put("dblookuparray-"+viewname+"-"+k, r);
return r;
}


DbLookupArray("xProjectLookupByID", ParentID, "fiscalyear")}]]></xp:this.defaultValue>
</xp:inputText>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label value="Type"
id="label1" for="lastName1">
</xp:label>
</xp:td>
<xp:td>

<xp:comboBox
id="comboBox2" value="#{document2.deliverabletype}">
<xp:selectItem
itemLabel="Web" itemValue="Web">
</xp:selectItem>
<xp:selectItem
itemLabel="Video" itemValue="Video">
</xp:selectItem>
<xp:selectItem
itemLabel="Permissions" itemValue="Permissions">
</xp:selectItem>
</xp:comboBox>
</xp:td>
<xp:td>
Required field, server
side validation
</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label
value="Assignee" id="label2" for="eMail1">
</xp:label>
</xp:td>
<xp:td>
<xp:inputText
value="#{document2.assignee}" id="inputText2">
</xp:inputText>
</xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label
value="Date Completed" id="label3" for="city1">
</xp:label>
</xp:td>
<xp:td>

<xp:inputText
id="inputText3" value="#{document2.datecomp}">
<xp:dateTimeHelper
id="dateTimeHelper2">
</xp:dateTimeHelper>


<xp:this.converter>
<xp:convertDateTime
type="date" dateStyle="short">
</xp:convertDateTime>
</xp:this.converter>
</xp:inputText>
</xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:tr>
<xp:td></xp:td>
<xp:td>

</xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:tr>
<xp:td>Status:</xp:td>
<xp:td>
<xp:radioGroup
id="radioGroup2" defaultValue="In Progress"
value="#{document2.status}">
<xp:selectItem
itemLabel="In Progress" itemValue="In Progress">
</xp:selectItem>
<xp:selectItem
itemLabel="Complete" itemValue="Complete">
</xp:selectItem>
</xp:radioGroup>
</xp:td>
<xp:td></xp:td>
</xp:tr>
</xp:table>
<xp:br></xp:br>
Description:
<xp:br></xp:br>
<xp:inputTextarea
id="inputTextarea2" value="#{document2.description}"
style="width:467.0px;height:47.0px">
</xp:inputTextarea>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:messages id="messages1"></xp:messages>

</xp:panel>

<xp:br></xp:br>
<xe:dialogButtonBar>
<xp:button value="Save" id="button1">
<xp:eventHandler event="onclick"
submit="true" refreshMode="partial" immediate="false"
save="true" refreshId="repeat1">
<xp:this.action>
<xp:actionGroup>
<xp:saveDocument></xp:saveDocument>




<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:var d = getComponent("dialog3")
d.hide("panelnewdeliv")}]]></xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:link id="link1" text="Cancel"
styleClass="lotusAction">
<xp:eventHandler event="onclick"
submit="true" immediate="true">
<xp:this.action>
<xp:actionGroup>
<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:var d = getComponent("dialog3")
d.hide("panelnewdeliv")}]]></xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:link>
</xe:dialogButtonBar>
</xe:dialog>
</xp:panel> 
Nov 23, 2011, 8:17 PM
261 Posts
Re: Attempting to show Modal Dialog (in "edit" mode) to create a new Document
Hi,
 
Did you try setting the ignoreRequestParams property of the panel's datasource to true?
 
The default value is false causing the datasource to listen to the URL parameters action and documentId.
 
Mark
Nov 27, 2011, 7:40 PM
14 Posts
Re: Attempting to show Modal Dialog (in "edit" mode) to create a new Document
That was it! Mark you have done it again! You answered another one of my questions in the is forum a while back. I will hereby call you Mark "I will save you heartache and pain" Leusink.
 
Thank you very much! 
 
Elijah Lapson 
Nov 28, 2011, 8:27 AM
261 Posts
Re: Attempting to show Modal Dialog (in "edit" mode) to create a new Document
You're welcome!
 
Glad I could help.
 
Mark

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal