detecting the current repeat index

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

detecting the current repeat index

lrodrigues

Hello,

I’m trying to track the current repeat selection using the index() and xxforms:index() functions. Apparently, there is a problem with these functions when the selection is made by clicking on an output field. To see this, please run the attached example and execute the following steps:

  1. Click on the checkbox to the right of the word “Valencia
  2. Click on the word “bloody”. The selection bar moves to the first item and  “Current index: 1” is displayed at the top.
  3. Click on the “Show index” button. Although this trigger is placed out of the repeat, the selection bar moves to the 2nd item, and the number 2 is displayed in the popup window.

The same behavior happens when clicking on the “Set” triggers instead of the checkboxes. In my application, I need to know the currently selected index, not the last index selected by a click on a checkbox or a button. (An item is generally selected by a click on an output field.) Is there a way to do this?

Is there an event that gets dispatched by a click on an output field inside a repeat? An xxforms-focus event is traced in the log, but I was unable to track it. Alternatively, would it be possible to store the currently selected index on an instance? I tried to do it with a “calculate” but to no avail.

Thanks,

Luiz Rodrigues



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

repeatProblem.xhtml (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: detecting the current repeat index

Erik Bruchez
Administrator
Luiz Augusto M. Rodrigues wrote:
 > Hello,
 >
 > I’m trying to track the current repeat selection using the index() and
 > xxforms:index() functions. Apparently, there is a problem with these
 > functions when the selection is made by clicking on an output field. To
 > see this, please run the attached example and execute the following
steps:
 >
 >    1. Click on the checkbox to the right of the word “Valencia”
 >    2. Click on the word “bloody”. The selection bar moves to the first
 >       item and  “Current index: 1” is displayed at the top.
 >    3. Click on the “Show index” button. Although this trigger is placed
 >       out of the repeat, the selection bar moves to the 2^nd item, and
 >       the number 2 is displayed in the popup window.
 >
 > The same behavior happens when clicking on the “Set” triggers instead of
 > the checkboxes. In my application, I need to know the currently selected
 > index, not the last index selected by a click on a checkbox or a button.
 > (An item is generally selected by a click on an output field.) Is there
 > a way to do this?
 >
 > Is there an event that gets dispatched by a click on an output field
 > inside a repeat? An xxforms-focus event is traced in the log, but I was
 > unable to track it. Alternatively, would it be possible to store the
 > currently selected index on an instance? I tried to do it with a
 > “calculate” but to no avail.

Thanks for the bug report! That's a nice one. I entered and fixed the
following:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=307354&group_id=168&atid=350207

The issue was that we would attempt to update the current index upon
DOMFocusOut. We do this upon other events, the idea being that when
the user clicks on a repeated section, the index changes
appropriately.

However, we would do this also upon receiving DOMFocusOut. In this
particular example, DOMFocusOut is sent for the checkbox on the second
row when clicking on the trigger outside the repeat. So the index
would go from 1 to 2, instead of remaining on 1.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RES: detecting the current repeat index

lrodrigues
In reply to this post by lrodrigues
Erik,
Thanks a lot for the (quick) fix. It took me a while to test, but it
seems to work fine.
A couple of (unrelated) questions, any light will be much appreciated:
1) I would like <xforms:output .../> to display a read-only checkbox for
booleans, would you consider it?
2) I just noticed that a long page-flow (around 190 lines) takes a lot
of time to process, at least in version 4.6 using jboss. One of the
pages took 18 minutes to load. Do you know of any configuration settings
that would shorten this time?
3) Are there any plans on implementing the <repeat number()..> xforms
feature?
4) Can you give me some pointers on how to access instance data from
JavaScript?
That's all I have for now. Thanks again,
Luiz
-----Mensagem original-----
De: Erik Bruchez [mailto:[hidden email]] Em nome de Erik Bruchez
Enviada em: sexta-feira, 27 de julho de 2007 18:21
Para: [hidden email]
Assunto: Re: [ops-users] detecting the current repeat index

Luiz Augusto M. Rodrigues wrote:
 > Hello,
 >
 > I'm trying to track the current repeat selection using the index()
and
 > xxforms:index() functions. Apparently, there is a problem with these
 > functions when the selection is made by clicking on an output field.
To
 > see this, please run the attached example and execute the following
steps:
 >
 >    1. Click on the checkbox to the right of the word "Valencia"
 >    2. Click on the word "bloody". The selection bar moves to the
first
 >       item and  "Current index: 1" is displayed at the top.
 >    3. Click on the "Show index" button. Although this trigger is
placed
 >       out of the repeat, the selection bar moves to the 2^nd item,
and
 >       the number 2 is displayed in the popup window.
 >
 > The same behavior happens when clicking on the "Set" triggers instead
of
 > the checkboxes. In my application, I need to know the currently
selected
 > index, not the last index selected by a click on a checkbox or a
button.
 > (An item is generally selected by a click on an output field.) Is
there
 > a way to do this?
 >
 > Is there an event that gets dispatched by a click on an output field
 > inside a repeat? An xxforms-focus event is traced in the log, but I
was
 > unable to track it. Alternatively, would it be possible to store the
 > currently selected index on an instance? I tried to do it with a
 > "calculate" but to no avail.

Thanks for the bug report! That's a nice one. I entered and fixed the
following:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=307354&grou
p_id=168&atid=350207

The issue was that we would attempt to update the current index upon
DOMFocusOut. We do this upon other events, the idea being that when
the user clicks on a repeated section, the index changes
appropriately.

However, we would do this also upon receiving DOMFocusOut. In this
particular example, DOMFocusOut is sent for the checkbox on the second
row when clicking on the trigger outside the repeat. So the index
would go from 1 to 2, instead of remaining on 1.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RES: detecting the current repeat index

Erik Bruchez
Administrator
Luiz Augusto M. Rodrigues wrote:

> A couple of (unrelated) questions, any light will be much appreciated:
> 1) I would like <xforms:output .../> to display a read-only checkbox for
> booleans, would you consider it?

That doesn't sounds like something unreasonable, although at the moment
xforms:output only output text.

> 2) I just noticed that a long page-flow (around 190 lines) takes a lot
> of time to process, at least in version 4.6 using jboss. One of the
> pages took 18 minutes to load. Do you know of any configuration settings
> that would shorten this time?

18 minutes? Wow, I've never seen something like this!

Usually, yes, you should keep page flows short. This is often possible
by using matchers and regular expressions rather than creating one entry
per page. See the doc here:

   http://www.orbeon.com/ops/doc/reference-page-flow#matchers

> 3) Are there any plans on implementing the <repeat number()..> xforms
> feature?

It would be a really nice feature to have for sure, but it's not on our
immediate roadmap for now. As to how features make it into Orbeon Forms,
see the following:

   http://www.orbeon.com/ops/doc/home-faq#issue-fixing

> 4) Can you give me some pointers on how to access instance data from
> JavaScript?

This thread should help:

http://www.nabble.com/Re%3A-Accessing-instance-values-from-javascript-funtions-p11368963.html

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws