Dear all,
While developing my application, this question keeps popping up again and again, so I thought it might be wise to pose it here. In several cases, we have a field which may either be a) entered by the user or b) found using a search dialog. In addition to the value binding, there is an attribute associated with the field to indicate whether the value was picked from a list, or manually entered. This value is used to quickly show entered/"custom" values in a different color/style than those known by the system, rather than having to check each value against the database to see which are which. The problem is that it seems both <xforms:setvalue> and entering text manually trigger the same event: xforms-value-changed. How can I tell the different between the two so that the appropriate action may be taken in each case? Many thanks in advance! -Gino
Gino Miceli
Forest Information Systems Specialist Food and Agriculture Organization of the United Nations FAO-Finland Cooperation Programme Sustainable Forest Management in a Changing Climate Forest Management Division, Rm. D-406 Viale delle Terme di Caracalla, s.n.c. 00153 Rome, Italy http://www.fao.org/forestry |
Administrator
|
Gino,
Since you know the values users can choose from, can you on xforms-value-changed compare if the entered value is one of those, and set the attribute in consequence? Doesn't this sound the right way to do it anyway? Say the dialog shows A, B, C. If the user types X, you want to mark it as a "custom" value. But if they type A, you'll want to mark it as a "provided" value, just as if users selected A from the dialog, right? Alex On Mon, Mar 29, 2010 at 7:15 AM, gino-m <[hidden email]> wrote: > > Dear all, > > While developing my application, this question keeps popping up again and > again, so I thought it might be wise to pose it here. > > In several cases, we have a field which may either be a) entered by the user > or b) found using a search dialog. In addition to the value binding, there > is an attribute associated with the field to indicate whether the value was > picked from a list, or manually entered. This value is used to quickly show > entered/"custom" values in a different color/style than those known by the > system, rather than having to check each value against the database to see > which are which. > > The problem is that it seems both <xforms:setvalue> and entering text > manually trigger the same event: xforms-value-changed. How can I tell the > different between the two so that the appropriate action may be taken in > each case? > > Many thanks in advance! > -Gino > > ----- > > Gino Miceli > Forestry Information Systems Specialist > > Food and Agriculture Organization of the United Nations > FAO-Finland Cooperation Programme > Sustainable Forest Management in a Changing Climate > Forest Management Division, Rm. D-406 > Forestry Department > Viale delle Terme di Caracalla, s.n.c. > 00153 Rome, Italy > Tel: +39 06 570.56765 > Fax: +39 06 570.55137 > Website: http://www.fao.org/forestry > > -- > View this message in context: http://n4.nabble.com/Determining-cause-of-xforms-value-changed-tp1695153p1695153.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 |
Good point. I was trying to avoid the extra requests to
validate the value, but I suppose it’s small compared to the total number of
AJAX requested going back and forth. I will consider doing this in our next iteration.
-Gino
Gino Miceli
Forest Information Systems Specialist Food and Agriculture Organization of the United Nations FAO-Finland Cooperation Programme Sustainable Forest Management in a Changing Climate Forest Management Division, Rm. D-406 Viale delle Terme di Caracalla, s.n.c. 00153 Rome, Italy http://www.fao.org/forestry |
In reply to this post by Alessandro Vernet
Alessandro, I forgot to mention that there are too many possible values to
load into the model; they are fetched/searching using separate submissions. Best, Gino
Gino Miceli
Forest Information Systems Specialist Food and Agriculture Organization of the United Nations FAO-Finland Cooperation Programme Sustainable Forest Management in a Changing Climate Forest Management Division, Rm. D-406 Viale delle Terme di Caracalla, s.n.c. 00153 Rome, Italy http://www.fao.org/forestry |
In reply to this post by Alessandro Vernet
Hi again! I’ve been trying to do this in my XBL component without
success. On xforms-value-changed, I trigger a submission which checks if the
value is valid (and returns the correctly formatted one). The problem is that my
xforms-submit-done handler only works when it is in the xforms <model>.
From there, I cannot figure out how to get at the component’s single-node
binding attributes. So, in the model I have something like: <xforms:submission id="validate-field-submission"
method="post" action="{$params/url}?scheme={$params/scheme}&q={$params/q}" replace="instance" instance="validation-result-instance"> </xforms:submission> <xforms:action ev:event="xforms-submit-done"
ev:observer="validate-field-submission"> … I’ve tried using <group>, and various combinations of
xbl:attr and xbl:scope to no avail. How get at the component’s @ref, etc. from
here? Thanks again! -Gino From: Alessandro Vernet
[via Orbeon Forms (ops-users)]
[mailto:[hidden email]] Gino,
View message @ http://n4.nabble.com/Determining-cause-of-xforms-value-changed-tp1695153p1747587.html
Gino Miceli
Forest Information Systems Specialist Food and Agriculture Organization of the United Nations FAO-Finland Cooperation Programme Sustainable Forest Management in a Changing Climate Forest Management Division, Rm. D-406 Viale delle Terme di Caracalla, s.n.c. 00153 Rome, Italy http://www.fao.org/forestry |
Administrator
|
Gino,
Are you saying that if you place the <xforms:action ev:event="xforms-submit-done" ev:observer="validate-field-submission"> in the "view" of your XBL component (inside <xbl:template>), it never gets called? Are you sure that this xforms:action is in the inner scope (xxbl:scope="inner")? Alex On Thu, Apr 1, 2010 at 6:13 AM, gino-m <[hidden email]> wrote: > Hi again! > > > > I’ve been trying to do this in my XBL component without success. On > xforms-value-changed, I trigger a submission which checks if the value is > valid (and returns the correctly formatted one). The problem is that my > xforms-submit-done handler only works when it is in the xforms <model>. > From there, I cannot figure out how to get at the component’s single-node > binding attributes. So, in the model I have something like: > > > > <xforms:submission > > id="validate-field-submission" > > method="post" > > > action="{$params/url}?scheme={$params/scheme}&q={$params/q}" > > replace="instance" > > instance="validation-result-instance"> > > </xforms:submission> > > <xforms:action ev:event="xforms-submit-done" > ev:observer="validate-field-submission"> … > > > > I’ve tried using <group>, and various combinations of xbl:attr and xbl:scope > to no avail. How get at the component’s @ref, etc. from here? > > > > Thanks again! > > -Gino > > > > From: Alessandro Vernet [via Orbeon Forms (ops-users)] [mailto:[hidden > email]] > Sent: 01 April 2010 03:58 > To: Miceli, Gino (FOMR) > Subject: Re: Determining cause of xforms-value-changed > > > > Gino, > > Since you know the values users can choose from, can you on > xforms-value-changed compare if the entered value is one of those, and > set the attribute in consequence? > > Doesn't this sound the right way to do it anyway? Say the dialog shows > A, B, C. If the user types X, you want to mark it as a "custom" value. > But if they type A, you'll want to mark it as a "provided" value, just > as if users selected A from the dialog, right? > > Alex > > On Mon, Mar 29, 2010 at 7:15 AM, gino-m <[hidden email]> wrote: > >> >> Dear all, >> >> While developing my application, this question keeps popping up again and >> again, so I thought it might be wise to pose it here. >> >> In several cases, we have a field which may either be a) entered by the >> user >> or b) found using a search dialog. In addition to the value binding, >> there >> is an attribute associated with the field to indicate whether the value >> was >> picked from a list, or manually entered. This value is used to quickly >> show >> entered/"custom" values in a different color/style than those known by the >> system, rather than having to check each value against the database to see >> which are which. >> >> The problem is that it seems both <xforms:setvalue> and entering text >> manually trigger the same event: xforms-value-changed. How can I tell the >> different between the two so that the appropriate action may be taken in >> each case? >> >> Many thanks in advance! >> -Gino >> >> ----- >> >> Gino Miceli >> Forestry Information Systems Specialist >> >> Food and Agriculture Organization of the United Nations >> FAO-Finland Cooperation Programme >> Sustainable Forest Management in a Changing Climate >> Forest Management Division, Rm. D-406 >> Forestry Department >> Viale delle Terme di Caracalla, s.n.c. >> 00153 Rome, Italy >> Tel: +39 06 570.56765 >> Fax: +39 06 570.55137 >> Website: http://www.fao.org/forestry >> >> -- >> View this message in context: >> http://n4.nabble.com/Determining-cause-of-xforms-value-changed-tp1695153p1695153.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 > > ________________________________ > > View message @ > http://n4.nabble.com/Determining-cause-of-xforms-value-changed-tp1695153p1747587.html > To unsubscribe from Determining cause of xforms-value-changed, click here. > > > > Gino Miceli Forestry Information Systems Specialist Food and Agriculture > Organization of the United Nations FAO-Finland Cooperation Programme > Sustainable Forest Management in a Changing Climate Forest Management > Division, Rm. D-406 Forestry Department Viale delle Terme di Caracalla, > s.n.c. 00153 Rome, Italy Tel: +39 06 570.56765 Fax: +39 06 570.55137 > Website: http://www.fao.org/forestry > ________________________________ > View this message in context: RE: Determining cause of xforms-value-changed > 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 |
Administrator
|
In reply to this post by Alessandro Vernet
Gino,
There is absolutely no problem; take it easy, and I'll see you around here in a few weeks. Alex On Fri, Apr 9, 2010 at 2:20 AM, gino-m <[hidden email]> wrote: > Hi Alessandro, > > > > Sorry for my delay in replying to your messages. I stopped receiving email > notifications of your replies; perhaps I forgot to check “notify me” when > posting. I will have an official visitor here all next week, but will then > continue our discussions and provide a few concrete examples. > > > > As always, thanks for your great work! > > > > -Gino > > > > Gino Miceli > > Forestry Information Systems Specialist > > > > Food and Agriculture Organization of the United Nations > > FAO-Finland Cooperation Programme > > Sustainable Forest Management in a Changing Climate > > Forest Management Division, Rm. D-406 > > Forestry Department > > Viale delle Terme di Caracalla, s.n.c. > > 00153 Rome, Italy > > Tel: +39 06 570.56765 > > Fax: +39 06 570.55137 > > E-mail: [hidden email] > > Website: http://www.fao.org/forestry > > Skype: Gino.Miceli > > > > Gino Miceli Forestry Information Systems Specialist Food and Agriculture > Organization of the United Nations FAO-Finland Cooperation Programme > Sustainable Forest Management in a Changing Climate Forest Management > Division, Rm. D-406 Forestry Department Viale delle Terme di Caracalla, > s.n.c. 00153 Rome, Italy Tel: +39 06 570.56765 Fax: +39 06 570.55137 > Website: http://www.fao.org/forestry > ________________________________ > View this message in context: Apologies for delay > 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 |
Free forum by Nabble | Edit this page |