You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2006/05/03 15:51:24 UTC

identical pages with only different beans?

I have a design/architecture question:

 

My page contains 2 nearly identical tabs.

Both contain complex components like datatables with scrollers, multiple
trees, iframes and a lot of buttons.

The first tab contains the result of a search with master/detail view (a
datatable and a detail data pane).

The second tab has the same layout and contains all objects that are
related to the selected object on the first tab.

In other words this is the result of a finer search based on a selection
on the first tab.

The corresponding jsps are nearly identical therefore. The only visible
difference is that some components are not rendered according to a flag.

So they differ internally only in the used backing bean instances and
bindings.

 

How could I implement this most suitable?

Is there an alternative to copy the jsp and replace the names of the
backing beans?

 

Moreover I don't want to limit the application to client side state
saving.

So server side state saving should be supported due to complex searches
in the backend.

 

I thought a quick (developed) solution could be to open a new browser
window with a new http session for the same user.

But this is not possible based on a link without invalidating the first
session, or is it?

 

 

Any help or ideas are appreciated.

Michael


Re: identical pages with only different beans?

Posted by Mike Kienenberger <mk...@gmail.com>.
Take a look at this url, particularly option 2 and option 3.

http://wiki.apache.org/myfaces/Creating_Composite_Components

On 5/3/06, Michael Heinen <mh...@recommind.com> wrote:
>
>
>
> I have a design/architecture question:
>
>
>
> My page contains 2 nearly identical tabs.
>
> Both contain complex components like datatables with scrollers, multiple
> trees, iframes and a lot of buttons.
>
> The first tab contains the result of a search with master/detail view (a
> datatable and a detail data pane).
>
> The second tab has the same layout and contains all objects that are related
> to the selected object on the first tab.
>
> In other words this is the result of a finer search based on a selection on
> the first tab.
>
> The corresponding jsps are nearly identical therefore. The only visible
> difference is that some components are not rendered according to a flag.
>
> So they differ internally only in the used backing bean instances and
> bindings.
>
>
>
> How could I implement this most suitable?
>
> Is there an alternative to copy the jsp and replace the names of the backing
> beans?
>
>
>
> Moreover I don't want to limit the application to client side state saving.
>
> So server side state saving should be supported due to complex searches in
> the backend.
>
>
>
> I thought a quick (developed) solution could be to open a new browser window
> with a new http session for the same user.
>
> But this is not possible based on a link without invalidating the first
> session, or is it?
>
>
>
>
>
> Any help or ideas are appreciated.
>
> Michael

Re: identical pages with only different beans?

Posted by Hubert Rabago <hr...@gmail.com>.
Sounds like a job for <t:aliasBean> [1].  Wrap your snippet with an
alias bean and you can change the backing bean being referenced in the
snippet.

Hubert

[1] http://myfaces.apache.org/tomahawk/aliasBean.html

If it's a large snippet, should it still be called a snippet? :)

On 5/3/06, Michael Heinen <mh...@recommind.com> wrote:
>
>
>
> I have a design/architecture question:
>
>
>
> My page contains 2 nearly identical tabs.
>
> Both contain complex components like datatables with scrollers, multiple
> trees, iframes and a lot of buttons.
>
> The first tab contains the result of a search with master/detail view (a
> datatable and a detail data pane).
>
> The second tab has the same layout and contains all objects that are related
> to the selected object on the first tab.
>
> In other words this is the result of a finer search based on a selection on
> the first tab.
>
> The corresponding jsps are nearly identical therefore. The only visible
> difference is that some components are not rendered according to a flag.
>
> So they differ internally only in the used backing bean instances and
> bindings.
>
>
>
> How could I implement this most suitable?
>
> Is there an alternative to copy the jsp and replace the names of the backing
> beans?
>
>
>
> Moreover I don't want to limit the application to client side state saving.
>
> So server side state saving should be supported due to complex searches in
> the backend.
>
>
>
> I thought a quick (developed) solution could be to open a new browser window
> with a new http session for the same user.
>
> But this is not possible based on a link without invalidating the first
> session, or is it?
>
>
>
>
>
> Any help or ideas are appreciated.
>
> Michael

Re: identical pages with only different beans?

Posted by Andrew Robinson <an...@gmail.com>.
If you use facelets, you can just create a template for the page and
pass it different beans for each instance that you need. You can pass
other values as well that can be used for setting the rendered
attribute of your controls.

-Andrew

On 5/3/06, Michael Heinen <mh...@recommind.com> wrote:
>
>
>
> I have a design/architecture question:
>
>
>
> My page contains 2 nearly identical tabs.
>
> Both contain complex components like datatables with scrollers, multiple
> trees, iframes and a lot of buttons.
>
> The first tab contains the result of a search with master/detail view (a
> datatable and a detail data pane).
>
> The second tab has the same layout and contains all objects that are related
> to the selected object on the first tab.
>
> In other words this is the result of a finer search based on a selection on
> the first tab.
>
> The corresponding jsps are nearly identical therefore. The only visible
> difference is that some components are not rendered according to a flag.
>
> So they differ internally only in the used backing bean instances and
> bindings.
>
>
>
> How could I implement this most suitable?
>
> Is there an alternative to copy the jsp and replace the names of the backing
> beans?
>
>
>
> Moreover I don't want to limit the application to client side state saving.
>
> So server side state saving should be supported due to complex searches in
> the backend.
>
>
>
> I thought a quick (developed) solution could be to open a new browser window
> with a new http session for the same user.
>
> But this is not possible based on a link without invalidating the first
> session, or is it?
>
>
>
>
>
> Any help or ideas are appreciated.
>
> Michael