You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ls...@hsr.ch on 2007/12/06 11:26:09 UTC

DOM element IDs in portlets not consistent

Hi there

I experienced that the DOM element IDs are not consistent in combination with portlets.

The same element has sometimes an ID like formId:elementId, another time like view:formId:elementId.

Do you know the reason for this? I'm having this issue when navigating forward to another page (within the portlet) and backward to the same page.

Thanks in advance!

Regards,
-Lorin

Re: DOM element IDs in portlets not consistent

Posted by Scott O'Bryan <da...@gmail.com>.
Yes.  Namespacing is an issue that different bridges and renderkits 
handle differently.  In Trinidad or the Default Renderkit, the 301 
bridge tries to namespace elements automatically using the Portlet's 
namespace such that the "clientId" is namespace:formId:elementId.  This 
shouldn't change for a portlet instance by may well change between 
different runs of the same portlet. 

Retrieving the "clientId" of the element you are trying to access from 
the portlet which writes it out to the screen is the only way to ensure 
you have the correct clientId.

Scott

lschoop@hsr.ch wrote:
> Hi there
>
> I experienced that the DOM element IDs are not consistent in combination with portlets.
>
> The same element has sometimes an ID like formId:elementId, another time like view:formId:elementId.
>
> Do you know the reason for this? I'm having this issue when navigating forward to another page (within the portlet) and backward to the same page.
>
> Thanks in advance!
>
> Regards,
> -Lorin
>
>