JavaScript "unloaded" when switching panelGroup inside a PanelStack
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
JavaScript "unloaded" when switching panelGroup inside a PanelStack  XML
Forum Index -> Components Go to Page: 1, 2 Next 
Author Message
jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Hi ICESoft people

We just discovered a strange problem, when user switching panelGroup inside a panelStack, all per-loaded JavaScripts (i.e Javascript loaded inside html <head> tag ) will be "unloaded", user needs to refresh the page to "reactivate" the JavaScript.

Attached jar file show such error, upon unjar the attach file, please copy all require CE 1.0.1 jar files in the lib directory, and build the war file..

Here are the steps to reproduce the error:
1. load the application : http://localhost:8080/JSFConfiguration

2. The first welcome page show a nice flash object control by a JavaScrcipt. The welcome page is attached to the "Tallyman 3.5" navigation root item

3. Click on any navigation item e.g "Tallyman configuration Demo", and click back "Tallyman 3.5", the flash object gone.

4. Upon refresh the page, it will reappear again.

5. The same apply to other per-loaded JavaScripts. i.e User needs to refresh the page to reactivate the JavaScripts.

This has make our application looks weired, as we have integrated numbers of third party JavaScripts (such as tooltips from http://www.dustindiaz.com/sweet-titles) to make our application looks cool..

Any idea how to resolve this, we don't mind a temporary work around to resolve this issue.

Cheers
James Khoo
 Filename JSFConfig.jar [Disk] Download
 Description No description given
 Filesize 431 Kbytes
 Downloaded:  9 time(s)

jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Hi,

Any suggestions, we needs to do a quick demo to our management very soon..and we needs to resolve this ASAP.

Cheers
James Khoo
jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Hi all

Same behaviour as above, when user attempt to expand or collapse a treeNode, all JavaScripts will be unloaded..the only way to reactivate the script is to do a screen refresh!

Any suggestions?

Cheers
James Khoo
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


Hi James,

Do you mean the FlashObject js object is no longer defined after some asynchronous action, so you get a js error when you reference it again, ie. var myFlashObject = new FlashObject(...? If that's so, I'm not sure why it's happening. Do you see the same behaviour in different browsers? Just a shot in the dark, but you might try putting the script tag between the </head> and <body> tags. This is non-standard, but some people have reported it works.

Thanks,
Philip

.
jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Hi Philip

Thanks for quick response, if we do go for support (most likely we will), you will be my prefer first contact person :-).

Anywhere, what u explain is correct, upon some async action, all preloaded JavaScript will be unloaded.. this include some cool JavaScript I downloaded from Yahoo (YUI), and Open Rico..user needs to refresh the page to "reactivate" the JavaScript.
So far we discover the error will occur if
a. User clicking on a page, which is bundle as a panelGroup inside a PanelStack..
b. User try to expand/collapse tree

And we tested in both Firefox and IE, all produce the same error.

I also do a quick test by putting JavaScript between </head> and <body> tags..same result.


U could easily reproduce the error with the attach jar.

Do let me know your finding ASAP. Thanks

Cheers
James Khoo
adnan.durrani


Joined: 19/01/2006 00:00:00
Messages: 437
Offline


For the time being I would use the object and embed tag. Please get the attached page.

Thanks,
-- Adnan Durrani --
 Filename splashApplication.jsp [Disk] Download
 Description No description given
 Filesize 2 Kbytes
 Downloaded:  120 time(s)


-- Adnan Durrani --
[Email]
jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Roy, Philip, and Adnan

Just like to say thanks! If I am over US, will buy you guys a round or Beer!

Cheers
James Khoo
rmayhew


Joined: 11/04/2006 00:00:00
Messages: 100
Offline


Here is a fix for the tooltip.

The sweetTitles library needs to be re-initialized after the new panel has been rendered. There is a special call in icefaces that lets you do this.

In the NavigationBean I added

JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(), "sweetTitles.init();");

This will force sweetTitles to reinitialize on each tree navigation event.
 Filename JSFConfig_tooltip_fix.zip [Disk] Download
 Description No description given
 Filesize 433 Kbytes
 Downloaded:  130 time(s)


Rob Mayhew
http://snappy.sensemaker.net

[Email]
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


Hi James,

I don't think it's a case of the JavaScript being unloaded. I think it's more a matter of the js not being compatible with ICEfaces and the way you've implemented your app with a PanelSeries component. Looking at the SweetTitles.js code, it looks like the tooltips are set up on page load by iterating over the current document. But in your app, as you're using a PanelSeries, the DOM of the NewUser panel isn't loaded until you've clicked on the tree node that brings it into view.

I tried out another Tooltip library, "DOM Tooltip", http://www.mojavelinux.com/projects/domtooltip/, and it works pretty well with ICEfaces as it uses dynamic events, rather than setting DOM attributes on page load. I've included the library and integrated it with your app here. I've also included Adnan's fix for the error with flash object in SplashApplication.jsp (thanks Adnan!).

