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>