You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hoang-Vu PHUNG <hv...@yahoo.fr> on 2011/05/11 15:24:16 UTC

Re : Easier way to have multiple submits doing different things?

Subclassing ?
 
Regards,
Vu

De : LLTYK <LL...@mailinator.com>
À : users@tapestry.apache.org
Envoyé le : Mercredi 11 Mai 2011 14h53
Objet : Easier way to have multiple submits doing different things?

Right now the pattern below is peppered all over my code. It annoys me,
having to create these booleans all the time. I think most of the time I
need to do things after the submitted data is sent in, so I can't do it in
the onSelected itself.


Anyone have any alternatives?




public class Page
{
  private boolean button1Clicked;
  private boolean button2Clicked;

  void onSelectedFromButton1()
  {
    button1Clicked = true;
  }

  void onSelectedFromButton2()
  {
    button2Clicked = true
  }

  void onSuccess()
  {
    if (button1Clicked)
    //do foo

    if (button2Clicked)
    //do bar
  }


--
View this message in context: http://tapestry-users.832.n2.nabble.com/Easier-way-to-have-multiple-submits-doing-different-things-tp6351722p6351722.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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