validation not working for manual grid bind

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

validation not working for manual grid bind

kotharv
hello,

I found some issue while manually grouping as grid bind, see my sample code below,


           
            <xforms:instance id="fr-form-instance">
                <form>
                    <section-1>
                        <control-detail/>
                        <control-add/>
                        <control-5/>
                        <reasondetail>
                            <control-reason/>
                            <control-date/>
                        </reasondetail>
                    </section-1>
                </form>
            </xforms:instance>
           
            <xforms:instance id="reasondetail">
                 <reasondetail>
                        <control-reason/>
                        <control-date/>
                        </reasondetail>
            </xforms:instance>

           
            <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
                <xforms:bind id="section-1-bind" name="section-1" nodeset="section-1">
                    <xforms:bind id="control-detail-bind" name="control-detail" nodeset="control-detail"
                                 required="true()"
                                 type="xs:string"/>
                    <xforms:bind id="control-add-bind" name="control-add" nodeset="control-add"
                                 type="xforms:string"/>
                    
                        <xforms:bind name="control-reason" nodeset="reasondetail/control-reason"
                                 ref="reasondetail/control-reason"
                                 required="true()"/>
                        <xforms:bind name="control-date" nodeset="reasondetail/control-date"
                                 ref="reasondetail/control-date"
                                 type="xforms:date"/>
</xforms:bind>
               
                    <xforms:bind id="control-5-bind" name="control-5" nodeset="control-5" required="true()"
                                 type="xs:string"/>
               
                 
                </xforms:bind>
            </xforms:bind>

           

if I manually bing as a grid the required validity is not working, how can I overcome the issue
using orbeon3.9 so I need to manually do a grid bind to hide entire grid
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

Alessandro  Vernet
Administrator
Hi Vijay,

I am not sure to understand the question: are you trying to bind the whole grid, so you can maybe hide the whole thing? Or are you trying to do something different? What would be your expected behavior?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

kotharv
Hi Alex,

When I grouped manually to grid the controls in the group won't support validation, especially required validation.
 
Example:
<Foods>
<Favoritefood>
<Location>
</Foods>

Instance declared as below

<Xforms: instance id=foods>
<Foods>
<Favoritefood>
<Location>
</Foods>
</Xforms: instance>

If I bind this as below

<Xforms:bind id='food-bind' nodeset=foods name=foods >

All elements bind

</Xforms:bind>

Required validation is not working for elements
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

Alessandro  Vernet
Administrator
Hi Vijay,

And is this for a form you're creating with Form Builder, or are you writing XForms by hand? If the former, then this isn't supported. If the latter, could you create a minimal example that reproduces the problem, that we can run here, and attach it a response so we can look into it?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

kotharv
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

kotharv
In reply to this post by Alessandro Vernet
Alex,

I have attached the sample,

 <xforms:bind id="reasondetail-bind" name="reasondetail" nodeset="reasondetail">
                        <xforms:bind name="control-reason" nodeset="reasondetail/control-reason"
                                     ref="reasondetail/control-reason"
                                     required="true()"/>
                        <xforms:bind name="control-date" nodeset="reasondetail/control-date"
                                     ref="reasondetail/control-date"
                                     type="xforms:date"/>
                   </xforms:bind>

if you comment the bold xform:bind, you will see the reason text field as required field

else you will see as normal
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

Alessandro  Vernet
Administrator
Hi Vijay,

It isn't working because on the binds for the controls inside the repeat you had `ref="reasondetail/control-reason"`, but you're already inside a bind with `nodeset="reasondetail"`, so with the repeated `reasondetail` Orbeon Forms looks for `reasondetail/reasondetail/control-reason`, which it can 't find. Also, you might want to change `nodeset` into `ref` everywhere (now `ref` is used everywhere for consistency, and `nodeset` is deprecated). Does this make sense?

scratch_48.xml

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

kotharv
hello Alex,

thanks a lot and it make sense and working now.

Regards,
Vijay
Reply | Threaded
Open this post in threaded view
|

Re: validation not working for manual grid bind

Alessandro  Vernet
Administrator
Excellent Vijay, and thanks for confirming.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet