Created
March 19, 2018 08:39
-
-
Save Raghuramgrr/f24d456105b210ace57020e35c5cd5ef to your computer and use it in GitHub Desktop.
Xforms - Preparation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---adding element in the form----- | |
<xf:input ref="objname"> | |
<xf:label>whateveryou want: </xf:label> | |
<xf:hint>whatever you want</xf:hint> | |
</xf:input> | |
--------------------------------- add rows from the table--------------------- | |
<button sid="addRow"> | |
<xforms:trigger> | |
<xforms:label>Add Row</xforms:label> | |
<xforms:action ev:event="DOMActivate"> | |
<xforms:insert nodeset="order/row" at="index('orderTable')" | |
position="after"/> | |
<xforms:setfocus control="orderTable"/> | |
</xforms:action> | |
</xforms:trigger> | |
</button> | |
--------------------------------------------------------------- | |
<xforms:action event> | |
<xforms:insert nodeset="nodeset binding" at="at" context="context" | |
origin="origin" position="position"/> | |
</xforms:action> | |
<xforms:model id="M"> | |
<xf:submission id="xxxx" method="get" action="xxxx" ref="instance('model')" replace="instance" instance="models"> | |
<xf:action ev:event="xforms-submit-error"> | |
<xf:message>error msg </xf:message> | |
</xf:action> | |
</xf:submission> | |
<div align="left"> | |
<a href="http://localhost:XXXX/library/1.xhtml">Back to 1</a><br /> | |
</div> | |
<xf:input ref="aaaa"> | |
<xf:label>aaaa: </xf:label> | |
</xf:input> | |
<br /> | |
<xf:trigger> | |
<xf:label>submisssion</xf:label> | |
<xf:action ev:event="DOMActivate"> | |
<xf:send submission="xxxx" /> //xxxx - is the submission id | |
</xf:action> | |
</xf:trigger> | |
<div class="class-name"> | |
<xf:group ref=""> //condition | |
<xf:trigger submission="replace-form-with"> | |
<xf:label>whatever label u want</xf:label> | |
<xf:action ev:event="DOMActivate"> | |
<xf:setvalue ref="instance('URL-container')" | |
value="concat('id=', instance('books')/book[index('book-repeat')]/id, '&title=' , instance('book')/title)" />; | |
<xf:send submission="borrow" /> | |
</xf:action> | |
</xf:trigger> | |
</xf:group> | |
<xf:group ref=".[available=0]"> | |
Not available | |
</xf:group> | |
</div> | |
<button sid="addRow"> | |
<xforms:trigger> | |
<xforms:label>Add Row</xforms:label> | |
<xforms:action ev:event="DOMActivate"> | |
<xforms:insert nodeset="order/row" at="index('orderTable')" | |
position="after"/> | |
<xforms:setfocus control="orderTable"/> | |
</xforms:action> | |
</xforms:trigger> | |
</button> | |
<xforms:action event | |
<xf:dispatch name="event-to-dispatch" targetid="id"/> | |
</xforms:action> | |
<xforms:action ev:event="custom-reverse"> | |
<xforms:insert context="instance('tempdata')" origin="instance('data')/container/*[position()!=1]"/> | |
<xforms:delete nodeset="instance('data')/container/*[position()!=1]"> | |
<xforms:insert iterate="instance('tempdata')/*"nodeset="instance('data')/container/*[1]" at="1" position="before" origin="."/> | |
<xforms:delete nodeset="instance('tempdata')/*"/> | |
</xforms:action> | |
</xforms:model> | |
<button sid="B"> | |
<xforms:trigger> | |
<xforms:label>Reverse the data list</xforms:label> | |
<xforms:dispatch ev:event="DOMActivate" name="custom-reverse" targetid="M"/> | |
</xforms:trigger> | |
</button>copy to clipboard | |
Defines the node to copy. If multiple nodes match, then they are all copied. Also defines where to place the copy - it is placed into the data model as a sibling of this node. Use the nodeset binding if you are copying a node that is already in the table, and are placing the new node in the same table. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment