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 NickWestgate:
http://wiki.apache.org/tapestry/MoreFrequentlyAskedQuestions

------------------------------------------------------------------------------
  == Where is the (some random HTML) component? (e.g., TD) ==
- Any component that does not have a direct Tapestry component can be 
represented with the Tapestry ANY component.  For example, say you want to have 
Tapestry generate the background color for your table using a TD component you 
could use <td [EMAIL PROTECTED] bgcolor=”ognl:backgroundColor”></td>.
+ Any component that does not have a direct Tapestry component can be 
represented with the Tapestry ANY component.  For example, say you want to have 
Tapestry generate the background color for your table using a TD component you 
could use <td jwcid="@Any" bgcolor="ognl:backgroundColor"></td>.
  
- == Why isn’t Initialize setting my variables when the page is created? ==
+ == Why isn't Initialize setting my variables when the page is created? ==
  
- Don’t worry; you aren’t the first person to make this mistake.  Initialize 
isn’t called when a page is created – it is called when a page is returned to 
the pool to be reused.  Initialize is not to be used to setup a page but 
instead return it to a pristine state so it can be recycled in the pool of 
available pages.  See the pageRenderListener interface if you want to setup 
state before a page is used.
+ Don't worry; you aren't the first person to make this mistake.  Initialize 
isn't called when a page is created - it is called when a page is returned to 
the pool to be reused.  Initialize is not to be used to setup a page but 
instead return it to a pristine state so it can be recycled in the pool of 
available pages.  See the pageRenderListener interface if you want to setup 
state before a page is used.
  
- == Where do I “initialize” values for a page? ==
+ KentTong: I don't think this is true anymore (not sure if it was true in the 
past). Initialize is indeed called when a page is created. It is also called 
when it is returned to the pool. So it can be used to setup a page to some 
fixed initial state. Of course, you could do that using a 
<property-specification> too.
  
+ == Where do I "initialize" values for a page? ==
+ 
- You’ll probably want to use the pageRenderListener class to perform any work 
you need when the page is accessed.  Alternatively you can do some lazy 
initialization where objects are created the first time they are used.  This 
isn’t as clean as using Tapestry properties but it should work.  For example:
+ You'll probably want to use the pageRenderListener class to perform any work 
you need when the page is accessed.  Alternatively you can do some lazy 
initialization where objects are created the first time they are used.  This 
isn't as clean as using Tapestry properties but it should work.  For example:
  
  AppointmentPage:
  
@@ -25, +27 @@

  
  == 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.
+ 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 {
  
@@ -51, +53 @@

    // The next page we want to go to is the Result page
    AppointmentPage next_page = (AppointmentPage)cycle.getPage("Appointment");
    next_page.setDate(new Date());
-   next_page.setEvent(“Birthday Party”);
+   next_page.setEvent("Birthday Party");
    cycle.activate(next_page);
  }
  }}}
@@ -63, +65 @@

  }}}
  Appointment Page Java:
  {{{
+ /*
+ **  Generated derived class implements these routines and connects them to 
the properties.
+ **  You only need to create these abstract routines if you are referencing 
them within the
+ **  abstract class.
+ */
- public void setDate(Date date);
+ public abstract void setDate(Date date); 
- public void setEvent(String event); 
+ public abstract void setEvent(String event); 
+ public abstract Date getDate(); 
+ public abstract String getEvent(); 
  }}}
  
- == I just created a new page and now I get a 'class instantiation problem'.  
Why can’t it instantiate my class? ==
+ HowardLewisShip:  I call this the ''Tapestry Bucket Brigade''.
  
+ == I just created a new page and now I get a 'class instantiation problem'.  
Why can't it instantiate my class? ==
+ 
- Most likely you created your class abstract when it didn’t need to be.  
Tapestry doesn’t create an enhanced subclass if there are no 
<property-specification> elements.  A concrete class is never created by 
Tapestry in this case and since abstract classes cannot be instantiated, this 
exception pops up.  You either need to create a <property-specification> 
element or make your class concrete by removing the abstract identifier.
+ Most likely you created your class abstract when it didn't need to be.  
Tapestry doesn't create an enhanced subclass if there are no 
<property-specification> elements.  A concrete class is never created by 
Tapestry in this case and since abstract classes cannot be instantiated, this 
exception pops up.  You either need to create a <property-specification> 
element or make your class concrete by removing the abstract identifier.
+ 
+ HowardLewisShip: This is a bug fixed in Tapestry 3.0.1.  In 3.0.1, if you 
class is abstract but there is not need for enhancement, Tapestry will quitely 
enhance your class anyway, just so it isn't abstract.
  
  == How can I share data across two Tapestry applications? ==
  
- Even if you’re running two Tapestry applications within the same Application 
Server (i.e. Tomcat) you can’t share data between them within the Application 
Server.  You can merge the two applications together into one application and 
then share data through singleton objects within the Application Server.  
Alternatively the two applications can share data at a lower level common 
level, i.e. the operating system (message passing) or a database.
+ Even if you're running two Tapestry applications within the same Application 
Server (i.e. Tomcat) you can't share data between them within the Application 
Server.  You can merge the two applications together into one application and 
then share data through singleton objects within the Application Server.  
Alternatively the two applications can share data at a lower level common 
level, i.e. the operating system (message passing) or a database.
+ 
+ HowardLewisShip: It is possible to have two different applications within the 
same WAR, never mind, EAR, in which case, singletons can be stored in the 
ServletContext. If you ''carefully'' check the specification and template file 
resolution rules (in the Users Guide), you can see how to keep the pieces 
seperate from each other.  However, this is not widely used and there's a 
possibility it won't make it into Tapestry 3.1.
  
  == What is Spindle? ==
  
