Please read the Tapestry tutorial ... especially the section on
persistent field data.
On Fri, Nov 7, 2008 at 11:38 AM, Keith Bottner <[EMAIL PROTECTED]> wrote:
> Design Problem: To have a single page that can be passed various
> notifications instead of having tens if not hundreds of separate
> notification pages that just display successful completion, errors, etc.
>
> Our Solution: Was to use a @InjectPage in those pages and use setters on the
> page to set the title and the message to be displayed and return the
> @InjectPage from the onSuccess method.
>
> Behavior Seen: The values are set on the @InjectPage properly and the page
> is displayed but the values are not displayed.
>
> And of course if someone knows of a more excepted pattern for handling this
> type of problem then please feel free to share it.
>
> Thanks in advance for any help, I am sure it is something small but I have
> been looking at it so long I just can't find the problem.
>
> Keith
>
>
>
> Please see code below:
>
> Page wanting to display Notification page:
>
> class Test
> {
> @InjectPage
> private Notification notificationPage;
> ...
> Object onSuccess()
> {
> ...
> notificationPage.setTitle("Enter your title here");
> notificationPage.setNotification("Here is the notification message");
> ...
> return notificationPage;
> }
> ...
> }
>
> Here is the Notification class.
> public class Notification
> {
>
> @Property
> private String title;
>
> @Property
> private String notification;
>
> public String getTitle()
> {
> return title;
> }
>
> public void setTitle( String title )
> {
> this.title = title;
> }
>
> public String getNotification()
> {
> return notification;
> }
>
> public void setNotification( String notification )
> {
> this.notification = notification;
> }
> }
>
> And finally the notification template:
>
> <html t:type="vf/MainLayout" t:title="${title}" t:showMainMenu="true"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>
> <t:vf.wideBarlayout t:id="contentLayout" t:showBackground="false">
> <t:parameter name="innerBody">
> <p>
> ${notification}
> </p>
> </t:parameter>
> </t:vf.wideBarlayout>
>
> </html>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]