Is there any way to expose value of the xfoms:repeat element's index to
make it usable to a host language like XSLT+XHTML used to construct a page? I have a dynamic table where an (line item) instance element can be rendered either as text, or an input element. The mode is determined by a value of another element (or attribute - as shown below) of the same line item. Another - related question - how can I produce line item numbers when using xforms:repeat? To illustrate this issue consider the following instance: <details> <detail original="true">det 1 value</detail> <detail original="true">det 2 value</detail> <detail original="false">det 3 value</detail> </details> I would like to render a table using the xforms:repeat element that would look like this: number | value 1 det 1 value 2 det 2 value 3 [det 3 value] <--- this line would be rendered as an form input field because the"original" attribute is set to "false" Possibly there is a way to use pure XForms construct to achieve the same result? Thanks Alex. -- 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 |
Administrator
|
Alexander Zatko wrote:
> Is there any way to expose value of the xfoms:repeat element's index > to make it usable to a host language like XSLT+XHTML used to > construct a page? When you use XSLT to construct a page, the result ends up usually as XForms+XHTML. Only at that point does the XForms engine kick in to "compile" the XForms+XHTML document into something it can execute. Since adding and removing rows in an xforms:repeat strictly involves the XForms engine, you cannot directly use a template language like XSLT to modify the UI. Only at the point where there is an XForms submission do you yield again control to the outside world. With a submission with instance="replace", what you can do is call external services and retrieve data. But this is not quite what you want to do. You guessed it: the answer is to use XForms to achieve this. > I have a dynamic table where an (line item) instance element can be > rendered either as text, or an input element. The mode is determined > by a value of another element (or attribute - as shown below) of the > same line item. I believe the ideal solution would be to use xforms:choose within xforms:repeat. However as pointed out in another post, the XForms spec does not predict how this should work: http://mail-archive.objectweb.org/ops-users/2005-08/msg00069.html Now you can use instead the relevant MIP. However this requires a trick. You need two nodes in the instance: one pointed to by xforms:input, the other one by xforms:output. By changing the relevant MIP, you can toggle the display of the two controls. I attach a working example illustrating this. As usual you can try it directly with the XForms sandbox: http://www.orbeon.com/ops/goto-example/xforms-sandbox > Another - related question - how can I produce line item numbers when > using xforms:repeat? I believe the position() function is what you are looking for. Within xforms:repeat, I expect this to work: <xforms:output value="position()"/> However it doesn't, and I can't find the right XPath API to set the context size and position. I just asked on the Saxon mailing-list and I hope we can resolve this soon. The bug to track this: http://forge.objectweb.org/tracker/index.php?group_id=168&atid=350207 -Erik -- 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 repeat.xhtml (3K) Download Attachment |
Erik,
Thank you for claryfiing the page building order in OPS. Knowing that makes it easier to decide capabilities of which process(or) to use to lay out what parts of a page (xsf:for versus xforms:repeat or xsl:value-of versus xforms:output). As for the line numbering, I tried the xfroms:output option before posting the email and it did not work (just as you have discovered). By the way, I appreciate your effort in investigating list posts and getting back with answers. A. On Aug 16, 2005, at 6:53 PM, Erik Bruchez wrote: > Alexander Zatko wrote: > > > Is there any way to expose value of the xfoms:repeat element's index > > to make it usable to a host language like XSLT+XHTML used to > > construct a page? > > When you use XSLT to construct a page, the result ends up usually as > XForms+XHTML. Only at that point does the XForms engine kick in to > "compile" the XForms+XHTML document into something it can execute. > > Since adding and removing rows in an xforms:repeat strictly involves > the XForms engine, you cannot directly use a template language like > XSLT to modify the UI. Only at the point where there is an XForms > submission do you yield again control to the outside world. With a > submission with instance="replace", what you can do is call external > services and retrieve data. But this is not quite what you want to do. > > You guessed it: the answer is to use XForms to achieve this. > > > I have a dynamic table where an (line item) instance element can be > > rendered either as text, or an input element. The mode is determined > > by a value of another element (or attribute - as shown below) of the > > same line item. > > I believe the ideal solution would be to use xforms:choose within > xforms:repeat. However as pointed out in another post, the XForms spec > does not predict how this should work: > > http://mail-archive.objectweb.org/ops-users/2005-08/msg00069.html > > Now you can use instead the relevant MIP. However this requires a > trick. You need two nodes in the instance: one pointed to by > xforms:input, the other one by xforms:output. By changing the relevant > MIP, you can toggle the display of the two controls. I attach a > working example illustrating this. As usual you can try it directly > with the XForms sandbox: > > http://www.orbeon.com/ops/goto-example/xforms-sandbox > > > Another - related question - how can I produce line item numbers when > > using xforms:repeat? > > I believe the position() function is what you are looking for. Within > xforms:repeat, I expect this to work: > > <xforms:output value="position()"/> > > However it doesn't, and I can't find the right XPath API to set the > context size and position. I just asked on the Saxon mailing-list and > I hope we can resolve this soon. The bug to track this: > > http://forge.objectweb.org/tracker/index.php?group_id=168&atid=350207 > > -Erik > > <repeat.xhtml> > -- > 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 -- 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 |
Administrator
|
Alexander Zatko wrote:
> Erik, > > Thank you for claryfiing the page building order in OPS. Knowing that > makes it easier to decide capabilities of which process(or) to use to > lay out what parts of a page (xsf:for versus xforms:repeat or > xsl:value-of versus xforms:output). > > As for the line numbering, I tried the xfroms:output option before > posting the email and it did not work (just as you have discovered). This will have to be fixed, but it's not trivial as from what I can tell, we need to upgrade to a newer Saxon to get the correct XPath APIs, and upgrading is not trivial either (I gave this a shot yesterday)! > By the way, I appreciate your effort in investigating list posts and > getting back with answers. You are welcome! -Erik -- 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 |
Administrator
|
In reply to this post by Alexander Žaťko
--- Alexander Zatko <[hidden email]> wrote:
> As for the line numbering, I tried the xfroms:output option before > posting the email and it did not work (just as you have discovered). Alex, Instead of position(), you can maybe use an <xforms:output value="count(preceding-sibling::*) + 1"/>. Also see the XForms repeat example which does something similar to display index of each item in the repeat. http://www.orbeon.com/ops/goto-example/xforms-repeat Alex -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
I tried to use the expression you mention as well as other ones - incluring literals like value="'test'" - and it looks like OPS is not procesing (correctly) xforms:output with "value" attribute. A. On Aug 22, 2005, at 6:48 PM, Alessandro Vernet wrote: > --- Alexander Zatko <[hidden email]> wrote: >> As for the line numbering, I tried the xfroms:output option before >> posting the email and it did not work (just as you have discovered). > > Alex, > > Instead of position(), you can maybe use an <xforms:output > value="count(preceding-sibling::*) + 1"/>. Also see the XForms repeat > example which does something similar to display index of each item in > the > repeat. > > http://www.orbeon.com/ops/goto-example/xforms-repeat > > Alex > > -- > Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > > > -- > 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 -- 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 |
Administrator
|
Hi Alex,
Can share with us an example that shows this behavior? Obviously an <xforms:output value="..."> is used in the "repeating elements" example to show the current line number, and that works. So it must be something specific in your code which either exposes a bug in the XForms engine, or is incorrect. Alex --- Alexander Zatko <[hidden email]> wrote: > Alex, > > I tried to use the expression you mention as well as other ones - > incluring literals like value="'test'" - and it looks like OPS is not > procesing (correctly) xforms:output with "value" attribute. > > > A. > > > On Aug 22, 2005, at 6:48 PM, Alessandro Vernet wrote: > > > --- Alexander Zatko <[hidden email]> wrote: > >> As for the line numbering, I tried the xfroms:output option before > >> posting the email and it did not work (just as you have discovered). > > > > Alex, > > > > Instead of position(), you can maybe use an <xforms:output > > value="count(preceding-sibling::*) + 1"/>. Also see the XForms repeat > > example which does something similar to display index of each item in > > the > > repeat. > > > > http://www.orbeon.com/ops/goto-example/xforms-repeat > > > > Alex > > > > -- > > Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > > > > > > -- > > 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 > > > > > -- > 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 > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
I am using the classic xforms engine (I need full browser compatibility) - maybe that's the reason why you do not see the bahavior? I modified the first page of the wizard-pfc file to show what I see. I am attaching only the changed files. A. On Aug 24, 2005, at 3:02 PM, Alessandro Vernet wrote: > Hi Alex, > > Can share with us an example that shows this behavior? Obviously an > <xforms:output value="..."> is used in the "repeating elements" > example to > show the current line number, and that works. So it must be something > specific in your code which either exposes a bug in the XForms engine, > or > is incorrect. > > Alex > > --- Alexander Zatko <[hidden email]> wrote: > >> Alex, >> >> I tried to use the expression you mention as well as other ones - >> incluring literals like value="'test'" - and it looks like OPS is not >> procesing (correctly) xforms:output with "value" attribute. >> >> >> A. >> >> >> On Aug 22, 2005, at 6:48 PM, Alessandro Vernet wrote: >> >>> --- Alexander Zatko <[hidden email]> wrote: >>>> As for the line numbering, I tried the xfroms:output option before >>>> posting the email and it did not work (just as you have discovered). >>> >>> Alex, >>> >>> Instead of position(), you can maybe use an <xforms:output >>> value="count(preceding-sibling::*) + 1"/>. Also see the XForms repeat >>> example which does something similar to display index of each item in >>> the >>> repeat. >>> >>> http://www.orbeon.com/ops/goto-example/xforms-repeat >>> >>> Alex >>> >>> -- >>> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ >>> >>> >>> -- >>> 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 >> >> >>> >> -- >> 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 >> > > -- > Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > > > -- > 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 -- 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 files.zip (1K) Download Attachment |
Administrator
|
Hi Alex,
You are doing this with the "XForms classic". That was the missing information! :) I managed to reproduce the issue and created an entry in the bug based for this: https://forge.objectweb.org/tracker/index.php?func=detail&aid=303969&group_id=168&atid=350207 The bug is now fixed and you can try this out with the next "unstable build" at the URL below. http://forge.objectweb.org/nightlybuilds/ops/ops/ Alex --- Alexander Zatko <[hidden email]> wrote: > Alex, > > I am using the classic xforms engine (I need full browser > compatibility) - maybe that's the reason why you do not see the > bahavior? I modified the first page of the wizard-pfc file to show what > I see. I am attaching only the changed files. > > A. > > > > > On Aug 24, 2005, at 3:02 PM, Alessandro Vernet wrote: > > > Hi Alex, > > > > Can share with us an example that shows this behavior? Obviously an > > <xforms:output value="..."> is used in the "repeating elements" > > example to > > show the current line number, and that works. So it must be something > > specific in your code which either exposes a bug in the XForms engine, > > > or > > is incorrect. > > > > Alex > > > > --- Alexander Zatko <[hidden email]> wrote: > > > >> Alex, > >> > >> I tried to use the expression you mention as well as other ones - > >> incluring literals like value="'test'" - and it looks like OPS is not > >> procesing (correctly) xforms:output with "value" attribute. > >> > >> > >> A. > >> > >> > >> On Aug 22, 2005, at 6:48 PM, Alessandro Vernet wrote: > >> > >>> --- Alexander Zatko <[hidden email]> wrote: > >>>> As for the line numbering, I tried the xfroms:output option before > >>>> posting the email and it did not work (just as you have > discovered). > >>> > >>> Alex, > >>> > >>> Instead of position(), you can maybe use an <xforms:output > >>> value="count(preceding-sibling::*) + 1"/>. Also see the XForms > repeat > >>> example which does something similar to display index of each item > in > >>> the > >>> repeat. > >>> > >>> http://www.orbeon.com/ops/goto-example/xforms-repeat > >>> > >>> Alex > >>> > >>> -- > >>> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > >>> > >>> > >>> -- > >>> 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 > >> > >> > >>> > >> -- > >> 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 > >> > > > > -- > > Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > > > > > > -- > > 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 > > > -- > 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 > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
I thought I mentioned it in the beginning of the thread, but it was a
long time ago. :-) Thanks A. On Aug 24, 2005, at 7:35 PM, Alessandro Vernet wrote: > Hi Alex, > > You are doing this with the "XForms classic". That was the missing > information! :) I managed to reproduce the issue and created an entry > in > the bug based for this: > > https://forge.objectweb.org/tracker/index.php? > func=detail&aid=303969&group_id=168&atid=350207 > > The bug is now fixed and you can try this out with the next "unstable > build" at the URL below. > > http://forge.objectweb.org/nightlybuilds/ops/ops/ > > Alex > > --- Alexander Zatko <[hidden email]> wrote: > >> Alex, >> >> I am using the classic xforms engine (I need full browser >> compatibility) - maybe that's the reason why you do not see the >> bahavior? I modified the first page of the wizard-pfc file to show >> what >> I see. I am attaching only the changed files. >> >> A. >>> >> >> >> On Aug 24, 2005, at 3:02 PM, Alessandro Vernet wrote: >> >>> Hi Alex, >>> >>> Can share with us an example that shows this behavior? Obviously an >>> <xforms:output value="..."> is used in the "repeating elements" >>> example to >>> show the current line number, and that works. So it must be something >>> specific in your code which either exposes a bug in the XForms >>> engine, >> >>> or >>> is incorrect. >>> >>> Alex >>> >>> --- Alexander Zatko <[hidden email]> wrote: >>> >>>> Alex, >>>> >>>> I tried to use the expression you mention as well as other ones - >>>> incluring literals like value="'test'" - and it looks like OPS is >>>> not >>>> procesing (correctly) xforms:output with "value" attribute. >>>> >>>> >>>> A. >>>> >>>> >>>> On Aug 22, 2005, at 6:48 PM, Alessandro Vernet wrote: >>>> >>>>> --- Alexander Zatko <[hidden email]> wrote: >>>>>> As for the line numbering, I tried the xfroms:output option >>>>>> before >>>>>> posting the email and it did not work (just as you have >> discovered). >>>>> >>>>> Alex, >>>>> >>>>> Instead of position(), you can maybe use an <xforms:output >>>>> value="count(preceding-sibling::*) + 1"/>. Also see the XForms >> repeat >>>>> example which does something similar to display index of each item >> in >>>>> the >>>>> repeat. >>>>> >>>>> http://www.orbeon.com/ops/goto-example/xforms-repeat >>>>> >>>>> Alex >>>>> >>>>> -- >>>>> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ >>>>> >>>>> >>>>> -- >>>>> 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 >>>> >>>> >>>>> >>>> -- >>>> 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 >>>> >>> >>> -- >>> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ >>> >>> >>> -- >>> 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 >>> >> -- >> 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 >> > > -- > Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ > > > -- > 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 -- 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 |
Free forum by Nabble | Edit this page |