Re: Event Handling within nested XBL components
Posted by
Philip.Cantin on
Jul 20, 2009; 4:53pm
URL: https://discuss.orbeon.com/Event-Handling-within-nested-XBL-components-tp45002p45004.html
Alex,
While this bug is being investigated, I was wondering if it was possible to somehow "capture" the context being passed to the main form's <xxforms:dialog> control from the nested XBL component, and use it in an <xforms:setvalue> statement within the main form. I was able to do this once using the 'xxforms-dialog-open' event inside <xforms:setvalue>, but I can't seem to reference that context a second time outside of the 'xxforms-dialog-open' event.
Is there a way I can achieve this? Perhaps I can dispatch an event like this:
<xxforms:dialog id="my-dialog">
<xf:action ev:event="xxforms-dialog-open">
<xf:setvalue ref="..." value="event('my-event')" />
<xf:dispatch name="dialog-event1" target="my-dialog">
<xxforms:context name="dialog-context1" select="event('my-event')" />
</xf:dispatch>
</xf:action>
...
</xxforms:dialog>
and reference the context of the event somewhere else within <xxforms:dialog>?
In short, my ultimate goal is simply to have a textarea display the value coming from a nested XBL component. And the code I am referencing above is the same code that is provided as an attachment within this thread.
Thanks in advance!
---Philip
Alessandro Vernet wrote
Philip,
Philip.Cantin wrote
I already understand how to pass information from inner XBL nodes to outer XBL nodes, but how does one pass information the other way?
I've tried using the <xbl:handlers> tag to pass information from the main XHTML form downward to the innermost XBL component, but this doesn't seem to work. What's the proper way of doing this, if any?
I think you *do* understand well how it is supposed to work, but it looks to me like there is a glitch. I think you had a typo in your code where idinfo.xbl was dispatching pass-value3 to citation-component, but citation.xbl had a listener for pass-value2. So I changed that pass-value3 by pass-value2, but it doesn't solve the problem: for some reason, pass-value2 doesn't seem to get to the citation.
For now I added a bug for this, but we'll investigate this one further.
http://forge.ow2.org/tracker/index.php?func=detail&aid=314033&group_id=168&atid=350207Alex