You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by otto95 <Ri...@gmail.com> on 2009/01/20 17:28:21 UTC

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
> <Br...@argushealth.com> 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:postmaster@argushealth.com.  Thank you.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 4.1 Widget

Posted by otto95 <Ri...@gmail.com>.
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 <Ri...@gmail.com> 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
>>> <Br...@argushealth.com> 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:postmaster@argushealth.com.  Thank you.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
>>> Tapestry / Tacos developer
>>> Open Source / JEE Consulting
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Tapestry-4.1-Widget-tp1668522p2192339.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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


Re: Tapestry 4.1 Widget

Posted by Andreas Andreou <an...@di.uoa.gr>.
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 <Ri...@gmail.com> 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
>> <Br...@argushealth.com> 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:postmaster@argushealth.com.  Thank you.
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
>> Tapestry / Tacos developer
>> Open Source / JEE Consulting
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



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

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