users@woodstock.java.net

Re: change in span id generation [was Re: multiple JSF portlet error: javascript init problem?]

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Wed, 19 Mar 2008 16:01:09 -0500

Istvan Soos wrote:
>
> On Mar 19, 2008, at 4:48 PM, Dan Labrecque wrote:
>
>> Istvan Soos wrote:
>>> Hi Dan,
>>>
>>> I've checked it: If there is only one portlet, the id of e.g. input
>>> text field is unique (even contains the portlet id, as expected).
>>> The first immediate parent (span) of the input element has good id
>>> too, however the second span element uses only a simple j_id16 like
>>> id, that causes the problem. (This span is direct child of the form
>>> element).
>>> If there are two portlets, as I cannot see input elements, I cannot
>>> inspect their IDs, only the form's hidden input field is accessible.
>>> That id looks fine however, as it contains separate id for the
>>> separate portlets.
>>>
>>> I think there will be a definite need to change either this id or
>>> the JavaScripts that initialize themselves using this id, as it just
>>> brakes the JSF-portlet concept if we cannot add more than one
>>> JSF-portlet on one single page. The question is the where and how...
>>
>> If you want to file a bug, I'll try to get this change in for the
>> next 4.2 milestone. This build will be integrated into NetBeans 6.1
>> RC1 (Mar 27).
>
> Hi Dan,
>
> Thanks for this, I really appreciate it. I'll file a bug (and if I
> have the time a patch) later today (when I arrive home)... I suppose
> this stuff is handled inside the following file:
> ./webui/src/runtime/com/sun/webui/jsf/renderkit/widget/RendererBase.java

Correct. If you're building Woodstock yourself, here is the fix I have
applied in my own workspace.

Line 100: String id = context.getViewRoot().createUniqueId();
Becomes: String id = "_" + component.getClientId(context);

Dan


>
> Regards,
> Istvan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>