Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The following page has been changed by ErikVullings: http://wiki.apache.org/tapestry/MoreFrequentlyAskedQuestions ------------------------------------------------------------------------------ == How do I use the pageRenderListener to setup my page before it is used? == Simply implement the PageRenderListener interface and override the pageBeginRender() routine. Often times you can just call initialize() from pageBeginRender() to setup the page  your logic in both routines may be the same. - + {{{ public abstract class AppointmentPage extends BasePage implements PageRenderListener { private Date date; @@ -40, +40 @@ public void initialize() { date = new Date(); } - + }}} == How do I pass information from page to page? == You can use a Visit object to keep state from page to page but this is probably overkill and cumbersome if you just want to pass some information from one page to the next. Instead you will want to create an instance of the next page, pass the parameter and then call (activate) the next page. Here is some sample code: Calling Page Java: + {{{ public void submitAction(IRequestCycle cycle) { // The next page we want to go to is the Result page AppointmentPage next_page = (AppointmentPage)cycle.getPage("Appointment"); @@ -53, +54 @@ next_page.setEvent(ÂBirthday PartyÂ); cycle.activate(next_page); } + }}} Appointment Page: + {{{ <property-specification name="date" type="java.lang.Date" persistent="yes"/> <property-specification name="event" type="java.lang.String" persistent="yes"/> - + }}} Appointment Page Java: + {{{ public void setDate(Date date); public void setEvent(String event); + }}} == I just created a new page and now I get a 'class instantiation problem'. Why canÂt it instantiate my class? == @@ -82, +87 @@ The $remove$ tag is used as an aid to view static HTML pages. The Tapestry Engine removes the tag and any text insert within when the page is rendered. This is useful when the text would otherwise be generated dynamically and an HTML designer needs to mock up the pages statically. In the following example, three lines would be displayed when the page is statically viewed while the Tapestry Engine would render the one line dynamically when it is iterated through the Foreach component. + {{{ <table> <tr jwcid=ÂemployeeForeachÂ> <td><span jwcid=ÂemployeeNameÂ>Jane</span></td> @@ -91, +97 @@ </span> </tr> </table> + }}} == Why is my Visit object always null or throws NoClassDefFound? == You might want to check that your Visit class is defined in the application specification. If it is not defined you will run into problems when calling page.getVisit(). Make sure you put a fully qualified class name in the property. MyApp.application: + {{{ <property name="org.apache.tapestry.visit-class" value="some.example.Visit" /> + }}} AppointmentPage.java: + {{{ Public void submit() { // getVisit() will need to be casted to the defined Visit class Some.example.Visit visit = (Some.example.Visit)getPage().getVisit(); } + }}} == How do I make a property in a Component persistent? == --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
