Hello all,
Is there a way known to define model item properties xpath expressions somewhere else e.g. in the instance, refer to it in a model via bind and have the expression evaluated? Thank you in advance Peter -- 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
|
You mean not directly specifying XPath expression, for example, in the
"calculate" attribute, but using an evaluate()-style XPath extension function? Technically, this could be possible, but such a function is not available from XForms at the moment. -Erik [hidden email] wrote: > Hello all, > Is there a way known to define model item properties xpath expressions somewhere else e.g. in the instance, refer to it in a model via bind and have the expression evaluated? > > Thank you in advance > Peter -- 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 |
In reply to this post by Peter.Heintz
Yes I mean that,
I already tried it with the saxon:evaluate extension without success. So I have to use an "initialisation" pipeline or JavaScript to create my properties as literals, right? However I personal think having a evaluate feature is a thing XFroms should have, because I believe that there are more cases people do not just want to set those properties as a literal but using those from somewhere else. An other similar question came up to me, regarding xforms:setvalue. I am working on a new treeview implementation using xforms:repeat and I miss the possibility to set a node-value somewhere in my tree via xforms:setvalue with information coming from my repeat context instead of the "somewhere-node context" defined in the ref attribute. Do you have any idea how this could be done? Mit freundlichen Grüßen / Best regards, Peter Heintz -- Knorr-Bremse SfS GmbH COC BC,R/BCE11 Moosacher Straße 80,D-80809 Munich Phone +49 893547-1145 Fax +49 893547-2676 mailto:[hidden email] http://www.knorr-bremse.com -----Ursprüngliche Nachricht----- Von: Erik Bruchez [mailto:[hidden email]] Im Auftrag von Erik Bruchez Gesendet: Dienstag, 24. Januar 2006 17:16 An: [hidden email] Betreff: Re: [ops-users] XForms model item properties You mean not directly specifying XPath expression, for example, in the "calculate" attribute, but using an evaluate()-style XPath extension function? Technically, this could be possible, but such a function is not available from XForms at the moment. -Erik [hidden email] wrote: > Hello all, > Is there a way known to define model item properties xpath expressions somewhere else e.g. in the instance, refer to it in a model via bind and have the expression evaluated? > > Thank you in advance > Peter -- 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
|
[hidden email] wrote:
> Yes I mean that, > I already tried it with the saxon:evaluate extension without > success. > > So I have to use an "initialisation" pipeline or JavaScript to > create my properties as literals, right? You can produce an XForms model dynamically (but probably not with JavaScript). > However I personal think having a evaluate feature is a thing XFroms > should have, because I believe that there are more cases people do > not just want to set those properties as a literal but using those > from somewhere else. Sure it could make sense. Now if you think that even after all those years that people have spent implementing evaluate() extensions in XSLT processors, and XSLT 2.0 doesn't come with any such function, I don't know if there is hope to get this into XForms! > An other similar question came up to me, regarding > xforms:setvalue. I am working on a new treeview implementation using > xforms:repeat and I miss the possibility to set a node-value > somewhere in my tree via xforms:setvalue with information coming > from my repeat context instead of the "somewhere-node context" > defined in the ref attribute. Do you have any idea how this could be > done? Something like: <xforms:setvalue ref="." ...> ? -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 |
In reply to this post by Peter.Heintz
Hello Eric,
Thank you for your answer. Regarding setvalue I am looking for something else. Assuming I have got an instance like: <instance> <value2set/> <items> <item setvalue="setvalue1"/> <item setvalue="setvalue2"/> <item setvalue="setvalue3"/> ... </items> </instance> and a <xforms:repeat nodeset="/instance/items/item"> <xforms:trigger ...> <xforms:label .../> <xforms:action ...> <xforms:setvalue ref="/instance/value2set" value=./@setvalue/> </xforms:action> </xforms:trigger> </xforms:repeat> According xforms Spec. the setvalue is looking in /instance/value2set for an attribute setvalue what is a bit unfavourable in that case. The only way I see to do that, is to do something like: 1) Introducing an helper boolean attribute for each item. 2) Setting by the trigger the helper attribute(s) which are true to false. 3) Using the same trigger to set the actual helper attribute in the repeat context to true 4) using a calculation property to set the /instance/value2set with the setvalue of the item with the helper attribute set to true. A bit complex to reach the goal, isn't it? Regarding the evaluate stuff, I also do not have much hope that it will be introduced soon in xslt. However I hoped to be able to use the saxon extensions in OPS also with XForms. Regarding XSLT I have not missed and never used the evaluation extension so far. However in XForms as it is, I seen needs for such a function. Maybe XPath is too much driven from XSLT. Mit freundlichen Grüßen / Best regards, Peter Heintz -- Knorr-Bremse SfS GmbH COC BC,R/BCE11 Moosacher Straße 80,D-80809 Munich Phone +49 893547-1145 Fax +49 893547-2676 mailto:[hidden email] http://www.knorr-bremse.com -----Ursprüngliche Nachricht----- Von: Erik Bruchez [mailto:[hidden email]] Im Auftrag von Erik Bruchez Gesendet: Donnerstag, 26. Januar 2006 00:11 An: [hidden email] Betreff: Re: AW: [ops-users] XForms model item properties [hidden email] wrote: > Yes I mean that, > I already tried it with the saxon:evaluate extension without > success. > > So I have to use an "initialisation" pipeline or JavaScript to > create my properties as literals, right? You can produce an XForms model dynamically (but probably not with JavaScript). > However I personal think having a evaluate feature is a thing XFroms > should have, because I believe that there are more cases people do > not just want to set those properties as a literal but using those > from somewhere else. Sure it could make sense. Now if you think that even after all those years that people have spent implementing evaluate() extensions in XSLT processors, and XSLT 2.0 doesn't come with any such function, I don't know if there is hope to get this into XForms! > An other similar question came up to me, regarding > xforms:setvalue. I am working on a new treeview implementation using > xforms:repeat and I miss the possibility to set a node-value > somewhere in my tree via xforms:setvalue with information coming > from my repeat context instead of the "somewhere-node context" > defined in the ref attribute. Do you have any idea how this could be > done? Something like: <xforms:setvalue ref="." ...> ? -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
|
Peter,
You are right about xforms:setvalue, however there is a workaround. You can write: <xforms:setvalue ref="/instance/value2set" value=/instance/items/item[index('my-repeat')]/@setvalue/> This will work because as soon as the user interacts with the trigger, this will set the index of your repeat to point to that particular repeat iteration. (Of course you need id="my-repeat" on xforms:repeat). That's the way the BizDoc NG summary works. This is maybe not quite a simple as it should be, but still simple enough. Let us know is this works for you. As for evaluate(), I see nothing wrong fundamentally in having such a function available. Certainly, we could implement it as an extension. I entered a bug to track this: http://forge.objectweb.org/tracker/index.php?func=detail&aid=304579&group_id=168&atid=350207 No promise as to when this will be done, but you can always have a stab at it! -Erik [hidden email] wrote: > Hello Eric, > Thank you for your answer. > > Regarding setvalue I am looking for something else. > > Assuming I have got an instance like: > > <instance> > <value2set/> > <items> > <item setvalue="setvalue1"/> > <item setvalue="setvalue2"/> > <item setvalue="setvalue3"/> > ... > </items> > </instance> > > and a > <xforms:repeat nodeset="/instance/items/item"> > <xforms:trigger ...> > <xforms:label .../> > <xforms:action ...> > <xforms:setvalue ref="/instance/value2set" value=./@setvalue/> > </xforms:action> > </xforms:trigger> > </xforms:repeat> > > According xforms Spec. the setvalue is looking in /instance/value2set for an attribute setvalue what is a bit unfavourable in that case. > The only way I see to do that, is to do something like: > > 1) Introducing an helper boolean attribute for each item. > 2) Setting by the trigger the helper attribute(s) which are true to false. > 3) Using the same trigger to set the actual helper attribute in the repeat context to true > 4) using a calculation property to set the /instance/value2set with the setvalue of the item with the helper attribute set to true. > > A bit complex to reach the goal, isn't it? > > > Regarding the evaluate stuff, I also do not have much hope that it will be introduced soon in xslt. However I hoped to be able to use the saxon extensions in OPS also with XForms. > Regarding XSLT I have not missed and never used the evaluation extension so far. However in XForms as it is, I seen needs for such a function. Maybe XPath is too much driven from XSLT. > > > Mit freundlichen Grüßen / Best regards, > Peter Heintz > -- > Knorr-Bremse SfS GmbH > COC BC,R/BCE11 > Moosacher Straße 80,D-80809 Munich > Phone +49 893547-1145 > Fax +49 893547-2676 > > mailto:[hidden email] > > http://www.knorr-bremse.com > > > -----Ursprüngliche Nachricht----- > Von: Erik Bruchez [mailto:[hidden email]] Im Auftrag von Erik Bruchez > Gesendet: Donnerstag, 26. Januar 2006 00:11 > An: [hidden email] > Betreff: Re: AW: [ops-users] XForms model item properties > > [hidden email] wrote: > > Yes I mean that, > > > I already tried it with the saxon:evaluate extension without > > success. > > > > So I have to use an "initialisation" pipeline or JavaScript to > > create my properties as literals, right? > > You can produce an XForms model dynamically (but probably not with > JavaScript). > > > However I personal think having a evaluate feature is a thing XFroms > > should have, because I believe that there are more cases people do > > not just want to set those properties as a literal but using those > > from somewhere else. > > Sure it could make sense. Now if you think that even after all those > years that people have spent implementing evaluate() extensions in > XSLT processors, and XSLT 2.0 doesn't come with any such function, I > don't know if there is hope to get this into XForms! > > > An other similar question came up to me, regarding > > xforms:setvalue. I am working on a new treeview implementation using > > xforms:repeat and I miss the possibility to set a node-value > > somewhere in my tree via xforms:setvalue with information coming > > from my repeat context instead of the "somewhere-node context" > > defined in the ref attribute. Do you have any idea how this could be > > done? > > Something like: > > <xforms:setvalue ref="." ...> > > ? > > -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 -- 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 |
In reply to this post by Peter.Heintz
Hello Erik,
Thank you for your help. Your suggestion works. I looked also in the new DMV Forms example where this is implemented. However I have an additional question what I can explain with this example. When we go to the summary list generated by xforms:repeat you highlight the selected record in yellow. When I select e.g. record No. 2 and press "Edit Selected" and when I go back afterwards via "Return to Form List" always the first record is selected. Here is my question. Is there a possibility to say OPS to highlight the record original selected (in my case record No. 2) ? -Peter -----Ursprüngliche Nachricht----- Von: Erik Bruchez [mailto:[hidden email]] Im Auftrag von Erik Bruchez Gesendet: Freitag, 27. Januar 2006 15:20 An: [hidden email] Betreff: Re: AW: AW: [ops-users] XForms model item properties Peter, You are right about xforms:setvalue, however there is a workaround. You can write: <xforms:setvalue ref="/instance/value2set" value=/instance/items/item[index('my-repeat')]/@setvalue/> This will work because as soon as the user interacts with the trigger, this will set the index of your repeat to point to that particular repeat iteration. (Of course you need id="my-repeat" on xforms:repeat). That's the way the BizDoc NG summary works. This is maybe not quite a simple as it should be, but still simple enough. Let us know is this works for you. As for evaluate(), I see nothing wrong fundamentally in having such a function available. Certainly, we could implement it as an extension. I entered a bug to track this: http://forge.objectweb.org/tracker/index.php?func=detail&aid=304579&group_id=168&atid=350207 No promise as to when this will be done, but you can always have a stab at it! -Erik [hidden email] wrote: > Hello Eric, > Thank you for your answer. > > Regarding setvalue I am looking for something else. > > Assuming I have got an instance like: > > <instance> > <value2set/> > <items> > <item setvalue="setvalue1"/> > <item setvalue="setvalue2"/> > <item setvalue="setvalue3"/> > ... > </items> > </instance> > > and a > <xforms:repeat nodeset="/instance/items/item"> > <xforms:trigger ...> > <xforms:label .../> > <xforms:action ...> > <xforms:setvalue ref="/instance/value2set" value=./@setvalue/> > </xforms:action> > </xforms:trigger> > </xforms:repeat> > > According xforms Spec. the setvalue is looking in /instance/value2set for an attribute setvalue what is a bit unfavourable in that case. > The only way I see to do that, is to do something like: > > 1) Introducing an helper boolean attribute for each item. > 2) Setting by the trigger the helper attribute(s) which are true to false. > 3) Using the same trigger to set the actual helper attribute in the repeat context to true > 4) using a calculation property to set the /instance/value2set with the setvalue of the item with the helper attribute set to true. > > A bit complex to reach the goal, isn't it? > > > Regarding the evaluate stuff, I also do not have much hope that it will be introduced soon in xslt. However I hoped to be able to use the saxon extensions in OPS also with XForms. > Regarding XSLT I have not missed and never used the evaluation extension so far. However in XForms as it is, I seen needs for such a function. Maybe XPath is too much driven from XSLT. > > > Mit freundlichen Grüßen / Best regards, > Peter Heintz > -- > Knorr-Bremse SfS GmbH > COC BC,R/BCE11 > Moosacher Straße 80,D-80809 Munich > Phone +49 893547-1145 > Fax +49 893547-2676 > > mailto:[hidden email] > > http://www.knorr-bremse.com > > > -----Ursprüngliche Nachricht----- > Von: Erik Bruchez [mailto:[hidden email]] Im Auftrag von Erik Bruchez > Gesendet: Donnerstag, 26. Januar 2006 00:11 > An: [hidden email] > Betreff: Re: AW: [ops-users] XForms model item properties > > [hidden email] wrote: > > Yes I mean that, > > > I already tried it with the saxon:evaluate extension without > > success. > > > > So I have to use an "initialisation" pipeline or JavaScript to > > create my properties as literals, right? > > You can produce an XForms model dynamically (but probably not with > JavaScript). > > > However I personal think having a evaluate feature is a thing XFroms > > should have, because I believe that there are more cases people do > > not just want to set those properties as a literal but using those > > from somewhere else. > > Sure it could make sense. Now if you think that even after all those > years that people have spent implementing evaluate() extensions in > XSLT processors, and XSLT 2.0 doesn't come with any such function, I > don't know if there is hope to get this into XForms! > > > An other similar question came up to me, regarding > > xforms:setvalue. I am working on a new treeview implementation using > > xforms:repeat and I miss the possibility to set a node-value > > somewhere in my tree via xforms:setvalue with information coming > > from my repeat context instead of the "somewhere-node context" > > defined in the ref attribute. Do you have any idea how this could be > > done? > > Something like: > > <xforms:setvalue ref="." ...> > > ? > > -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 -- 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
|
Peter,
I am glad it's working! You must have hit this bug: http://forge.objectweb.org/tracker/index.php?func=detail&aid=304543&group_id=168&atid=350207 This new example (we'll announce it "officially" soon!) has highlighted a few bugs which we hopefully will fix soon. -Erik [hidden email] wrote: > Hello Erik, > Thank you for your help. Your suggestion works. > > I looked also in the new DMV Forms example where this is implemented. > > However I have an additional question what I can explain with this example. > > When we go to the summary list generated by xforms:repeat you highlight the selected record in yellow. > When I select e.g. record No. 2 and press "Edit Selected" and when I go back afterwards via "Return to Form List" always the first record is selected. > > Here is my question. > > Is there a possibility to say OPS to highlight the record original selected (in my case record No. 2) ? > > -Peter -- 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 Erik Bruchez
Erik Bruchez wrote:
> As for evaluate(), I see nothing wrong fundamentally in having such a > function available. Certainly, we could implement it as an extension. I > entered a bug to track this: > > http://forge.objectweb.org/tracker/index.php?func=detail&aid=304579&group_id=168&atid=350207 > > No promise as to when this will be done, but you can always have a stab > at it! This is now "fixed" and we have an xxforms:evaluate() function, accessible from the model and from the controls. -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 |
In reply to this post by Peter.Heintz
Thank you,
that's fine. Mit freundlichen Grüßen / Best regards, Peter Heintz -----Ursprüngliche Nachricht----- Von: Erik Bruchez [mailto:[hidden email]] Im Auftrag von Erik Bruchez Gesendet: Freitag, 10. Februar 2006 00:27 An: [hidden email] Betreff: Re: [ops-users] XForms model item properties Erik Bruchez wrote: > As for evaluate(), I see nothing wrong fundamentally in having such a > function available. Certainly, we could implement it as an extension. I > entered a bug to track this: > > http://forge.objectweb.org/tracker/index.php?func=detail&aid=304579&group_id=168&atid=350207 > > No promise as to when this will be done, but you can always have a stab > at it! This is now "fixed" and we have an xxforms:evaluate() function, accessible from the model and from the controls. -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 |
Free forum by Nabble | Edit this page |