On Wed, 15 Sep 2010 20:33:23 -0300, ael <alan-lua...@dash.com.ph> wrote:

Hello Everyone

Hi!

I have an active context which is a string value.

--- page1

Object onActivate(String value1){

        if(!value1.trim().equals("")){

                return null;
        }
        else
                return page2;
}

If you have an onActivate() method with a single parameter that isn't EventContext, List or Object[], the method will only be called if there's at least one context parameter.

The recommended way of dealing with a variable number of context parameters is receiving a single EventContext parameter:

Object onActivate(EventContext context) {
        if (context.getCount() == 0) {
                return page2;
        }
        String value = context.get(String.class, 0);
        ...
        return null;
}

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.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