voyent
404: The requested resource (/xxx/iceSubmit('xxx');) is not available.  XML
Forum Index -> General Help
Author Message
kobo

Joined: 09/Jan/2008 00:00:00
Messages: 5
Offline


Hi,
the following code works fine on Internet Explorer but not on Firefox.

Code:
             <ice:form id="hiddenForm">
                 <h:commandButton  type="submit" id="hiddenMethodenAufrufButton" actionListener="#{GejointeSpieleBean.updateState}" style="position: relative;display: none;"/>                
             </ice:form>
         </f:view>
         <script type="text/javascript" language="javascript">
  			window.onLoad(function(){
  				document.getElementById('hiddenForm:hiddenMethodenAufrufButton').click();
  			});
  	</script> 


When the page opens in Firefox it returns a 404 error with the description "The requested resource (/Prototyp/iceSubmit('hiddenForm');) is not available.".


Is there any workaround or better solution? (Just want to call a method when the page is loaded)
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

Why don't you just make a servlet (/myApp/init.servlet) where where you execute your methode and load the servlet from your script code ?

Georges
[Email]
man910

Joined: 11/May/2007 00:00:00
Messages: 31
Offline


Did you ever find a workaround for this? When using JavaScript to fire a commandButton.click() method, it tries to access the URL with "http://localhost/ iceSubmit('appletForm');". The JavaScript code works fine in IE and Chrome but fails with FireFox. The following is the code with everything stripped out. I'm using Facelets.
Code:
 <ice:panelGroup
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ice="http://www.icesoft.com/icefaces/component"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jstl/core"
     xmlns:fn="http://java.sun.com/jsp/jstl/functions"
     rendered="#{myBean.enabled}">
 
     <ice:form
         id="appletForm">
         <ice:inputText
             id="status"
             value="#{myBean.appletNotifier.status}" />
         <ice:commandButton
             id="notify"
             action="#{myBean.appletNotifier.notifyClicked}" />
     </ice:form>
 
     <script>
         document.getElementById('appletForm:notify');.click();
     </script>
 
 </ice:panelGroup>
 

man910

Joined: 11/May/2007 00:00:00
Messages: 31
Offline


The following is a workaround.
Code:
         var oldFocus = currentFocus;
         var cmd = document.getElementById("appletForm:notify");
 
         // FireFox doesn't process the cmd.click() correctly
         // so do it this way instead
         var form = document.getElementById("appletForm");
         currentFocus = cmd.id;
         iceSubmit(form, cmd, new Object());
         currentFocus = oldFocus;
 
mark.collette


Joined: 07/Feb/2005 00:00:00
Messages: 1692
Offline


man910 wrote:

<script>
document.getElementById('appletForm:notify');.click();
</script>
 


Without really looking into it, is the semi-colon the issue?
[Email]
man910

Joined: 11/May/2007 00:00:00
Messages: 31
Offline


No, that' just a typo when I was cleaning up the code to post. I didn't do a straight copy-n-paste. If you look at Kobo's original sample, he has the same issue without the semicolon. Also, in IE, it gives a syntax error if it were actually written that way.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team