Em Tue, 06 Oct 2009 14:36:51 -0300, 976 <amsc...@gmail.com> escreveu:

How should then onActivate and onPassivate look like?

Suppose your Client class has the following properties: id (an Integer), firstName, lastName.

Your onActivate would look like this (not tested):

private Client client;

public void onActivate(EventContext context) {

        client = new Client()

        int count = context.getCount();

        if (count >= 1) {
                client.setId(context.get(Integer.class, 0));
        }
        if (count >= 2) {
                client.setFirstName(context.get(String.class, 1));
        }
        if (count >= 3) {
                client.setastName(context.get(String.class, 2));
        }

}

public Object onPassivate() {

        List list = new ArrayList();
        list.add(client.getId());
        list.add(client.getFirstName());
        list.add(client.getLastName());

        return list;

}

I'm not able to sth that seemed to be easy - it normally takes me few mins do to it in JSF or Struts, so why not in Tapestry.

You just aren't used to Tapestry yet as you're to JSF or Struts, so the
comparison here is not exactly fair.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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

Reply via email to