- Spindle is a plugin for the Eclipse IDE.  Eclipse is available at 
www.eclipse.org and Spindle is available at spindle.sourceforge.net.  The 
Spindle adds intelligence about Tapestry into Eclipse.  The end result is an 
IDE that is aware of Tapestry Components and Pages by providing Wizard 
interfaces and navigation widgets for the creation and viewing of Tapestry 
Components and Pages.  It is well worth a look if you intend on developing with 
Tapestry.  Download Eclipse first and then install Spindle through the auto 
update feature of Eclipse.
+ Spindle is a Tapestry 3 plugin for the Eclipse IDE.  Eclipse is available at 
www.eclipse.org and Spindle is available at spindle.sourceforge.net.  The 
Spindle adds intelligence about Tapestry into Eclipse.  The result is an IDE 
that is aware of Tapestry Components and Pages by providing Wizard interfaces 
and navigation widgets for the creation and viewing of Tapestry Components and 
Pages.  It is well worth a look if you intend on developing with Tapestry.  
Download Eclipse first and then install Spindle through the auto update feature 
of Eclipse.
  
  == What are the jwcid=$content$ tags that Spindle places into my HTML files? 
==
  
- Tapestry does not process any text outside of a <span 
jwcid=”$content$”></span>.  This allows a developer to place documentation, 
header files or static HTML (that should not be rendered by the Tapestry 
engine).  Spindle places these tags into the HTML out of convenience.  The can 
be deleted without any problems.
+ Tapestry does not process any text outside of a <span 
jwcid="$content$"></span>.  This allows a developer to place documentation, 
header files or static HTML (that should not be rendered by the Tapestry 
engine).  Spindle places these tags into the HTML out of convenience.  The can 
be deleted without any problems.
  
  == When would I use the $remove$ tag? ==
  
@@ -89, +104 @@

  
  {{{
  <table>
- <tr jwcid=”employeeForeach”>
+ <tr jwcid="employeeForeach">
-   <td><span jwcid=”employeeName”>Jane</span></td>
+   <td><span jwcid="employeeName">Jane</span></td>
-   <span jwcid=”$remove$”>
+   <span jwcid="$remove$">
    <td>Sally</td>
    <td>Sue</td>
    </span>
@@ -112, +127 @@

  {{{
  Public void submit() {
        // getVisit() will need to be casted to the defined Visit class
-       Some.example.Visit visit = (Some.example.Visit)getPage().getVisit();
+       some.example.Visit visit = (some.example.Visit)getPage().getVisit();
  }
  }}}
  
@@ -120, +135 @@

  
  Pages support persistent properties so place the persistent property in the 
encompassing Page and pass it into the Component.  The property will remain 
persistent and be passed into the Component as a parameter.  The Component will 
need not know, or care, that the property is persistent.
  
+ HowardLewisShip: The above is technically correct, but 
<property-specification> inside a component can still use the persist="yes" 
attribute and be persistent!  The mechanism is exactly the same for pages as it 
is for components, just the HttpSession attribute key is a bit longer (it 
incorporates the page name, the component id path and the property name).
+ 
  
  == Where can I find a Tapestry tutorial? ==
  
- TODO
+  * [http://dorffweb.com/index.htm?page=taptutorial Kevin Dorf Tapestry 3.0 
beta 3 Tutorial]
+  * [http://www.sandcastsoftware.com/articlesandtutorials/brownbag/index.html 
Simple CRUD Model Tutorial]
+  * [http://www2.cpttm.org.mo/cyberlab/softdev/tapestry Kent Tong's Tutorial]
+  * [http://tapestry-tutorial.cloudnine.net.nz/Tutorial2.html Cloud Nine 
Tutorial]
+  * [http://www.t-deli.com/ T-Deli components]
+ 
+ 
+ 
+ 
+ 
  
  == Where can I host my Tapestry application? ==
  
  You've got several choices ranging from a hosted third party Java Servlet 
container to a dedicated (or even virtual) server.  Some companies recommend 
through the Tapestry mailing list include:
  
- www.kgbinternet.com
+  * www.kgbinternet.com
- www.kattare.com
+  * www.kattare.com
- hosting.groovesystems.com
+  * hosting.groovesystems.com
- www.mmaweb.net/index-google.html
+  * www.mmaweb.net/index-google.html
- www.eapps.com/ManagedHosting/JBoss.jsp
+  * www.eapps.com/ManagedHosting/JBoss.jsp
- oxxus.net
+  * oxxus.net
- www.johncompanies.com
+  * www.johncompanies.com
- 1and1.com 
+  * 1and1.com 
  
  == How can I implement skins in Tapestry? ==
  
- You'll want to take a look at CSS <A 
HREF="http://www.w3.org/Style/CSS/";>(Cascading Style Sheets)</A>.  Tapestry can 
be programmed to pull in the appropriate CSS as needed.  For an example of the 
capabilities of a CSS please look <A 
HREF="http://www.csszengarden.com/";>here</A>.
+ You'll want to take a look at CSS [http://www.w3.org/Style/CSS/ (Cascading 
Style Sheets)].  Tapestry can be programmed to pull in the appropriate CSS as 
needed.  For an example of the capabilities of a CSS please look the 
[http://www.csszengarden.com/ CSS Zen Garden].
  

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

Reply via email to