Yes indeed. 

The reason I've developed the habit of using afterRender() is that so often we 
need to pass the clientId of an embedded component to the JavaScript. In 
afterRender() we can be sure that all clientIds have been assigned. So now I 
just use afterRender() without giving it a second thought. Eg.

    public void afterRender() {

        // Give "textbox hints" to the first name and last name fields.

        
javaScriptSupport.require("textbox-hint").with(firstNameField.getClientId(), 
"Enter First Name", "#808080");
        
javaScriptSupport.require("textbox-hint").with(lastNameField.getClientId(), 
"Enter Last Name", "#808080");
    }
Geoff

On 18 Nov 2014, at 4:05 am, Thiago H de Paula Figueiredo <thiag...@gmail.com> 
wrote:

> On Mon, 17 Nov 2014 09:30:51 -0200, Chris Poulsen <mailingl...@nesluop.dk> 
> wrote:
> 
>> I tend to think of the the "after render requires" as initializers,
> 
> Actually, it can be used inside beginRender() or setupRender() with the exact 
> same result. :) Tapestry will only actually add the JavaScript stuff after 
> the whole HTML page is rendered anyway.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

Reply via email to