Error in repeat for controls having relevant

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

Error in repeat for controls having relevant

Binesh Gummadi
Hi,

My XBL components doesn't work in a repeat group. XBL components are initialized(execute js on xforms-enabled) as soon as they are inserted(xforms:insert) even if they are not relevant.

Repeat control has a checkbox and a inputbox. When I select the checkbox, inputbox becomes relevant. Since the initial state of checkbox is false(not selected), input control is not relevant and hense I don't expect xforms-enabled event to fire on input control. I do have couple of attributes on input control and they are not being populated(line 34 in js). I checked server logs and attributes are not populated as they are not relevant yet which makes sense but why is input control being initialized?

I checked source and other xbl controls that come with orbeon and they all use xforms-enabled to initialize the control.

Steps to reproduce
1. Access the page
2. Click on Add Another button
3. Select both checkboxes to make input controls relevant
4. Watch the displayed count next to input control. For the second input control the max is 100 which is the default. This should be 10

Please find the attached and will appreciate any input.

repeat-relevant-error.xhtml
input-counted.js 

Thanks
Binesh Gummadi
Reply | Threaded
Open this post in threaded view
|

Re: Error in repeat for controls having relevant

Binesh Gummadi
Erik! can you please shed some light here? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Error in repeat for controls having relevant

Binesh Gummadi
Erik,

I saw this git(http://gist.github.com/541554).
Did you get a chance to look into this?

Thanks
Binesh Gummadi
Reply | Threaded
Open this post in threaded view
|

Re: Error in repeat for controls having relevant

Alessandro  Vernet
Administrator
In reply to this post by Binesh Gummadi
Binesh,

The reason this doesn't work is that in the XBL you have around
everything a <xforms:group xbl:attr="model context ref bind"
xxbl:scope="outer">. The way the component is used, this binds to a
<node-selector>, which is non-relevant in your case because you have a
<xforms:bind nodeset="repeat/item/node-selector" relevant="../title =
'true'"/>, and <title> is empty. So nothing inside the group is
relevant, including the <xforms:output> generated by <xsl:copy-of
select="xxbl:parameter(., 'max')"/>, which means you can't get the
value of the "max" parameter. Does this make sense?

Alex

On Thu, Aug 19, 2010 at 10:50 AM, Binesh Gummadi
<[hidden email]> wrote:

>
> Hi,
>
> My XBL components doesn't work in a repeat group. XBL components are
> initialized(execute js on xforms-enabled) as soon as they are
> inserted(xforms:insert) even if they are not relevant.
>
> Repeat control has a checkbox and a inputbox. When I select the checkbox,
> inputbox becomes relevant. Since the initial state of checkbox is false(not
> selected), input control is not relevant and hense I don't expect
> xforms-enabled event to fire on input control. I do have couple of
> attributes on input control and they are not being populated(line 34 in js).
> I checked server logs and attributes are not populated as they are not
> relevant yet which makes sense but why is input control being initialized?
>
> I checked source and other xbl controls that come with orbeon and they all
> use xforms-enabled to initialize the control.
>
> Steps to reproduce
> 1. Access the page
> 2. Click on Add Another button
> 3. Select both checkboxes to make input controls relevant
> 4. Watch the displayed count next to input control. For the second input
> control the max is 100 which is the default. This should be 10
>
> Please find the attached and will appreciate any input.
>
> Thanks
> Binesh Gummadi
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n2331649/repeat-relevant-error.xhtml
> repeat-relevant-error.xhtml
> http://orbeon-forms-ops-users.24843.n4.nabble.com/file/n2331649/input-counted.js
> input-counted.js
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Error-in-repeat-for-controls-having-relevant-tp2331649p2331649.html
> Sent from the Orbeon Forms (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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Error in repeat for controls having relevant

Binesh Gummadi
Alex,

You are right about the usage and why it is not relevant when the page is initially loaded. But when checkbox is selected whole group becomes relevant and hence I should be able to see/access the the max attribute.

How is max attribute available on the first iteration and missing from second iteration when node-selector is relevant?

Thanks
Binesh Gummadi