Alex,
Yes, this scheme works for me. Thank you.
I forgot to mention another issue why I had used /Root/Template. The business message contains so many nodes which actually are not used by page. So, when I bind my controls on /Root/Rs nodes, all the nodes are submitted. My intent is - not to submit unnecessary nodes - the nodes which are not used/modified by page but received in business message. I'm sorry for not bringing this point in my earlier mail. Can somehow I stop submitting unused nodes with this scheme?
Thanks and Regards,
Rahul Agarwal
----------------------------------------------------------------------------------------
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/18/2004 04:33 AM
|
To: [EMAIL PROTECTED] cc: Subject: Re: [orbeon-user] Problem with multiple bind expressions |
Rahul Agarwal wrote:
> 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.
I see. Right now in Presentation Server:
1) A "ref" attribute must reference exacly one node in the instance,
otherwise you will get an error.
2) However, the "nodeset" attribute in an <xforms:bind> can reference
zero, one, or more nodes. If it does not reference any node, it has no
effect.
So it seems to me that in your case, you do not need this other
/Root/Template section of the instance where you copy data over. Just
work on the /Root/Rs and have both the <bind> elements and the control
elements reference nodes under /Root/Rs.
By having an <xforms:if> around the XForms controls, you will make
sure that a control is not displayed if the element it is bound to is
not there in the instance. And the <bind nodeset="..."> pointing to
inexistent elements will just have no effect, but you won't get an
error. Would this scheme work for you?
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
