Re: EventListener , target being a programatically created widget (dojo)
It worked. I just needed to make sure that the id of the widget is the same as the id of the component. This is what i was missing in the begining. (And i passed the id as a target.) Alex On 12/20/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: Have you even tried it? This is definitely thought out and well supported so I don't see why it wouldn't work. Dojo has an internal client side manager that knows about widgetId's so it lets me do things like dojo.widget.byId(yourComponent.clientId) to get a reference to your widget without any help from you. The Tapestry Timetracker demo is a perfect example of this. It targets a function of the Autocomplete component which wraps a dojo Select widget. This should be working perfectly. If it does not please let me know. On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: The tapestry component extends AbstractWidget but i don't think this has any influence on targeting the widget.. Alex On 12/20/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I'm a bit confused.. What i want to target is not a tapestry component but the dojo widget created by the component. As a matter of fact , in the generated html, the tapestry component id is not even present anymore. Instead i have the javascript which created the tree with the parameters provided by the tapestry component. And one of the parameter is the widgetId which i want to target. The events i would like to listen to are , in fact , the events of the dojo tree and not of the component i built. So, very simplified , my component does : var tree = dojo.widget.createWidget(TreeV3,{widgetId: myProvidedWidgetId}); I got the feeling my component is wrong :) Alex On 12/20/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: Yes that will work, but only if the component being targeted implements IWidget. (or extends AbstractWidget) On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I might be asking too much : Is it possible to use the @EventListener with the target being a programatically created widget ? The widget is the dojo tree widget. I built a tapestry component out of it , which creates the tree in a programatic way. At the creation of the tree i provide a widgetId. I want in my page to have something like this : @EventListener(targets=theProvidedWidgetId ,events=afterAddChild) public void doSomething() { } The event afterAddCHild is an existent event in the widget tree. I have already tried it. What i'm not sure is if it should normally work or not since the widgetId doesn't exist in the html template. Thanks ! Alex -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EventListener , target being a programatically created widget (dojo)
In the mean time i found out that the afterAddChild is a topic . So my problem is solved by subscribing to this topic with whatever function i want. I'm still interested in the answer though. thanks for any feedback ! Alex On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I might be asking too much : Is it possible to use the @EventListener with the target being a programatically created widget ? The widget is the dojo tree widget. I built a tapestry component out of it , which creates the tree in a programatic way. At the creation of the tree i provide a widgetId. I want in my page to have something like this : @EventListener(targets=theProvidedWidgetId ,events=afterAddChild) public void doSomething() { } The event afterAddCHild is an existent event in the widget tree. I have already tried it. What i'm not sure is if it should normally work or not since the widgetId doesn't exist in the html template. Thanks ! Alex
Re: EventListener , target being a programatically created widget (dojo)
Yes that will work, but only if the component being targeted implements IWidget. (or extends AbstractWidget) On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I might be asking too much : Is it possible to use the @EventListener with the target being a programatically created widget ? The widget is the dojo tree widget. I built a tapestry component out of it , which creates the tree in a programatic way. At the creation of the tree i provide a widgetId. I want in my page to have something like this : @EventListener(targets=theProvidedWidgetId ,events=afterAddChild) public void doSomething() { } The event afterAddCHild is an existent event in the widget tree. I have already tried it. What i'm not sure is if it should normally work or not since the widgetId doesn't exist in the html template. Thanks ! Alex -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EventListener , target being a programatically created widget (dojo)
I'm a bit confused.. What i want to target is not a tapestry component but the dojo widget created by the component. As a matter of fact , in the generated html, the tapestry component id is not even present anymore. Instead i have the javascript which created the tree with the parameters provided by the tapestry component. And one of the parameter is the widgetId which i want to target. The events i would like to listen to are , in fact , the events of the dojo tree and not of the component i built. So, very simplified , my component does : var tree = dojo.widget.createWidget(TreeV3,{widgetId: myProvidedWidgetId}); I got the feeling my component is wrong :) Alex On 12/20/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: Yes that will work, but only if the component being targeted implements IWidget. (or extends AbstractWidget) On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I might be asking too much : Is it possible to use the @EventListener with the target being a programatically created widget ? The widget is the dojo tree widget. I built a tapestry component out of it , which creates the tree in a programatic way. At the creation of the tree i provide a widgetId. I want in my page to have something like this : @EventListener(targets=theProvidedWidgetId ,events=afterAddChild) public void doSomething() { } The event afterAddCHild is an existent event in the widget tree. I have already tried it. What i'm not sure is if it should normally work or not since the widgetId doesn't exist in the html template. Thanks ! Alex -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EventListener , target being a programatically created widget (dojo)
The tapestry component extends AbstractWidget but i don't think this has any influence on targeting the widget.. Alex On 12/20/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I'm a bit confused.. What i want to target is not a tapestry component but the dojo widget created by the component. As a matter of fact , in the generated html, the tapestry component id is not even present anymore. Instead i have the javascript which created the tree with the parameters provided by the tapestry component. And one of the parameter is the widgetId which i want to target. The events i would like to listen to are , in fact , the events of the dojo tree and not of the component i built. So, very simplified , my component does : var tree = dojo.widget.createWidget(TreeV3,{widgetId: myProvidedWidgetId}); I got the feeling my component is wrong :) Alex On 12/20/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: Yes that will work, but only if the component being targeted implements IWidget. (or extends AbstractWidget) On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I might be asking too much : Is it possible to use the @EventListener with the target being a programatically created widget ? The widget is the dojo tree widget. I built a tapestry component out of it , which creates the tree in a programatic way. At the creation of the tree i provide a widgetId. I want in my page to have something like this : @EventListener(targets=theProvidedWidgetId ,events=afterAddChild) public void doSomething() { } The event afterAddCHild is an existent event in the widget tree. I have already tried it. What i'm not sure is if it should normally work or not since the widgetId doesn't exist in the html template. Thanks ! Alex -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EventListener , target being a programatically created widget (dojo)
Have you even tried it? This is definitely thought out and well supported so I don't see why it wouldn't work. Dojo has an internal client side manager that knows about widgetId's so it lets me do things like dojo.widget.byId(yourComponent.clientId) to get a reference to your widget without any help from you. The Tapestry Timetracker demo is a perfect example of this. It targets a function of the Autocomplete component which wraps a dojo Select widget. This should be working perfectly. If it does not please let me know. On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: The tapestry component extends AbstractWidget but i don't think this has any influence on targeting the widget.. Alex On 12/20/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I'm a bit confused.. What i want to target is not a tapestry component but the dojo widget created by the component. As a matter of fact , in the generated html, the tapestry component id is not even present anymore. Instead i have the javascript which created the tree with the parameters provided by the tapestry component. And one of the parameter is the widgetId which i want to target. The events i would like to listen to are , in fact , the events of the dojo tree and not of the component i built. So, very simplified , my component does : var tree = dojo.widget.createWidget(TreeV3,{widgetId: myProvidedWidgetId}); I got the feeling my component is wrong :) Alex On 12/20/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: Yes that will work, but only if the component being targeted implements IWidget. (or extends AbstractWidget) On 12/19/06, Alexandru Dragomir [EMAIL PROTECTED] wrote: I might be asking too much : Is it possible to use the @EventListener with the target being a programatically created widget ? The widget is the dojo tree widget. I built a tapestry component out of it , which creates the tree in a programatic way. At the creation of the tree i provide a widgetId. I want in my page to have something like this : @EventListener(targets=theProvidedWidgetId ,events=afterAddChild) public void doSomething() { } The event afterAddCHild is an existent event in the widget tree. I have already tried it. What i'm not sure is if it should normally work or not since the widgetId doesn't exist in the html template. Thanks ! Alex -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]