as said,
just like any event
you declare a method properly named

for example form fires prepare success event
and you capture it by declaring in enclosing component:

public void onSuccess()
or
public void onSuccessFromMyForm()

so to capture entitySaved event
just declare
public void onEntitySaved(Long id, MyEntity entity, boolean isNew)

or for cancel
public void onCancel()


Davor Hrg


On Wed, Mar 5, 2008 at 4:12 PM, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
>  Hi Davor,
>
>  I got your point, the thing I can't understand is the event, how to use
>  those events triggered in the onSuccess?
>
>
>
>  Davor Hrg wrote:
>  >
>  > public void onSuccess(){
>  >     if(isCancel){
>  >         _session.evict(_entity);//it is forgotten now
>  >         _resources.triggerEvent("cancel", new Object[0],null);
>  >     }else{
>  >         boolean isNew = _entity.getId() == null;
>  >         _session.saveOrUpdate(_entity);
>  >         _resources.triggerEvent("entitySaved", new
>  > Object[]{_entity.getId(), _entity, isNew},null);
>  >     }
>  >
>  > }
>  >
>  >
>
>  --
>  View this message in context: 
> http://www.nabble.com/T5%3A-determine-button-clicked-in-a-beaneditor-tp15841944p15852447.html
>
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to