You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Burlaka <de...@gmail.com> on 2007/05/30 13:00:21 UTC

T4.1.2 How to generate URL to the listener method

Hi, All.

How can I generate URL for the listener method in my component? I need that
for my javascript function that must send async request to that URL. I can't
use DirectLink component because the element that will send request is
generated dynamically in another javascript function on the client side.

Thanks.

Re: T4.1.2 How to generate URL to the listener method

Posted by Denis Burlaka <de...@gmail.com>.
Thank you very much.
> You have to use the corresponding IEngineService service for the type 
> of url
> you are generating.. That is how everything in the system (including form
> urls) are generated.  Each service has different requirements on the 
> object
> type passed in but it's all more or less like:
>
> @InjectObject("service:tapestry.services.DirectService")
> public abstract IEngineService getDirectService();
>
> public String getUrl()
> {
>    String url = getDirectService().getLink(false, new
> DirectServiceParameter(/* params */)).getUrl();
>
>    return url;
> }
>
> Services can be found in hivedoc linked to off of:
>
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/index.html
>
> On 5/30/07, Denis Burlaka <de...@gmail.com> wrote:
>>
>> Hi, All.
>>
>> How can I generate URL for the listener method in my component? I need
>> that
>> for my javascript function that must send async request to that URL. I
>> can't
>> use DirectLink component because the element that will send request is
>> generated dynamically in another javascript function on the client side.
>>
>> Thanks.

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


Re: T4.1.2 How to generate URL to the listener method

Posted by Jesse Kuhnert <jk...@gmail.com>.
You have to use the corresponding IEngineService service for the type of url
you are generating.. That is how everything in the system (including form
urls) are generated.  Each service has different requirements on the object
type passed in but it's all more or less like:

@InjectObject("service:tapestry.services.DirectService")
public abstract IEngineService getDirectService();

public String getUrl()
{
    String url = getDirectService().getLink(false, new
DirectServiceParameter(/* params */)).getUrl();

    return url;
}

Services can be found in hivedoc linked to off of:

http://tapestry.apache.org/tapestry4.1/tapestry-framework/index.html

On 5/30/07, Denis Burlaka <de...@gmail.com> wrote:
>
> Hi, All.
>
> How can I generate URL for the listener method in my component? I need
> that
> for my javascript function that must send async request to that URL. I
> can't
> use DirectLink component because the element that will send request is
> generated dynamically in another javascript function on the client side.
>
> Thanks.
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com