Thanks,
Philip
 Filename forum-1827.zip [Disk] Download
 Description No description given
 Filesize 531 Kbytes
 Downloaded:  103 time(s)


.
adnan.durrani


Joined: 19/01/2006 00:00:00
Messages: 437
Offline


Hi James,

Its a cool tooltip :). Yes I can reproduce that java script problem and currently we are looking into it. We will notify you as soon as we have a fix for it.

Thanks,
-- Adnan Durrani --

-- Adnan Durrani --
[Email]
jameskhoo

Joined: 30/06/2006 00:00:00
Messages: 39
Offline


Hi Adnan
Hi Adnan

Thanks for ur answer..while your propose solution solve the flash object problem, it's still not solve the JavaScript unload problem. I have modified the original attached file for u to reproduce the error.

Please copy all C.E 1.0.1 lib into lib directory, build and deploy the war file. Here are the steps to reproduce the error:

1. Go to Team&User, new User Screen

2. Move your mouse to user Name inputText field. You should see a default browser tooltips asking user to enter their user name (Which is ugly)

3. do a page refresh, and move the mouse back to inputText field, you sould see a nicer tooltip will color and tranperant effet.

FYI, we are using SweetTitles.js, and the js already perloaded at welcome.jspx..


Do share me your findings, cheers
James Khoo
 Filename JSFConfig.jar [Disk] Download
 Description No description given
 Filesize 432 Kbytes
 Downloaded:  92 time(s)

robmat


Joined: 06/03/2007 00:00:00
Messages: 8
Offline


If anybody is interested I'm getting the same problem but with no js from my side, but ICEFaces js is unloaded and I'm getting nulls or not set properties. I't an issue in IE7 only.

God damned programmers...
NarfSort

Joined: 10/04/2007 00:00:00
Messages: 11
Offline


getting a same problem... with js is unloading

i have a Tree ...
- you selected a node

- this node returns a ID for the panelstack

- in the panelstack are groups like this:

Code:
 <!-- Profil panel : Password ändern -->
 	<ice:panelGroup id="pwdchange">
 		<jsp:directive.include file="inc/pwdChange.jspx"/> 
 	</ice:panelGroup>
 


this runs perfekt and without problem but...
if i include a file that has a <ice:form> tag in it i cant change to another panelgroup that includes a file with <ice:form> tag too in the panelstack...

for example:

Code:
 <!-- Profil panel : Password ändern WITHOUT <ice:form> in it-->
 	<ice:panelGroup id="pwdchange">
 		<jsp:directive.include file="inc/pwdChange.jspx"/> 
 	</ice:panelGroup>
 
 <!-- Profil panel : Leistungsarten WITH <ice:form> in it -->
 	<ice:panelGroup id="profLeistart">
 		<jsp:directive.include file="inc/profilLeistungsarten.jspx"/> 
 	</ice:panelGroup>
 		                
 <!-- Profil panel : Kostenstelle WITH <ice:form> in it -->
 	 <ice:panelGroup id="profkosten">
 		<jsp:directive.include file="inc/profilKostenstelle.jspx"/>
 	 </ice:panelGroup>
 



if i select the "pwdchange" group all is working... if i change from this group to "profkosten" all works... but now if i change from "profkosten" to "profLeistart" no js is working... i cant expend or colaps the tree or make anything else...

if i select "pwdchange" and change to "profkosten" change back to "pwdchange" and change to "profLeistart" all works... so i need always a include file without <ice:form> or no componats works...


i have tried to remove all <ice:form> tags in my include files but in this case the application runs always my get and set methodes in all includes files...

so if i expande my tree the application starts the get and set methode of "profkosten" and "profLeistart"... so i need the <ice:form> tag that the set / get is only triggered if i load or klick components on the include files...


if i hit F5 to refresh the page it is still working to the time i switch from a <ice:form> include file to another <ice:form> include file...


someone has an idea? maybe the same problem?
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


Hi,

I'm not sure if you nesting form tags when the 'profLeistart' panel is displayed, but check for that because you shouldn't nest form tags. Are you seeing any warnings or errors in the server logs? Also try saving the DOM update console logs in the browser (control-shift-t) (don't forget to uncheck 'close on exit').

Philip

.
NarfSort

Joined: 10/04/2007 00:00:00
Messages: 11
Offline


thx for the fast replay... i´m now @ home and will check the DOM update console logs tomorrow @ work...


but yes i´m including a ice:form in a another form because i have a "main.jspx" in this is a
Code:
 <ice:form>
 .
 .
 .
 .
 <ice:panelStack...>
  <!-- Profil panel : Leistungsarten WITH <ice:form> in it -->
  	<ice:panelGroup id="profLeistart">
  		<jsp:directive.include file="inc/profilLeistungsarten.jspx"/> 
  	</ice:panelGroup>
 </ice:panelStack>
 .
 .
 .
 </ice:form>
 


so if i choise a panelgroup in the stack there is a form in a form ...

i will check this and pass the server/dom log...
 
Forum Index -> Components Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team