This content has been marked as final.
Show 5 replies
-
2. Re: How to cancel an Ajax request?
lowecg2004 Sep 6, 2007 6:09 AM (in response to lowecg2004)Thanks for looking at this, I've added my vote the the case.
Cheers,
Chris. -
3. Re: How to cancel an Ajax request?
ilya_shaikovsky Sep 6, 2007 9:39 AM (in response to lowecg2004)I'll cancel the bug. We both have made the same mistake from the begining :)
<h:form> <h:inputText value="#{bean.property}"> <a4j:support event="onkeyup" reRender="test" onsubmit="if (confirm('Lose unsaved changes?')) {return false;}"> </a4j:support> </h:inputText> <h:outputText value="#{bean.property}" id="test"></h:outputText> </h:form>
This code works. So you should add this additional "if" statement to check what was returned from function. -
4. Re: How to cancel an Ajax request?
lowecg2004 Sep 6, 2007 11:15 AM (in response to lowecg2004)D'oh - you're right! Sorry to have wasted your time.
Chris. -
5. Re: How to cancel an Ajax request?
muralib12 Jan 21, 2011 7:07 AM (in response to ilya_shaikovsky)Hi llya,
I am using richfaces-ui-3.3.2.GA.jar and facing strange scenario... I have JSF code just like below
<a4j:form ajaxSubmit="true" > <h:inputText id="seekIndex" size="1" maxlength="3" value="#{searchVo.index}"> <a4j:support event="onkeyup" action="goto" onsubmit="if (event.keyCode != 13) { return false; }else if(!navigateAway()){ return false; } " reRender="xyzFragment"/> </h:inputText> of #{searchVo.count} </a4j:form>
It works fine with the context name like 'myproject'. if context name has some special characters(-) like 'myproject-test' this throws 404 error when it submits ajax request.
<form id="j_id98" name="j_id98" method="post" action="javascript:A4J.AJAX.SubmitForm('j_id98',{'similarityGroupingId':'j_id98','parameters':{'j_id98':'j_id98'}%20, 'actionUrl':'/myproject/x2Dtest/spring/myInformation?execution=e1s1'}%20)" target=""> <input type="text" id="j_id98:seekIndex" name="j_id98:seekIndex" value="1" maxlength="3" onkeyup="if (event.keyCode != 13) { return false; }else if(!navigateAway()){ return false; } ; A4J.AJAX.Submit('j_id98',event,{'similarityGroupingId':'j_id98:j_id99','parameters':{'j_id98:j_id99':'j_id98:j_id99'} , 'actionUrl':'/myproject\x2Dtest/spring/myInformation?execution=e1s1'} )" size="1" autocomplete="off"> of 5<input type="hidden" autocomplete="off" name="j_id98" value="j_id98"><input type="hidden" autocomplete="off" name="autoScroll" value=""> <script type="text/javascript"> //<![CDATA[ function clear_j_id98() { _clearJSFFormParameters('j_id98','',['j_id98:_link_hidden_','j_id98:j_idcl']); } function clearFormHiddenParams_j_id98(){clear_j_id98();} function clearFormHiddenParams_j_id98(){clear_j_id98();} clear_j_id98(); //]]> </script><script type="text/javascript">//<![CDATA[ A4J.setupForm('j_id98'); //]]> </script><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="e1s1" autocomplete="off"></form>
'/myproject/x2Dtest/spring/myInformation?execution=e1s1' obviously this is encoded wrongly.
plz help me how resolve this??