myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Kitching (JIRA)" <>
Subject [jira] Commented: (MYFACES-769) configurable IDs used for rendering
Date Tue, 13 Dec 2005 01:10:51 GMT
    [ ] 

Simon Kitching commented on MYFACES-769:

Your first example is why the f:subview should be *outside* the included file, as in my example.
And unfortunately JSF requires that "id" attributes be static text, not dynamic. That's because
a component's id must never change over its lifetime. 

As I know almost nothing at all about portlets, the following is just guesswork (and ignorant
guesswork too :-)

>From your description I gather that each portlet is represented by a separate ViewRoot,
and that the whole page is somehow composed by rendering each viewroot separately and stitching
the results together. In this case, I presume that you can generate some kind of unique id
string for each portlet that you are including in a page (including unique ids when the same
portlet is included twice). So what I would do is ensure that id is included in the ids of
the components by creating a custom UIViewRoot component.

The standard UIViewRoot class doesn't implement the NamingContainer interface, but I expect
that if a custom one did, and its getClientId() method returns a unique "portlet" id then
that portletId would become the prefix for every component in that portlet. The UIViewRoot
is created via method ViewHandler.createView, and a simple config entry in your application's
faces-config.xml file allows a custom ViewHandler to be specified.

I probably can't offer much more help on this as it's getting very portlet-specific now. Good

> configurable IDs used for rendering
> -----------------------------------
>          Key: MYFACES-769
>          URL:
>      Project: MyFaces
>         Type: Improvement
>     Reporter: Dave Brondsema

> If the same code is used ot generated a component tree for more than one part of a webpage,
the rendered IDs are the same and functionality is broken (javascript needs unique IDs).
> An example of when this happens is when as portlet uses JSF for rendering.  If the portlet
is used more than once on a single page (e.g. an RSS reader) all the IDs are the same.
> Thus we need a way to have more configurable (perhaps random) IDs when rendered.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message