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 09:06:42 -0500

We're defaulting to JSF in order create a unique ID for the span. For
example, if a component ID was not provided, JSF will generate one for
you. Even if we changed the span ID, you might end up with the same
problem elsewhere (i.e., if you don't provide a component id). I'm
curious what happens in that case?

Can you confirm that your fully qualified component IDs are unique? Look
at the id property of the JSON object given to the createWidgetOnLoad
function. For example:

 <script type="text/javascript">webui.suntheme.widget.common.createWidgetOnLoad('j_id16',{
    "id": "form1:Masthead:_userInfoSeparator", <<<<<

We can easily change the id of the span to use some variant of the
component ID, but that won't help if there are conflicts with fully
qualified component IDs.

Dan

Istvan Soos wrote:
> I think I have found the source of the error: the portlets create span
> tags with the same name, and the init javascript code collide. From
> the sources I've sent earlier, both contain the following (and like)
> codes:
>
> <span id="j_id16"><script
> type="text/javascript">webui.suntheme.widget.common.createWidgetOnLoad("j_id16",
> ...
>
> I suppose the initialization code cannot be bound as two (or more)
> span tags will have the same id.
>
>
> This leades to the question: How can we change / influence the id
> generation of the components?
>
> Thanks,
> Istvan
>
> On Mar 19, 2008, at 11:09 AM, Istvan Soos wrote:
>
>> Hi,
>>
>> I'm using NetBeans to create a JSF portlet. At the moment I am able
>> to deploy this portlet into Liferay, and if there is only one
>> woodstock - JSF-portlet on a page, it just works fine. However if I
>> add more (or duplicate the existing), the page components do not show
>> up, so I suppose there is a JavaScript init problem if I'm using more
>> woodstock portlet on one page. Could someone help me to evaluate this
>> and help me to resolve? (One solution could be that somehow I can
>> turn off the JavaScript side of woodstock? :) )
>>
>> I've attached two page sources: one is with only one portlet on a
>> page, the other contains two portlet.
>>
>> Thanks,
>> Istvan
>> <liferay11.txt><liferay22.txt>---------------------------------------------------------------------
>>
>> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
>> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>