Hide inputs initially in repeating region, then show with trigger click

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Hide inputs initially in repeating region, then show with trigger click

JohnBampton
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>
Reply | Threaded
Open this post in threaded view
|

Re: Hide inputs initially in repeating region, then show with trigger click

Ger G
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:

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>

--
View this message in context: http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24915558.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Hide inputs initially in repeating region, then show with trigger click

JohnBampton
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


Ger G wrote
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 <jbampton@gmail.com> wrote:

>
> 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>
>
> --
> View this message in context:
> http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24915558.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org mailing
> list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Hide inputs initially in repeating region, then show with trigger click

Ger G
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:

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



Ger G wrote:
>
> 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:
>
>>
>> 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>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24915558.html
>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> 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
>>
>>
>
>
> --
> 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
>
>

--
View this message in context: http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24917844.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Hide inputs initially in repeating region, then show with trigger click

JohnBampton
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.


Ger G wrote
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 <jbampton@gmail.com> wrote:

>
> 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
>
>
>
> Ger G wrote:
> >
> > 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 <jbampton@gmail.com> wrote:
> >
> >>
> >> 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>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24915558.html
> >> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >> --
> >> You receive this message as a subscriber of the ops-users@ow2.orgmailing
> >> list.
> >> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> >> For general help: mailto:sympa@ow2.org?subject=help
> >> OW2 mailing lists service home page: http://www.ow2.org/wws
> >>
> >>
> >
> >
> > --
> > You receive this message as a subscriber of the ops-users@ow2.orgmailing
> > list.
> > To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> > For general help: mailto:sympa@ow2.org?subject=help
> > OW2 mailing lists service home page: http://www.ow2.org/wws
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24917844.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org mailing
> list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Hide inputs initially in repeating region, then show with trigger click

Ger G
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:

hi,  that doesn't work becuase the name element is a child of the al element
which is no longer in that instance becuase you said to remove that part of
the instance.

any ideas?

Regards,

John.



Ger G wrote:
>
> 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:
>
>>
>> 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
>>
>>
>>
>> Ger G wrote:
>> >
>> > 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:
>> >
>> >>
>> >> 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>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24915558.html
>> >> Sent from the ObjectWeb OPS - Users mailing list archive at
>> Nabble.com.
>> >>
>> >>
>> >>
>> >> --
>> >> You receive this message as a subscriber of the
>> [hidden email]
>> >> 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
>> >>
>> >>
>> >
>> >
>> > --
>> > You receive this message as a subscriber of the
>> [hidden email]
>> > 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
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24917844.html
>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> 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
>>
>>
>
>
> --
> 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
>
>

--
View this message in context: http://www.nabble.com/Hide-inputs-initially-in-repeating-region%2C-then-show-with-trigger-click-tp24915558p24928632.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
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




--
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