XPage:
<xp:div styleClass="container" style="margin-top:20px">
<xp:div styleClass="row">
<xc:cc1></xc:cc1>
<xc:cc2></xc:cc2>
</xp:div>
</xp:div>
Custom control 1
<xp:this.data>
<xp:dominoDocument var="form1" formName="form1"></xp:dominoDocument>
</xp:this.data>
<xp:div id="formDiv1" styleClass="col-sm-4">
<xp:form>
<xp:label value="Form 1" styleClass="h3"></xp:label>
<xp:div styleClass="form-group">
<xp:label value="Field 1" styleClass="control-label"></xp:label>
<xp:inputText value="#{form1.field1}"></xp:inputText>
</xp:div>
<xp:button value="Submit Form1" id="form1Btn">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial" immediate="false" save="true" refreshId="formDiv1"
execMode="partial" execId="formDiv1">
</xp:eventHandler>
</xp:button>
</xp:form>
Custom control 2
<xp:this.data>
<xp:dominoDocument var="form2" formName="form2"></xp:dominoDocument>
</xp:this.data>
<xp:div id="formDiv1" styleClass="col-sm-4">
<xp:form>
<xp:label value="Form 2" styleClass="h3"></xp:label>
<xp:div styleClass="form-group">
<xp:label value="Field 1" styleClass="control-label"></xp:label>
<xp:inputText value="#{form2.field1}"></xp:inputText>
</xp:div>
<xp:button value="Submit Form2" id="form2Btn">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial" immediate="false" save="true" refreshId="formDiv1"
execMode="partial" execId="formDiv1">
</xp:eventHandler>
</xp:button>
</xp:form>
A normal submit button gets the property save="true"
and saves all data sources.
If you want to save only one data source then use the simple action Save Document
and select the data source:
Set property save="false"
in addition. Your button code would look like this then:
<xp:button
id="form1Btn"
value="Submit Form1">
<xp:eventHandler
event="onclick"
submit="true"
refreshMode="complete"
immediate="false"
save="false">
<xp:this.action>
<xp:saveDocument
var="form1"></xp:saveDocument>
</xp:this.action>
</xp:eventHandler>
</xp:button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With