Hi Alex,
There is somewhat a complex situation. I receive the data through an external XML file in "/Root/Rs/...". Each control on the page is bound to some node in this tree but a node may not be received in a particular situation. It all happens during run-time depending on user group and access rights. If a particular node is not received, control bound to this node will not be rendered on the screen. I need to attach other bind expressions like "required", "count" etc on various controls. Orbeon throws error if I give "nodeset" or "ref" attribute mapped to a node which does not exist in <xforms:instance> So, the solution I found was -
1. for "ref" attribute - I handle it using XSL like this -
<xsl:if test="/Root/Rs/DwellUseCd">
<xforms:input ref="/Root/Template/DwellUseCd"/>
</xsl:if>
2. for "nodeset" attribute - I map it to a template node (which contains all possible nodes) and copy the contents of "/Root/Rs/..." using "calculate" bind _expression_. This way, when the page is rendered, it gets the correct initial value.
When the page is submitted, I want to receive all submitted values in "/Root/Template/..." structure only. As all XPaths are mapped to "/Root/Template/..", so I thought it will serve the purpose. Please suggest if you have a smarter solution. Please also help me in saving this node structure with submitted values in an external file which can be read by other components of my application.
Thanks and Regards,
Rahul Agarwal
P & C Designer Infrastructure Team
CSC India
91-731-2570717 x460
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
----------------------------------------------------------------------------------------
| Alessandro Vernet <avernet @orbeon.com> Sent by: orbeon-user-admin 11/13/2004 05:32 AM
|
To: [EMAIL PROTECTED] cc: Subject: Re: [orbeon-user] Problem with multiple bind expressions |
Rahul Agarwal wrote:
> <xforms:bind nodeset="/Root/Template/DwellUseCd"
> calculate="string(/Root/RS/DwellUseCd)"/>
> <xforms:bind nodeset="/Root/Template/DwellUseCd" required="true()"/>
> <xforms:bind nodeset="/Root/Template/DwellUseCd"
> constraint="string-length(.) > 10"/>
>
> I've created two control in View XSL as follows -
>
> <xforms:input ref="/Root/Template/DwellUseCd"/>
> <xforms:submit>
> <xforms:label>Update</xforms:label>
> </xforms:submit>
>
> When I click on "Update" button, Orbeon does form validation and always
> throws error "Please correct the errors on this page." irrespective of
> whether I give correct values in input control or not. I observed that
> if I do not specify "calculate" bind _expression_, it works perfectly.
> Please tell whether it is a bug or I'm doing something wrong here.
Hi Rahul,
You XForms controls is bound to Template/DwellUseCd, and the two
validation binds (with required and constraint) apply on
Template/DwellUseCd. So far everything is good.
Now I am wondering why you are starting by copying into
Template/DwellUseCd the value under RS/DwellUseCd. Doing so will
overwrite the value entered by the user by the value under
RS/DwellUseCd, which might be invalid according to the next two rules,
hence the error that gets reported.
Alex
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user
