Hi all,
I want to hide the row in the repeating region until the add additional locations trigger is clicked. At the moment the delete and name input row appear when the page loads. Is there any way to do this? Regards <xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:widget="http://orbeon.org/oxf/xml/widget" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" lang="en"> <xhtml:head> <xforms:model id="main-model"> <xforms:instance id="data-instance"> <data> <item> <insuredname></insuredname> <al> <name></name> </al> </item> </data> </xforms:instance> <xforms:instance id="data-template"> <al> <name></name> </al> </xforms:instance> </xforms:model> </xhtml:head> <xhtml:body> <xhtml:p> <xforms:input id="insuredname" ref="item/insuredname" incremental="true" class="input" navindex="1"> <xforms:label class="fixed-width">Insured Name</xforms:label> <xforms:alert>Insured Name is required</xforms:alert> </xforms:input> </xhtml:p> <xhtml:table> <xhtml:tr> <xhtml:td> <xforms:trigger appearance="minimal"> <xforms:label>Add additional location</xforms:label> <xforms:insert ev:event="DOMActivate" context="instance('data-instance')" nodeset="item/al" at="1" position="before" origin="instance('data-template')"/> </xforms:trigger> </xhtml:td> </xhtml:tr> <xforms:repeat nodeset="item/al" id="al-repeat"> <xhtml:tr> <xhtml:td colspan="2"> <xforms:trigger appearance="minimal"> <xforms:delete ev:event="DOMActivate" context="instance('data-instance')" nodeset="item/al" at="index('al-repeat')"/> <xforms:label>Delete</xforms:label> </xforms:trigger> </xhtml:td> </xhtml:tr> <xhtml:tr> <xhtml:td> <xforms:input id="alname" ref="name" incremental="true" class="input"> <xforms:label class="fixed-width">Name</xforms:label> <xforms:alert>Name is required</xforms:alert> </xforms:input> </xhtml:td> </xhtml:tr> </xforms:repeat> </xhtml:table> </xhtml:body> </xhtml:html> |
Hi John,
Just replace your instance with this one: <xforms:instance id="data-instance"> <data> <item> <insuredname></insuredname> </item> </data> </xforms:instance> You have an error in your add trigger too. If you delete all the aditional locations, it won't let you add anymore. This is the line you have to change to fix it: <xforms:insert ev:event="DOMActivate" context="instance('data-instance')/item" nodeset="item/al" at="1" position="before" origin="instance('data-template')"/> Hope it helps. German On Tue, Aug 11, 2009 at 8:09 AM, JohnBampton <[hidden email]> wrote:
-- 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 |
Hi, That works but I want to make the following a required field:
<xforms:input id="alname" ref="name" incremental="true" class="input"> <xforms:label class="fixed-width">Name</xforms:label> <xforms:alert>Name is required</xforms:alert> </xforms:input> and without the original instance when I type in the alname field the required icon does not disappear?!? Any ideas? Regards
|
Probably the nodeset attribute in the bind its wrong, it should be something like this:
<xforms:bind nodeset="instance('data-instance')/item/name" type="xs:string" required="true()"/> Regards, German On Tue, Aug 11, 2009 at 10:39 AM, JohnBampton <[hidden email]> wrote:
-- 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 |
hi, that doesn't work because the name element is a child of the al element which is no longer in that instance because you said to remove that part of the instance.
any ideas? Regards, John.
|
Hi John,
There's something I'm not getting. You remove the <al> node from the instance, but with the insert trigger, your are adding it! so the bind should work. Could you attach the full instance + the bind? maybe if i see it i can spot the error. Regards, German On Tue, Aug 11, 2009 at 10:38 PM, JohnBampton <[hidden email]> wrote:
-- 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 |