Mark Stang wrote:

Yes.  Without going through a listener.



There is the trick that works for me well, it has only one OnSubmit listener in the parent page class,
so in a way there is no listener in the actual page, only methods which we call.


I extend my pages from my OnSubmitDelegatorPage

public class OnSubmitDelegatorPage extends BasePage{

private String onSubmitMethod;

public String getOnSubmitMethod(){
  return onSubmitMethod;
}

public void setOnSubmitMethod( String onSubmitMethod ){
  this.onSubmitMethod = onSubmitMethod;
}

public void onSubmit( IRequestCycle cycle ) throws Exception{
if( getOnSubmitMethod() != null ){
Method m = this.getClass().getMethod( getOnSubmitMethod(), new Class[]{IRequestCycle.class} );
if( m != null ){
m.invoke( this, new Object[]{cycle} );
}
}
setOnSubmitMethod( null );
}
}



Then in the html submit button looks like this:
<form action="" jwcid="crudForm">
<input type="submit" value="Delete" class="button" jwcid="@Submit" tag="deleteUser" selected="ognl:onSubmitMethod" />
................
This causes method deleteUser being executed by formSubmit listener after the rewind completes



And page spec says:
<page-specification class="com.kgionline.demo.tapestry.tag.pages.UserCRUDPage" >


<property-specification name="onSubmitMethod" type="java.lang.String"/>
<component id="crudForm" type="Form">
  <binding name="listener" expression="listeners.onSubmit"/>
</component>

</page-specification>


-- Thanks,

Konstantin Ignatyev

http://www.kgionline.com





PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2.700 tons of 
CFCs to the stratosphere, and increase their population by 263.000

Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools. New York: State University of New York Press, 1997: (4) (5) (p.206)


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



Reply via email to