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: Sat, 29 Mar 2008 00:03:29 +0100

> I don't have a workaround, yet. Still not sure what is happening in
> your environment?

I think I have some idea, your alert based check gave me the solution.
You were right, the bootstrap.js shall be right (although it was not
suntheme4_2 but 4_3 as I was using the latest build).

At the moment, the
<webuijsf:themeLinks binding="#{PortletPage1.themeLinks1}"
id="themeLinks1"/>

produces something like this:
<script ... >var webui_suntheme4_3={ ... };</script>
<script src="/.../bootstrap.js">

Now if I commented out the themeLinks tag and replaced it with the
following JavaScript, it was fine:

<script type="text/javascript">
   if (typeof webui == "undefined") {
     var webui_suntheme4_3={"webuiJsfx":false,"webuiAll":false,"theme":
{"locale":"en-us"},"ajax":
{"isJsfx":true},"isDebug":false,"isStyleSheet":true,"parseOnLoad":true};
     document.write('<script type="text/javascript" src="/JSTestJSF1/
theme/com/sun/webui/jsf/suntheme4_3-080326/javascript/bootstrap.js"></
script>');
}
</script>

Basically I have reduced the webui_suntheme4_3 reference creation and
the JS include to be one-time only by checking the webui variable. It
is fine for multiple portlet!

Is it possible for you to rewrite the generated JavaScript code for
the themeLinks tag to produce something similar like this one? I'd
really appreciate, but next week I will have some time to provide a
proper patch too... It might be reasonable to check the
web_suntheme4_3 (with versions) and not the webui just in case we are
mixing multiple theme versions...

Thanks and regards,
    Istvan