if I have something like: <xf:repeat ref="a" id="repeat1"> <xf:action ev:event="action-event1"> <xf:message>event1</xf:message> </xf:action> <xf:repeat ref="b" id="repeat2"> <xf:action ev:event="action-event2"> <xf:message>event2</xf:message> </xf:action> <xf:repeat ref="c" id="repeat3"> <xf:action ev:event="action-event3"> <xf:message>event3</xf:message> </xf:action> <xhtml:input type="checkbox" onclick="ORBEON.xforms.Document.dispatchEvent('repeat1', 'action-event1');"/> <xhtml:input type="checkbox" onclick="ORBEON.xforms.Document.dispatchEvent('repeat2', 'action-event2');"/> <xhtml:input type="checkbox" onclick="ORBEON.xforms.Document.dispatchEvent('repeat3', 'action-event3');"/> </xf:repeat> </xf:repeat> </xf:repeat> Shouldn't something like this let me popup the various messages for each repeat with proper context for each iteration? I have no problem dispatching events to the proper model, but I can't seem to be able to do it to a control. I've tried hidden triggers and all sorts of things. I'm assuming that I'm just having difficulty getting the getting the proper targetID for the dispatch event. please help, thanks -- 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
|
Jeremiah,
You won't be able to dispatch an event to a control inside a repeat with JavaScript, because the XForms engine won't know from where the event is dispatched, which is necessary to do the dispatching properly. But in this case, why not use an <xforms:input> bound to a node of type xs:boolean? Then you can detect a xforms-value-changed, and run whatever action you need to run. This way you avoid writing JavaScript. Alex On Sat, Jan 16, 2010 at 3:26 PM, Jeremiah Jahn <[hidden email]> wrote: > if I have something like: > <xf:repeat ref="a" id="repeat1"> > <xf:action ev:event="action-event1"> > <xf:message>event1</xf:message> > </xf:action> > <xf:repeat ref="b" id="repeat2"> > <xf:action ev:event="action-event2"> > <xf:message>event2</xf:message> > </xf:action> > <xf:repeat ref="c" id="repeat3"> > <xf:action ev:event="action-event3"> > <xf:message>event3</xf:message> > </xf:action> > <xhtml:input type="checkbox" > onclick="ORBEON.xforms.Document.dispatchEvent('repeat1', > 'action-event1');"/> > <xhtml:input type="checkbox" > onclick="ORBEON.xforms.Document.dispatchEvent('repeat2', > 'action-event2');"/> > <xhtml:input type="checkbox" > onclick="ORBEON.xforms.Document.dispatchEvent('repeat3', > 'action-event3');"/> > </xf:repeat> > </xf:repeat> > </xf:repeat> > Shouldn't something like this let me popup the various messages for each > repeat with proper context for each iteration? I have no problem dispatching > events to the proper model, but I can't seem to be able to do it to a > control. I've tried hidden triggers and all sorts of things. I'm assuming > that I'm just having difficulty getting the getting the proper targetID for > the dispatch event. > please help, thanks > > -- > 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 Orbeon's Blog: http://www.orbeon.com/blog/ 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 |
The reason I didn't go down that path, is because it's a checkbox in a column in a table, and I'm using it to do an insert. I didn't want to have to have a separate value for each item, when the majority of them don't even exist yet. I can flush out my model to make sure that there is always a place holder for the xs:boolean, but didn't really want to if there was a simpler way to do it buy just using a checkbox to add and remove the element. Guess I'll have to do it the other way. Why is it that I can put triggers in the column (show/hide) buttons, and the engine knows where I'm coming from, but It doesn't when it's just an xhtml element? it seems like if there was a way to get the id from a repeat or to refer to one, then this would work. I'm just curious more than anything at this point. Anyway, thank you very much for the input (no pun intended).
On Jan 18, 2010, at 9:19 PM, Alessandro Vernet wrote: > Jeremiah, > > You won't be able to dispatch an event to a control inside a repeat > with JavaScript, because the XForms engine won't know from where the > event is dispatched, which is necessary to do the dispatching > properly. But in this case, why not use an <xforms:input> bound to a > node of type xs:boolean? Then you can detect a xforms-value-changed, > and run whatever action you need to run. This way you avoid writing > JavaScript. > > Alex > > On Sat, Jan 16, 2010 at 3:26 PM, Jeremiah Jahn <[hidden email]> wrote: >> if I have something like: >> <xf:repeat ref="a" id="repeat1"> >> <xf:action ev:event="action-event1"> >> <xf:message>event1</xf:message> >> </xf:action> >> <xf:repeat ref="b" id="repeat2"> >> <xf:action ev:event="action-event2"> >> <xf:message>event2</xf:message> >> </xf:action> >> <xf:repeat ref="c" id="repeat3"> >> <xf:action ev:event="action-event3"> >> <xf:message>event3</xf:message> >> </xf:action> >> <xhtml:input type="checkbox" >> onclick="ORBEON.xforms.Document.dispatchEvent('repeat1', >> 'action-event1');"/> >> <xhtml:input type="checkbox" >> onclick="ORBEON.xforms.Document.dispatchEvent('repeat2', >> 'action-event2');"/> >> <xhtml:input type="checkbox" >> onclick="ORBEON.xforms.Document.dispatchEvent('repeat3', >> 'action-event3');"/> >> </xf:repeat> >> </xf:repeat> >> </xf:repeat> >> Shouldn't something like this let me popup the various messages for each >> repeat with proper context for each iteration? I have no problem dispatching >> events to the proper model, but I can't seem to be able to do it to a >> control. I've tried hidden triggers and all sorts of things. I'm assuming >> that I'm just having difficulty getting the getting the proper targetID for >> the dispatch event. >> please help, thanks >> >> -- >> 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 > Orbeon's Blog: http://www.orbeon.com/blog/ > 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 -- 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
|
Jeremiah,
There are two issues that prevent us from knowing where the event comes from when you dispatch it from JavaScript: 1) ORBEON.xforms.Document.dispatchEvent() doesn't take the id of the source as a parameter. This would need to be added, so the server knows where the event comes from. This part is easy. 2) But even if we send the id of the source, the representation of the page kept by the server only contains what is related to XForms. So it doesn't contain HTML elements (with a few exceptions), and so it wouldn't know where that element is in the tree. So in addition to #1, the server would need to keep track of some HTML element (how to know which one?). This part is harder. Instead of using an xforms:input bound to a boolean node, which requires you to have as many nodes as you have iterations, you can: 1. Have an xforms:select on every iteration to generate a checkbox. You bind all the xforms:select to the same node (which could be in some "temporary" instance). 2. Each xforms:select has one item, each with a different value, which identifies the row. I am pretty sure we had an example showing this, and somehow can't find it. But does this make sense? Alex On Jan 18, 2010, at 9:50 PM, Jeremiah Jahn <[hidden email]> wrote: > The reason I didn't go down that path, is because it's a checkbox in > a column in a table, and I'm using it to do an insert. I didn't want > to have to have a separate value for each item, when the majority of > them don't even exist yet. I can flush out my model to make sure > that there is always a place holder for the xs:boolean, but didn't > really want to if there was a simpler way to do it buy just using a > checkbox to add and remove the element. Guess I'll have to do it the > other way. Why is it that I can put triggers in the column (show/ > hide) buttons, and the engine knows where I'm coming from, but It > doesn't when it's just an xhtml element? it seems like if there was > a way to get the id from a repeat or to refer to one, then this > would work. I'm just curious more than anything at this point. > Anyway, thank you very much for the input (no pun intended). > > > On Jan 18, 2010, at 9:19 PM, Alessandro Vernet wrote: > >> Jeremiah, >> >> You won't be able to dispatch an event to a control inside a repeat >> with JavaScript, because the XForms engine won't know from where the >> event is dispatched, which is necessary to do the dispatching >> properly. But in this case, why not use an <xforms:input> bound to a >> node of type xs:boolean? Then you can detect a xforms-value-changed, >> and run whatever action you need to run. This way you avoid writing >> JavaScript. >> >> Alex >> >> On Sat, Jan 16, 2010 at 3:26 PM, Jeremiah Jahn >> <[hidden email]> wrote: >>> if I have something like: >>> <xf:repeat ref="a" id="repeat1"> >>> <xf:action ev:event="action-event1"> >>> <xf:message>event1</xf:message> >>> </xf:action> >>> <xf:repeat ref="b" id="repeat2"> >>> <xf:action ev:event="action-event2"> >>> <xf:message>event2</xf:message> >>> </xf:action> >>> <xf:repeat ref="c" id="repeat3"> >>> <xf:action ev:event="action-event3"> >>> <xf:message>event3</xf:message> >>> </xf:action> >>> <xhtml:input type="checkbox" >>> onclick="ORBEON.xforms.Document.dispatchEvent('repeat1', >>> 'action-event1');"/> >>> <xhtml:input type="checkbox" >>> onclick="ORBEON.xforms.Document.dispatchEvent('repeat2', >>> 'action-event2');"/> >>> <xhtml:input type="checkbox" >>> onclick="ORBEON.xforms.Document.dispatchEvent('repeat3', >>> 'action-event3');"/> >>> </xf:repeat> >>> </xf:repeat> >>> </xf:repeat> >>> Shouldn't something like this let me popup the various messages >>> for each >>> repeat with proper context for each iteration? I have no problem >>> dispatching >>> events to the proper model, but I can't seem to be able to do it >>> to a >>> control. I've tried hidden triggers and all sorts of things. I'm >>> assuming >>> that I'm just having difficulty getting the getting the proper >>> targetID for >>> the dispatch event. >>> please help, thanks >>> >>> -- >>> 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 >> Orbeon's Blog: http://www.orbeon.com/blog/ >> 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 > > > -- > 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 -- 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 |
Indeed it does make sense, thanks for your answers.
On Jan 19, 2010, at 9:47 PM, Alessandro Vernet wrote: > Jeremiah, > > There are two issues that prevent us from knowing where the event comes from when you dispatch it from JavaScript: > > 1) ORBEON.xforms.Document.dispatchEvent() doesn't take the id of the source as a parameter. This would need to be added, so the server knows where the event comes from. This part is easy. > 2) But even if we send the id of the source, the representation of the page kept by the server only contains what is related to XForms. So it doesn't contain HTML elements (with a few exceptions), and so it wouldn't know where that element is in the tree. So in addition to #1, the server would need to keep track of some HTML element (how to know which one?). This part is harder. > > Instead of using an xforms:input bound to a boolean node, which requires you to have as many nodes as you have iterations, you can: > > 1. Have an xforms:select on every iteration to generate a checkbox. You bind all the xforms:select to the same node (which could be in some "temporary" instance). > 2. Each xforms:select has one item, each with a different value, which identifies the row. > > I am pretty sure we had an example showing this, and somehow can't find it. But does this make sense? > > Alex > > > > On Jan 18, 2010, at 9:50 PM, Jeremiah Jahn <[hidden email]> wrote: > >> The reason I didn't go down that path, is because it's a checkbox in a column in a table, and I'm using it to do an insert. I didn't want to have to have a separate value for each item, when the majority of them don't even exist yet. I can flush out my model to make sure that there is always a place holder for the xs:boolean, but didn't really want to if there was a simpler way to do it buy just using a checkbox to add and remove the element. Guess I'll have to do it the other way. Why is it that I can put triggers in the column (show/hide) buttons, and the engine knows where I'm coming from, but It doesn't when it's just an xhtml element? it seems like if there was a way to get the id from a repeat or to refer to one, then this would work. I'm just curious more than anything at this point. Anyway, thank you very much for the input (no pun intended). >> >> >> On Jan 18, 2010, at 9:19 PM, Alessandro Vernet wrote: >> >>> Jeremiah, >>> >>> You won't be able to dispatch an event to a control inside a repeat >>> with JavaScript, because the XForms engine won't know from where the >>> event is dispatched, which is necessary to do the dispatching >>> properly. But in this case, why not use an <xforms:input> bound to a >>> node of type xs:boolean? Then you can detect a xforms-value-changed, >>> and run whatever action you need to run. This way you avoid writing >>> JavaScript. >>> >>> Alex >>> >>> On Sat, Jan 16, 2010 at 3:26 PM, Jeremiah Jahn <[hidden email]> wrote: >>>> if I have something like: >>>> <xf:repeat ref="a" id="repeat1"> >>>> <xf:action ev:event="action-event1"> >>>> <xf:message>event1</xf:message> >>>> </xf:action> >>>> <xf:repeat ref="b" id="repeat2"> >>>> <xf:action ev:event="action-event2"> >>>> <xf:message>event2</xf:message> >>>> </xf:action> >>>> <xf:repeat ref="c" id="repeat3"> >>>> <xf:action ev:event="action-event3"> >>>> <xf:message>event3</xf:message> >>>> </xf:action> >>>> <xhtml:input type="checkbox" >>>> onclick="ORBEON.xforms.Document.dispatchEvent('repeat1', >>>> 'action-event1');"/> >>>> <xhtml:input type="checkbox" >>>> onclick="ORBEON.xforms.Document.dispatchEvent('repeat2', >>>> 'action-event2');"/> >>>> <xhtml:input type="checkbox" >>>> onclick="ORBEON.xforms.Document.dispatchEvent('repeat3', >>>> 'action-event3');"/> >>>> </xf:repeat> >>>> </xf:repeat> >>>> </xf:repeat> >>>> Shouldn't something like this let me popup the various messages for each >>>> repeat with proper context for each iteration? I have no problem dispatching >>>> events to the proper model, but I can't seem to be able to do it to a >>>> control. I've tried hidden triggers and all sorts of things. I'm assuming >>>> that I'm just having difficulty getting the getting the proper targetID for >>>> the dispatch event. >>>> please help, thanks >>>> >>>> -- >>>> 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 >>> Orbeon's Blog: http://www.orbeon.com/blog/ >>> 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 >> >> >> -- >> 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 > > -- > 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 -- 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 |