Re: Tapestry 4.1 Widget
Thanks for your willingness to help. My Direct link looks like this: JSON Test Where LuceneFieldData is the name of my component. It implements IJSONRender and has a renderComponent method that uses a IJSONWriter. The RawUrlLinkRenderer throws a class cannot be found exception. I'm guessing this is in a jar other than tapestry framework? When removing the renderer parameter I get an exception that the Direct Link expects a Listener. What should I provide? Thanks. Rich Hephner Andreas Andreou-2 wrote: > > Just get the url of a directlink by any of the following: > - Render a hidden direct link and get it's href, or > - Render a direct link and set the renderer parameter to > http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/contrib/link/RawURLLinkRenderer.html > - or, generate the link with code (see how direct service/link does it > - you component would have > to implement IDirect) > > > On Tue, Jan 20, 2009 at 6:28 PM, otto95 wrote: >> >> I'm sorry for coming to this conversation late, but I have exactly the >> same >> issue. I'd like to do as you suggest, but how do you get the url for a >> component? >> >> I have a component that implements IJSONRender, but I can't figure out >> how >> to access it through a browser to get it's json output. Do I have to >> include >> it in something? >> >> Thanks. >> >> Rich Hephner >> >> >> Andreas Andreou-2 wrote: >>> >>> Check out dojo sources: the ComboBox widget and the dojo.io.bind calls >>> >>> So, if you have a url, you can do something like: >>> >>> dojo.io.bind({url:url,load:myFunction,mimetype:"text/json"}); >>> >>> and process the results in your function the way you like. Those >>> results are the ones >>> that renderComponent(IJSONWriter writer, IRequestCycle cycle) >>> generates becuase of the >>> text/json mimetype >>> >>> On Wed, Dec 17, 2008 at 8:56 PM, Stopp, Bryan >>> wrote: >>>> So I mis-represented my problem in my first post. What I'm really >>>> trying >>>> to do is: >>>> >>>> 1. Add an onclick() function to a component, which triggers a >>>> server-side method >>>> 2. Refresh another component on the page when the onclick has >>>> completed. >>>> >>>> All of this is for T4.1 by the way. >>>> >>>> I selected using the IDirect interface and generating a URL for the >>>> onclick method to call. However I don't know how to make tapestry/dojo >>>> call to that URL, nor how to tell tapestry to refresh the other >>>> component. >>>> >>>> I don't believe I can use a @EventListener as each component has a >>>> generated ClientID and according to the spec the "targets" attribute of >>>> this annotation has to have a unique ID. >>>> >>>> I've been trying to look at the existing Dojo examples but they and the >>>> documentation aren't of much help. Does anyone have any examples of >>>> components/widgets similar to this? >>>> >>>> >>>> >>>> >>>> -Bryan Stopp >>>> >>>> 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. >>>> >>>> >>>> >>>> >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>>> For additional commands, e-mail: users-h...@tapestry.apache.org >>>> >>>> >>> >>> >>> >>> -- >>> Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr >>> Tapestry / Tacos developer >>> Open So
Re: Tapestry 4.1 Widget
Just get the url of a directlink by any of the following: - Render a hidden direct link and get it's href, or - Render a direct link and set the renderer parameter to http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/contrib/link/RawURLLinkRenderer.html - or, generate the link with code (see how direct service/link does it - you component would have to implement IDirect) On Tue, Jan 20, 2009 at 6:28 PM, otto95 wrote: > > I'm sorry for coming to this conversation late, but I have exactly the same > issue. I'd like to do as you suggest, but how do you get the url for a > component? > > I have a component that implements IJSONRender, but I can't figure out how > to access it through a browser to get it's json output. Do I have to include > it in something? > > Thanks. > > Rich Hephner > > > Andreas Andreou-2 wrote: >> >> Check out dojo sources: the ComboBox widget and the dojo.io.bind calls >> >> So, if you have a url, you can do something like: >> >> dojo.io.bind({url:url,load:myFunction,mimetype:"text/json"}); >> >> and process the results in your function the way you like. Those >> results are the ones >> that renderComponent(IJSONWriter writer, IRequestCycle cycle) >> generates becuase of the >> text/json mimetype >> >> On Wed, Dec 17, 2008 at 8:56 PM, Stopp, Bryan >> wrote: >>> So I mis-represented my problem in my first post. What I'm really trying >>> to do is: >>> >>> 1. Add an onclick() function to a component, which triggers a >>> server-side method >>> 2. Refresh another component on the page when the onclick has completed. >>> >>> All of this is for T4.1 by the way. >>> >>> I selected using the IDirect interface and generating a URL for the >>> onclick method to call. However I don't know how to make tapestry/dojo >>> call to that URL, nor how to tell tapestry to refresh the other >>> component. >>> >>> I don't believe I can use a @EventListener as each component has a >>> generated ClientID and according to the spec the "targets" attribute of >>> this annotation has to have a unique ID. >>> >>> I've been trying to look at the existing Dojo examples but they and the >>> documentation aren't of much help. Does anyone have any examples of >>> components/widgets similar to this? >>> >>> >>> >>> >>> -Bryan Stopp >>> >>> 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. >>> >>> >>> >>> >>> >>> --------- >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >> >> >> >> -- >> 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 >> >> >> > > -- > View this message in context: > http://n2.nabble.com/Tapestry-4.1-Widget-tp1668522p2187365.html > Sent from the Tapestry Users mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- 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
Re: Tapestry 4.1 Widget
I'm sorry for coming to this conversation late, but I have exactly the same issue. I'd like to do as you suggest, but how do you get the url for a component? I have a component that implements IJSONRender, but I can't figure out how to access it through a browser to get it's json output. Do I have to include it in something? Thanks. Rich Hephner Andreas Andreou-2 wrote: > > Check out dojo sources: the ComboBox widget and the dojo.io.bind calls > > So, if you have a url, you can do something like: > > dojo.io.bind({url:url,load:myFunction,mimetype:"text/json"}); > > and process the results in your function the way you like. Those > results are the ones > that renderComponent(IJSONWriter writer, IRequestCycle cycle) > generates becuase of the > text/json mimetype > > On Wed, Dec 17, 2008 at 8:56 PM, Stopp, Bryan > wrote: >> So I mis-represented my problem in my first post. What I'm really trying >> to do is: >> >> 1. Add an onclick() function to a component, which triggers a >> server-side method >> 2. Refresh another component on the page when the onclick has completed. >> >> All of this is for T4.1 by the way. >> >> I selected using the IDirect interface and generating a URL for the >> onclick method to call. However I don't know how to make tapestry/dojo >> call to that URL, nor how to tell tapestry to refresh the other >> component. >> >> I don't believe I can use a @EventListener as each component has a >> generated ClientID and according to the spec the "targets" attribute of >> this annotation has to have a unique ID. >> >> I've been trying to look at the existing Dojo examples but they and the >> documentation aren't of much help. Does anyone have any examples of >> components/widgets similar to this? >> >> >> >> >> -Bryan Stopp >> >> 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. >> >> >> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > > > -- > 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 > > > -- View this message in context: http://n2.nabble.com/Tapestry-4.1-Widget-tp1668522p2187365.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 4.1 Widget
Check out dojo sources: the ComboBox widget and the dojo.io.bind calls So, if you have a url, you can do something like: dojo.io.bind({url:url,load:myFunction,mimetype:"text/json"}); and process the results in your function the way you like. Those results are the ones that renderComponent(IJSONWriter writer, IRequestCycle cycle) generates becuase of the text/json mimetype On Wed, Dec 17, 2008 at 8:56 PM, Stopp, Bryan wrote: > So I mis-represented my problem in my first post. What I'm really trying > to do is: > > 1. Add an onclick() function to a component, which triggers a > server-side method > 2. Refresh another component on the page when the onclick has completed. > > All of this is for T4.1 by the way. > > I selected using the IDirect interface and generating a URL for the > onclick method to call. However I don't know how to make tapestry/dojo > call to that URL, nor how to tell tapestry to refresh the other > component. > > I don't believe I can use a @EventListener as each component has a > generated ClientID and according to the spec the "targets" attribute of > this annotation has to have a unique ID. > > I've been trying to look at the existing Dojo examples but they and the > documentation aren't of much help. Does anyone have any examples of > components/widgets similar to this? > > > > > -Bryan Stopp > > 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. > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- 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
RE: Tapestry 4.1 Widget
So I mis-represented my problem in my first post. What I'm really trying to do is: 1. Add an onclick() function to a component, which triggers a server-side method 2. Refresh another component on the page when the onclick has completed. All of this is for T4.1 by the way. I selected using the IDirect interface and generating a URL for the onclick method to call. However I don't know how to make tapestry/dojo call to that URL, nor how to tell tapestry to refresh the other component. I don't believe I can use a @EventListener as each component has a generated ClientID and according to the spec the "targets" attribute of this annotation has to have a unique ID. I've been trying to look at the existing Dojo examples but they and the documentation aren't of much help. Does anyone have any examples of components/widgets similar to this? -Bryan Stopp 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. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 4.1 Widget
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: dojo.event.connect(dojo.byId("${component.clientId}"), "onclick", ${funcName}); or similar variations... On Wed, Dec 17, 2008 at 6:08 PM, Stopp, Bryan 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 () wich each > node being a List Item (). 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! > > > > > "-//Apache Software Foundation//Tapestry Script Specification 3.0//EN" > > "http://tapestry.apache.org/dtd/Script_3_0.dtd";> > > > >> > > > > > listItem > >toggleNode > > > >dojo.require("tapestry.widget.Widget") > > > >> > tapestry.widget.synchronizeWidgetState("${component.clientId}", > "Widget", ${props}, ${component.destroy}); > > var ${listItem} = dojo.widget.byId("${component.clientId}"); > > ${listItem}.onClick=${funcName}; > > > > > > > > -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
Tapestry 4.1 Widget
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 () wich each node being a List Item (). 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! http://tapestry.apache.org/dtd/Script_3_0.dtd";>listItem toggleNode dojo.require("tapestry.widget.Widget") tapestry.widget.synchronizeWidgetState("${component.clientId}", "Widget", ${props}, ${component.destroy}); var ${listItem} = dojo.widget.byId("${component.clientId}"); ${listItem}.onClick=${funcName}; -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.