jsf.ajax.request not work on Firefox -


i have application based on jsf 2.1 , primefaces. need make ajax request using jquery , update page status. here code:

    <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"       xmlns:c="http://java.sun.com/jsp/jstl/core"       xmlns:f="http://java.sun.com/jsf/core"       xmlns:h="http://java.sun.com/jsf/html"       xmlns:p="http://primefaces.org/ui"       xmlns:ui="http://java.sun.com/jsf/facelets">     <f:view>         <h:head>         </h:head>         <h:body>             <h:outputtext id="counterviewer" value="#{datacontroller.outputmessage}"                           styleclass="counter-viewer" />             <h:form id="dataform" >                 <h:outputscript>                     jquery(document).ready(function() {                         jquery(document).on("count", function(event, count) {                             alert( "count: " + count );                             document.getelementbyid("#{view.getclientid(facescontext)}:counterviewer").innertext = count;                                var hiddencountvalue = document.getelementbyid("#{view.getclientid(facescontext)}:dataform:hiddencountvalue");                             hiddencountvalue.value = count;                             jsf.ajax.request(hiddencountvalue, 'change');                         });                      });                 </h:outputscript>                 <h:inputhidden id="hiddencountvalue" value="#{datacontroller.outputmessage}"/>             </h:form>         </h:body>     </f:view> </html> 

when use chrome works fine on firefox 22 jsf.ajax.request(hiddencountvalue, 'change'); function doesn't work.

are there other functions can use run code on firefox? why doesn't jsf.ajax.request(hiddencountvalue, 'change'); work on firefox?

thanks

lucaf:view>

when use chrome everithyngs work fine on firefox

jsf.ajax.request(hiddencountvalue, 'change');

function seems not work.

are there other functions can use make code more compatible? why

jsf.ajax.request(hiddencountvalue, 'change');

not work on firefox?

thanks

luca

it should not have worked in chrome @ all. it's caused misinterpretation. perhaps request sent, then, wouldn't useful in server side. namely don't have <f:ajax> on <h:inputhidden> decode jsf.ajax.request().

throw away clumsy hack/workaround attempt. you're using primefaces, grab <p:remotecommand> (showcase example here).

<h:form>     <p:remotecommand name="sendcount" process="@this" action="#{bean.processcount}" /> </h:form> <h:outputscript target="body">     $(document).on("count", function(event, count) {         $(".counter-viewer").text(count);         sendcount([{ name: "count", value: count }]);      }); </h:outputscript> 

with

public void processcount() {     string count = facescontext.getcurrentinstance().getrequestparametermap().get("count");     // ... } 

to learn how jsf.ajax.request works, head following related questions & answers:


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -