It's hard to know exactly what you're trying to do without seeing any
code (I'm also not exactly sure what's not working), so I must admit
I'm not sure what your problem is, but here's how I typically use page
injection.

Page1 has some form or link that, when submitted (clicked) should take
the user to Page2.  I therefore inject Page2 into Page1.

In the listener method, I get the reference to Page2, set the
appropriate attributes on it from the form if necessary, then return
the instance of Page2 from my listener.

Tapestry makes Page2 the active page, and rendering happens there.  If
Page2 has a border, it will get rendered.  If it doesn't, it won't. 
Same for anything else on the page.  Page1 is now 'gone' and will no
longer affect Page2.

-Mike

On 4/17/06, Mário Lopes <[EMAIL PROTECTED]> wrote:
> On 4/17/06, Mike Snare <[EMAIL PROTECTED]> wrote:
> > Inject page doesn't inject the page into the page you are looking at
> > from a view standpoint, rather it makes an instance of that page a
> > member of the page.
> >
> > In the form submission of page 1, get the instance of page 2 via the
> > accessor and set the appropriate attributes.
> >
> > The layout of page 2 (including borders/other components) is page 2's
> > responsibility.  If you have a border on page 1 but not on page 2,
> > injecting page 2 into page 1 won't change that.  Page 2 needs it's own
> > border.
>
> But that's I find quite odd, since Page2 has precisely the same .html
> and .page as the form but has zero html besides the one belonging to
> the form!
>
> Maybe I'm not linking Page2 java to the .html and .page? Where should
> I link them?
>
> Regards,
>
> -- Mário
>
> >
> > I might be reading your email wrong, but if I'm not, you need to set
> > up page 2 to work and display independently of page 1.  If all it
> > needs is the form data from page 1, that's all that should be needed
> > for page 2 to be considered 'whole'.
> >
> > -Mike
> >
> > On 4/17/06, Mário Lopes <[EMAIL PROTECTED]> wrote:
> > > Hello everyone!
> > >
> > > First off, I'm new to Tapestry so cheers everyone! :-)
> > >
> > > Well, I'm building an application and I need to share information
> > > accross different pages. For instance, page1 has a form which gets
> > > several values and fetches others from the database, while page2
> > > should be receiving those values and others, redirecting from page1.
> > >
> > > It seems there's two ways of doing this: Application State Objects,
> > > like Visit or Global, and the new @InjectPage from Tapestry 4.
> > >
> > > InjectPage worked but it only shows the attributes belonging to the
> > > class that's associated with, ignoring Border and other stuff like
> > > hivemind SiteMap component. Now, am I not properly using InjectPage,
> > > since it should only be used as a scaffold for viewing forms (?) or am
> > > I missing something ?
> > >
> > > Some insight on the subject would be great!
> > >
> > > Thanks in advance.
> > >
> > > Kind regards,
> > >
> > > Mário Lopes
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to