tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tapestry-...@jakarta.apache.org
Subject [Jakarta Tapestry Wiki] Updated: MoreFrequentlyAskedQuestions
Date Thu, 18 Nov 2004 22:49:46 GMT
   Date: 2004-11-18T14:49:45
   Editor: JohnStudarus <john@jhlconsulting.com>
   Wiki: Jakarta Tapestry Wiki
   Page: MoreFrequentlyAskedQuestions
   URL: http://wiki.apache.org/jakarta-tapestry/MoreFrequentlyAskedQuestions

   no comment

Change Log:

@@ -24,7 +24,7 @@
 == 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;
@@ -38,12 +38,13 @@
 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");
@@ -51,14 +52,18 @@
   next_page.setEvent(“Birthday Party”);
 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? ==
@@ -80,6 +85,7 @@
 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.
 <tr jwcid=”employeeForeach”>
   <td><span jwcid=”employeeName”>Jane</span></td>
@@ -89,19 +95,24 @@
 == 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.
 <property name="org.apache.tapestry.visit-class" value="some.example.Visit" />
 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: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org

View raw message