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: Thu, 20 Mar 2008 18:41:01 -0500

Istvan Soos wrote:
>>>>>
>>> I've tried your suggestion and other ideas too, however it is still
>>> not perfect. This modification is definitely one step further and
>>> required, as if I use this, I see one JSF portlet working (the last
>>> one on the page). The ids seem to be ok, but the other portlets just
>>> do not show anything. That leaves one last option: there is some
>>> initialization code that creates some inconsistency. I am not a
>>> JavaScript guy, so I am unable to tell where could be this one
>>> wrong... Any idea I can look into?
>>
>> Are there any JavaScript errors in the page?
>>
>> Does each Portlet have its own head tag? (Typically, CSS and
>> JavaScript are typically added to the page via the head tag.) If so,
>> your portlets could be overriding previously initialized JavaScript.
>> Or, it may be that the browser cannot handle more than one HTML head
>> tag and simply displays the last tag in the page. I can ensure these
>> resources are not re-initialized, but perhaps you can ensure your
>> portlets are not outputting multiple head tags?
>
> Firefox Error Console does not indicate any error. The head tags are
> right (= no extra head tags), an example HTML source part from the
> previously attached files:
>
> <div class="portlet-content">
> <div class="portlet-content-container" style="">
> <div>
> <div style="-rave-layout: grid; position: relative; height: 400px;
> width: 400px;">
> <link rel="stylesheet" type="text/css"
> href="/IPCSampleJSFPortlet/theme/com/sun/webui/jsf/suntheme4_1_1/css/css_master-all.css"
> />
> <script type="text/javascript">var
> djConfig={"isDebug":false,"parseOnLoad":false}</script>
> <script type="text/javascript"
> src="/IPCSampleJSFPortlet/theme/META-INF/json2_0/json.js"></script>
> <script type="text/javascript"
> src="/IPCSampleJSFPortlet/theme/META-INF/prototype1_5/prototype.js"></script>
>
> <script type="text/javascript"
> src="/IPCSampleJSFPortlet/theme/META-INF/com_sun_faces_ajax.js"></script>
> <script type="text/javascript"
> src="/IPCSampleJSFPortlet/theme/META-INF/dojo1_0_1/dojo/dojo.js"></script>
>
> <script type="text/javascript"
> src="/IPCSampleJSFPortlet/theme/META-INF/dojo1_0_1/dijit/dijit.js"></script>
>
> <script
> type="text/javascript">dojo.registerModulePath("webui.suntheme",
> "/IPCSampleJSFPortlet/theme/com/sun/webui/jsf/suntheme4_1_1/javascript");</script>
>
> <script type="text/javascript"
> src="/IPCSampleJSFPortlet/theme/com/sun/webui/jsf/suntheme4_1_1/javascript/webui-jsfx.js"></script>
>
> <script
> type="text/javascript">webui.suntheme.bootstrap.init({"theme":{"module":"webui.suntheme.theme","locale":"en-US","prefix":"/IPCSampleJSFPortlet/theme","bundle":"suntheme","modulePath":"/com/sun/webui/jsf/suntheme4_1_1/javascript/theme"},"debug":false});</script>
>
> <form
> id="_IPCSampleJSFPortlet_WAR_IPCSampleJSFPortlet_INSTANCE_gW22_:form1"
> class="form" method="post" action="...." ...>
>
> And yes, I'd agree that the overriding of a previously initialized
> JavaScript is the typical situation here. Could you please help me in
> this? I can debug / check all the Java codes but you can kill me with
> JavaScript :)

Well, the only reason JavaScript would be overridden is if the code
above were included more than once. And that no longer appears to be the
case here. Unfortunately, all my work is being done in the 4.2 release,
so I'm not sure what else we can try? Other than to have you provide
step by step instructions to recreate your example app or forward your
Netbeans project.

Would you mind sending the previously attached files, again? (I can't
seem to retrieve the attachments from the e-mail archive.) I have an
idea of what the IDs look like from the form tag above, but I want to
see what IDs are being provided to the widget JavaScript. If you have
updated your Woodstock build with my suggested fix, I'd like to see the
HTML page source for that, too.

Thanks,
Dan