Hi all,
Im pretty new to Orbeon forms. So i cant understand whats wrong with the code below. <head> <title>Add Function</title> <xforms:model> <xforms:instance id="function-instance"> <functions xmlns=""> <function> <function_name /> </function> </functions> </xforms:instance> <xforms:instance id="parameter-instance"> <parameters xmlns=""> <parameter> <name /> <description /> <type /> </parameter> </parameters> </xforms:instance> <xforms:instance id="parameter-instance-template"> <parameter xmlns=""> <name /> <description /> <type /> </parameter> </xforms:instance> <xforms:instance id="type-instance"> <types xmlns=""> <type> <name>String</name> <value>string</value> </type> <type> <name>Char</name> <value>char</value> </type> <type> <name>Integer</name> <value>int</value> </type> <type> <name>Boolean</name> <value>bool</value> </type> </types> </xforms:instance> </xforms:model> </head> <body> <p>Add Function</p> <xforms:group ref="function"> <xforms:input ref="function_name"> <xforms:label>Function Name </xforms:label> </xforms:input> <br /> <br /> </xforms:group> <xforms:group class="actions-action" id="todo-action-new-group"> <xforms:action ev:event="DOMActivate"> <xforms:insert context="instance('parameter-instance')" nodeset="test" at="1" position="before" origin="instance('parameter-instance-template')" /> </xforms:action> <xforms:trigger appearance="minimal" id="Add_new_parameter_function" ref="."> <xforms:label> <xhtml:img src="/apps/xforms-todo/images/add.gif" /> Add new parameter(function)</xforms:label> </xforms:trigger> </xforms:group> <br /> <br /> <xforms:repeat nodeset="parameter" id="parameter-repeat"> <xforms:input ref="name"> <xforms:label>Name </xforms:label> </xforms:input> <xforms:input ref="description"> <xforms:label>Description </xforms:label> </xforms:input> <xforms:select1 ref="type"> <xforms:label>Type </xforms:label> <xforms:item> <xforms:label>Select Type</xforms:label> <xforms:value /> </xforms:item> <xforms:itemset nodeset="instance('type-instance')/type"> <xforms:label ref="name" /> <xforms:value ref="value" /> </xforms:itemset> </xforms:select1> <br /> </xforms:repeat> </body> </html> heres the problem when i run the code as it is, i dont see the repeat group section specified below <xforms:repeat nodeset="parameter" id="parameter-repeat"> <xforms:input ref="name"> <xforms:label>Name </xforms:label> </xforms:input> <xforms:input ref="description"> <xforms:label>Description </xforms:label> </xforms:input> <xforms:select1 ref="type"> <xforms:label>Type </xforms:label> <xforms:item> <xforms:label>Select Type</xforms:label> <xforms:value /> </xforms:item> <xforms:itemset nodeset="instance('type-instance')/type"> <xforms:label ref="name" /> <xforms:value ref="value" /> </xforms:itemset> </xforms:select1> <br /> </xforms:repeat> But when i comment the function instance as below It displayes all items in the repeat section but it doesn't show the below input field. <xforms:group ref="function"> <xforms:input ref="function_name"> <xforms:label>Function Name </xforms:label> </xforms:input> <br /> <br /> </xforms:group> Im getting very confused. Can some one please explain |
Hi Sridanu,
Because your model has more than one instance, you need to make sure you specify which instance you're referring to with your "nodeset" or "ref" attributes. For example, you have this line: <xforms:repeat nodeset="parameter" id="parameter-repeat"> Which is referring to the "parameter" nodes in the "parameter-instance" instance block. It should probably look like this: <xforms:repeat nodeset="instance('parameter-instance')/parameter" id="parameter-repeat"> Because the instance hasn't been specified in the first example, Orbeon is trying to find all the "parameter" nodes in the default instance, which in this case is the first one it finds - the "function-instance". There are no parameter nodes in the "function-instance" instance, so it repeats zero times. When you removed the "function-instance" instance block, the "parameter-instance" node became the default (as it was now the first one in the list) and so the repeat block started to work. Regards, Erica -----Original Message----- From: sridanu [mailto:[hidden email]] Sent: Monday, October 05, 2009 6:16 PM To: [hidden email] Subject: [ops-users] Cant understand what i did wrong Hi all, Im pretty new to Orbeon forms. So i cant understand whats wrong with the code below. ... -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |