users@woodstock.java.net

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

From: Istvan Soos <syntern_at_sch.bme.hu>
Date: Wed, 19 Mar 2008 16:14:57 +0100

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...

Regards,
    Istvan

On Mar 19, 2008, at 3:06 PM, Dan Labrecque wrote:

> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>