[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Programmatically generating DirectLinks with updateComponents
From:       Kaspar Fischer <fischerk () inf ! ethz ! ch>
Date:       2007-12-22 21:48:01
Message-ID: D8C92FAE-BF96-4EA9-B76D-EC74B6F45474 () inf ! ethz ! ch
[Download RAW message or body]

On 21.12.2007, at 19:29, Kaspar Fischer wrote:

> Hi,
>
> My custom component needs to emit in its renderComponent() method  
> several
> DirectLink with updateComponents information. That is, I need to  
> output the
> same HTML as
>
>   <a jwcid="@DirectLink" listener="listener:doClick"  
> updateComponents="result"></a>
>
> generates non-programmatically, but from within renderComponent().  
> How can
> I do this?
>
> Thanks,
> Kaspar

To give a concrete example: I tried to do it as follows:

   <div jwcid="@Block">
     <a jwcid="link@DirectLink" listener="listener:showResult"  
updateComponents="result"></a>
   </div>

   <div jwcid="@ResultElement" tree="ognl:mydate"/>

   <div jwcid="result@Block">
     <div jwcid="@Insert" value="ognl:result"></div>
   div>

... and from the code (ResultElement's renderComponent()) I try to  
render the link as follows:

     DirectLink link = (DirectLink)this.getContainer().getComponent 
("link");
     String url = link.getLink(cycle).getURL();
     writer.begin("a");
     writer.appendAttribute("href", url);
     writer.print(title);
     writer.end();

Unfortunately, this only outputs an ordinary link, not an AJAX link!

Any ideas how to output a AJAX link programmatically?

Thanks,
Kaspar

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic