Hi everybody,
I'm looking for a way to capture the event that the selection of the xforms:select1 control was changed by the user. So that upon making a selection in the tree I can set the focus to a different control. (Example Code below). <xhtml:head> <xforms:model> <!-- MAIN-INSTANCE, holds all needed form elements --> <xforms:instance id="main-instance"> <form> <tree/> </form> </xforms:instance> </xforms:model> </xhtml:head> <xhtml:body> <xforms:select1 ref="tree" appearance="xxforms:tree"> <xforms:label>Gender:</xforms:label> <xforms:item> <xforms:label>Male</xforms:label><xforms:value>M</xforms:value> </xforms:item> <xforms:item> <xforms:label>Female</xforms:label><xforms:value>F</xforms:value> </xforms:item> </xforms:select1> <xforms:input ref="tree"/> </xhtml:body> </xhtml:html> The input control is already updated with the correct values, I just need a way to set the focus to it (and preferably select the complete content), so that starting to type will overwrite the value in the input box. Any ideas? kind regards Rene -- 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 |
Rene Single wrote:
> I'm looking for a way to capture the event that the selection of the > xforms:select1 control was changed by the user. > So that upon making a selection in the tree I can set the focus to a > different control. (Example Code below). Rene, I use the setfocus element, triggered by the DOMActivate event. I haven't seen anything that would select the content, though. -Jim -- 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 |
Jim Logan wrote: > > I use the setfocus element, triggered by the DOMActivate event. I > haven't seen anything that would select the content, though. > Jim, Can you give some example code of how you use the setfocus Element, because I tried this and I couldn't get it to set the focus. Example Code below again. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"> <xhtml:head> <xforms:model> <!-- MAIN-INSTANCE, holds all needed form elements --> <xforms:instance id="main-instance"> <form> <tree/> </form> </xforms:instance> </xforms:model> </xhtml:head> <xhtml:body> <xforms:select1 ref="tree" appearance="xxforms:tree"> <xforms:label>Gender:</xforms:label> <xforms:item> <xforms:label>Male</xforms:label><xforms:value>M</xforms:value> </xforms:item> <xforms:item> <xforms:label>Female</xforms:label><xforms:value>F</xforms:value> </xforms:item> <xforms:action ev:event="DOMActivate"> <xforms:setfocus control="in"/> </xforms:action> </xforms:select1> <!-- edit here--> <xforms:input ref="tree" id="in"/> </xhtml:body> </xhtml:html> Any Idea what I'm missing here ? Thanks Rene -- 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 |
Rene Single wrote:
> > Jim Logan wrote: >> >> I use the setfocus element, triggered by the DOMActivate event. I >> haven't seen anything that would select the content, though. >> > Jim, > > Can you give some example code of how you use the setfocus Element, > because I tried this and I couldn't get it to set the focus. -Jim -- 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 |
Jim Logan schrieb: > Rene Single wrote: >> >> Jim Logan wrote: >>> >>> I use the setfocus element, triggered by the DOMActivate event. I >>> haven't seen anything that would select the content, though. >>> >> Jim, >> >> Can you give some example code of how you use the setfocus Element, >> because I tried this and I couldn't get it to set the focus. > If you change the event to "xforms-value-changed" it works. I don't > know why "DOMActivate" won't work within a select1. > Works like a charm ! Rene -- 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 |
Administrator
|
In reply to this post by Jim Logan-3
>> Can you give some example code of how you use the setfocus Element,
>> because I tried this and I couldn't get it to set the focus. > If you change the event to "xforms-value-changed" it works. I don't > know why "DOMActivate" won't work within a select1. The question is, really, what do you expect should trigger DOMActivate in a tree? Activation is loosely defined in DOM: http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-flow-activation Orbeon Forms uses DOMActivate: * When the user "activates" a trigger * When the user presses the enter/return key in an input field Other than that, I am not sure we use it. -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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Erik Bruchez wrote:
>>> Can you give some example code of how you use the setfocus Element, >>> because I tried this and I couldn't get it to set the focus. >> If you change the event to "xforms-value-changed" it works. I don't >> know why "DOMActivate" won't work within a select1. > > The question is, really, what do you expect should trigger DOMActivate > in a tree? Well, I expected the clicking of something in the tree to trigger DOMActivate. > Activation is loosely defined in DOM: > > http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-flow-activation > One relevant quote from that link is, "Implementations dispatch the DOMActivate event as default action of a click event." Therefore, I would think that clicking something in a tree should trigger DOMActivate. -Jim -- 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 |
Administrator
|
>> The question is, really, what do you expect should trigger
>> DOMActivate in a tree? > Well, I expected the clicking of something in the tree to trigger > DOMActivate. Would you want this to happen only if something changes in the tree? E.g. selecting a new branch / checkbox? Does the value >> Activation is loosely defined in DOM: >> >> http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-flow-activation > One relevant quote from that link is, "Implementations dispatch the > DOMActivate event as default action of a click event." Therefore, I > would think that clicking something in a tree should trigger > DOMActivate. It also says that "This section is currently being rewritten." ;-) So it seems that this is a fuzzy area. If DOMActivate == click, then we don't really DOMActivate but just click. The answer seems to be here that a click is not the only way of activating something. E.g. you can press "enter" on a link, or "space" on a button, and that also activates the item. This is pretty clear for links and buttons. It also seemed reasonable to use DOMActivate for an input field upon "enter", although one could argue against that as well (but this is in XForms 1.1: "An example was added to show the use of a DOMActivate handler on an input to automatically initiate a submission once a user enters and commits input, such as a search query."). What XForms 1.1 says as well, is that this is "Dispatched in response to: the "default action request" for a core form control, for instance pressing a button or hitting enter." Now for other controls, it is less clear. What does it mean to "activate a tree" was my initial question. I am not sure we have a very good answer yet. -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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Dear Erik
Not able to use .equals function in if condition Regards surendran -- 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 |
Administrator
|
More details, please.
-Erik On Aug 16, 2008, at 3:53 AM, Surendran M wrote: > Dear Erik > > Not able to use .equals function in if condition > > Regards > surendran > > > -- > 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 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |