it doesn't seem that you have a custom dojo widget in place that would
justify using
AbstractWidget + the initialization script you showed.

If you do have a dojo widget, the easiest way to tie it to tapestry IMHO is
http://tacos.sourceforge.net/tacos4.1/components/dojo/DojoWidget.html

If you don't, there's already a tree component that works similarly as
you describe (generating similar markup):
http://tacos.sourceforge.net/tacos4.1/tacos-core/tapdocs/net.sf.tacos.Tacos/Tree/index.html

If you want to keep with your solution, i'd just change the .script
file you have into:
<initialization>
dojo.event.connect(dojo.byId("${component.clientId}"), "onclick", ${funcName});
</initialization>

or similar variations...

On Wed, Dec 17, 2008 at 6:08 PM, Stopp, Bryan
<bryan.st...@argushealth.com> wrote:
> All,
>  I've been working on this for a while and i can't seem to get it.
>
> I'm trying to create a tree structure in my application. I have re-used
> what i could from the tapestry-contrib project, however it doesn't have
> the same capabilities and/or look&feel that we are going for. So instead
> i worked out my own. I have most of it working except I can't get the
> AJAX widget functionality to work.
>
> The tree is designed as a hierarchy of UnorderedLists (<ul>) wich each
> node being a List Item (<li>). So I created a class, ListItemWidget,
> which is meant to have an on-click function to expand/collapse itself.
> It extends Abstract Widget and implements IDirect. However my problem
> isn't in this definition, it's in creating the script to bind into the
> class to activate this component's "trigger" method.
>
> Below is the script file i have created. I have tried using the exist
> Dojo components in Tapestry as an example, but i'm almost certain that
> they work because Dojo has a built-in type associated with each
> (Tapestry "Autocompleter" = Dojo "Select"). So i'm thinking that i am
> missing something. Any kind of help would be really appreciated. I hope
> to contribute it back to the contrib project if i can cleaned up and get
> it working properly. Thanks all!
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE script PUBLIC
>
> "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
>
> "http://tapestry.apache.org/dtd/Script_3_0.dtd";>
>
> <script>
>
> <input-symbol key="component" required="yes"/>
>
> <input-symbol key="treeViewId" required="yes"/>
>
> <input-symbol key="props" required="yes" />
>
> <let key="listItem" unique="yes">listItem</let>
>
> <let key="funcName" unique="yes">toggleNode</let>
>
> <body>
>
> <unique>dojo.require("tapestry.widget.Widget")</unique>
>
> </body>
>
> <initialization>
>
> tapestry.widget.synchronizeWidgetState("${component.clientId}",
> "Widget", ${props}, ${component.destroy});
>
> var ${listItem} = dojo.widget.byId("${component.clientId}");
>
> ${listItem}.onClick=${funcName};
>
> </initialization>
>
> </script>
>
>
>
> -Bryan
>
>
>
>
>
> PRIVILEGED AND CONFIDENTIAL
> This email transmission contains privileged and confidential information 
> intended only for the use of the individual or entity named above.  If the 
> reader of the email is not the intended recipient or the employee or agent 
> responsible for delivering it to the intended recipient, you are hereby 
> notified that any use, dissemination or copying of this email transmission is 
> strictly prohibited by the sender.  If you have received this transmission in 
> error, please delete the email and immediately notify the sender via the 
> email return address or mailto:postmas...@argushealth.com.  Thank you.
>
>
>
>



-- 
Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to