You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John S <jo...@yahoo.com> on 2003/10/09 01:27:15 UTC
Re: multiple HTMLs to one Page
Yeah - I've got the Page and Java files written - the question is what does the application (foo.application) file look like?
Bryan Lewis <br...@maine.rr.com> wrote:> I have three function Add/Edit/View that I want to make
> share the various components.... I would rather not create
> three page files. Is there an easy way to do this?
Sure. It only requires a little more java code to keep track
of which mode you're in, and then make the HTML template
do the right thing depending on the mode. Here's the bones of
such a page I did. In this case there was nothing pertinent in
the .page file. I didn't try to separate viewing from editing...
adding was the only extra 'mode'.
EmployeeEditor.java:
public boolean getInserting()
{
// Fill in however you determine whether you're in 'add' mode...
// If we're editing a new object -- oid == 0 -- we're inserting.
return (((Integer) data.get("oid")).intValue() == 0);
}
EmployeeEditor.html:
INSERTING
....
inserting -->
[input]
[input]
You might prefer that the Delete button always appear but be disabled
(grayed out), by adding a binding like: disabled="ognl:inserting" .
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
Re: multiple HTMLs to one Page
Posted by Bryan Lewis <br...@maine.rr.com>.
Oops, I must have misunderstood the question. There's no effect on the
.application file. It isn't necessary to specify the pages in the
.application file at all. My entire (small) app that I took the example
from has this (omitting the ?xml and DOCTYPE header lines):
<application name="jones"
engine-class="org.apache.tapestry.engine.BaseEngine">
</application>
And I'm not even sure all of that is required.
----- Original Message -----
From: "John S" <jo...@yahoo.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, October 08, 2003 7:27 PM
Subject: Re: multiple HTMLs to one Page
> Yeah - I've got the Page and Java files written - the question is
what does the application (foo.application) file look like?
>
> Bryan Lewis <br...@maine.rr.com> wrote:> I have three function
Add/Edit/View that I want to make
> > share the various components.... I would rather not create
> > three page files. Is there an easy way to do this?
>
> Sure. It only requires a little more java code to keep track
> of which mode you're in, and then make the HTML template
> do the right thing depending on the mode. Here's the bones of
> such a page I did. In this case there was nothing pertinent in
> the .page file. I didn't try to separate viewing from editing...
> adding was the only extra 'mode'.
>
> EmployeeEditor.java:
>
> public boolean getInserting()
> {
> // Fill in however you determine whether you're in 'add' mode...
>
> // If we're editing a new object -- oid == 0 -- we're inserting.
> return (((Integer) data.get("oid")).intValue() == 0);
> }
>
>
> EmployeeEditor.html:
>
>
>
>
>
> INSERTING
>
>
>
> ....
> inserting -->
> [input]
>
> [input]
>
>
> You might prefer that the Delete button always appear but be disabled
> (grayed out), by adding a binding like: disabled="ognl:inserting" .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org