Reputation: 1
I am new to xpages and am trying to get a form to display in a dialog box
This needs to work when composing a new form and opening one from a view
I have the following code in a custom control for my form/dialog
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument var="document1" formName="fa_alert"></xp:dominoDocument>
</xp:this.data>
<xp:panel styleClass="lotusOverlay"></xp:panel>
<xp:panel styleClass="lotusDialogWrapper" id="dialog">
<xp:panel styleClass="lotusDialogBorder">
<xp:form styleClass="lotusDialog lotusForm2">
<h2>
<xp:link value="javascript:;" styleClass="lotusBtnImg lotusClose" title="close dialog">
<span class="lotusAltText">X</span>
</xp:link>
Service Outage
</h2>
<xp:panel styleClass="lotusDialogContent">
<xp:panel styleClass="lotusFormBody">
<xp:panel styleClass="lotusFormField">
<label for="title">
<span class="lotusFormRequired">*</span>
Title:
</label>
<xp:panel>
<xp:inputText styleClass="lotusText" id="title" value="#{document1.fd_AlertSummary}"></xp:inputText>
</xp:panel>
</xp:panel>
<xp:panel styleClass="lotusFormField">
<label for="description">
<span class="lotusFormRequired">*</span>
Description:
</label>
<xp:panel>
<xp:inputTextarea styleClass="lotusText" id="description" rows="10" cols="20" value="#{document1.fd_AlertDescription}"></xp:inputTextarea>
</xp:panel>
</xp:panel>
<xp:panel styleClass="lotusFormField">
<label for="sites">
<span class="lotusFormRequired">*</span>
Site(s) Affected:
</label>
<xp:panel>
<xp:checkBoxGroup styleClass="lotusCheckbox" id="sites" value="#{document1.fd_kw_Sites}" layout="pageDirection"
style="width:200px">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:@DbColumn("","KeywordLookup",3)}]]></xp:this.value>
</xp:selectItems>
</xp:checkBoxGroup>
</xp:panel>
</xp:panel>
<xp:panel styleClass="lotusFormField">
<label for="outagedate">
<span class="lotusFormRequired">*</span>
Outage Date:
</label>
<xp:panel>
<xp:inputText styleClass="" id="outagedate" value="#{document1.fd_dt_DOS}">
<xp:dateTimeHelper id="dateTimeHelper1"></xp:dateTimeHelper>
<xp:this.converter>
<xp:convertDateTime type="date" dateStyle="short"></xp:convertDateTime>
</xp:this.converter>
</xp:inputText>
</xp:panel>
</xp:panel>
</xp:panel>
</xp:panel>
<xp:panel styleClass="lotusDialogFooter">
<xp:button value="Edit" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:changeDocumentMode mode="edit"></xp:changeDocumentMode>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button value="Save" id="button2">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:saveDocument></xp:saveDocument>
<xp:openPage name="/Home.xsp"></xp:openPage>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:button value="Cancel" id="button3">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:openPage name="/Home.xsp"></xp:openPage>
</xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:panel>
</xp:form>
</xp:panel>
</xp:panel>
But when trying to create a new form, or open an existing one just a blank page appears?
If I check in firefox my code is all there but nothing is displayed!!
Can someone help a novice like me understand what I have done wrong??
I was originally following the oneuiv2.1 documentation, and instead now have followed the advice of others in the community and use the dojo dijit.dialog instead which works a treat albeit it throws an error
An error occurred while updating some of the page. Tried to register widget with id==view:_id1:_id47:_id49:dialog but that id is already registered
This I assume means I have referenced the dialog id somewhere else and now just need to find that..or am I misunderstanding the error! As I was making lots of changes yesterday trying to get things to work..it may be time to back track my steps a bit!
Upvotes: 0
Views: 1026
Reputation: 3395
Though I didn't verified it I guess the classes lotusDialog*** have a display:none. Please check this with Web Developer, Firebug or Developer Tools in your browser. If so, then nothing is displayed though the source is available. You have to toggle the element(s) with javascript in the onClientLoad Client JS event, e.g.
document.getElementById('#{id:dialog}').style.display = "block"
Upvotes: 0
Reputation: 21709
You don't need to add your own xp:form
tag. XPages does that for you (unless you set createForm
on xp:view
to false). So try removing that and see if that helps.
Upvotes: 3