Yeap, thanks Igor. I like the idea of calling the script with a parameter,
but overall a bit much compared to the one-liner on the client side, as ugly
as it may be. Adding such a component to the contrib lib or tacos might make
sense though. I'd think others might have similar needs.
Kalle
On 12/3/07, Igor Drobiazko <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> you you can do following:
>
> -your component should implement the interface IDirect
> -create a link:
> public ILink getLink(){
> return getDirectService().getLink(false, new
> DirectServiceParameter(this));
> }
>
> - and pass the url of the link as a parameter to your Script
> Map params = new HashMap();
> params.put("url", getLink().getURL());
> PageRenderSupport pageRenderSupport =
> TapestryUtils.getPageRenderSupport(cycle, this);
> getScript().execute(this, cycle, pageRenderSupport, params);
> - call the url in your script
> <script>
> <input-symbol key="url" required="yes" />
> <body>
> <unique>
> foo =function(){
> tapestry.bind("${url}", ........);
> }
> </unique>
> </body>
> </script>
>
> - update the components in you trigger() method:
> public void trigger(IRequestCycle cycle){
>
> getRequestCycle().getResponseBuilder().updateComponent("COMPONENT_ID")
> }
>
> Hope this helps
>
> On Dec 2, 2007 12:24 AM, Kalle Korhonen <[EMAIL PROTECTED]>
> wrote:
>
> > No - I want to trigger the update programmatically via Javascript, not
> > from
> > a user's click.
> >
> > Kalle
> >
> >
> > On 12/1/07, Ulrich Stärk <[EMAIL PROTECTED]> wrote:
> > >
> > > I can't follow you. You want a component to update itself
> asynchronously
> > > upon a user's click on a DirectLink? Why don't you just use
> DirectLink's
> > > updateComponents parameter with async="true"?
> > >
> > > Uli
> > >
> > > Kalle Korhonen schrieb:
> > > > I have a use case where I need to "click on" a directllink to
> > > > updatecomponents with async=true or do an equivalent action in
> > > Javascript. I
> > > > know I can do tapestry.bind('<span [EMAIL PROTECTED]/>') and it
> > makes
> > > > some sense, but looks rather ugly. Any cleaner way to accomplish
> this?
> > > >
> > > > Kalle
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>