This content has been marked as final.
Show 2 replies
-
1. Re: a4j:queue and a4j:jsFunction: ignoreDupResponses
ilya_shaikovsky Mar 24, 2010 12:09 PM (in response to prather)please post the code you using. I'm not sure that completelly get the case. in first part of the post you talking about the button and the jsFunction which it calls. And the problem later described as "occurs if typing fast".
-
2. Re: a4j:queue and a4j:jsFunction: ignoreDupResponses
prather Mar 25, 2010 2:21 PM (in response to ilya_shaikovsky)A user types a number into the inputText box and hits enter. The onclick event of commandbutton fires a JavaScript function. The function moves the value from the inputText to a hidden textArea. Then the jsFunction is called which invokes the action bean method.
<a4j:form id="frmMain" ajaxSubmit="true" ignoreDupResponses="false" > <a4j:queue size="-1" requestDelay="0" ignoreDupResponses="false" /> <script type="text/javascript" > //<![CDATA[ function resetTextBox(txtSearch, hdnSearch){ var searchBox = document.getElementById(txtSearch); var searchValue = searchBox.value; searchBox.value = ""; searchBox.focus(); if(searchValue.length > 0){ executeSearch(searchValue); return false; //return false regardless, just so that it will alternate //a4j:jsFunction and a4j:commandButton requests thus //the a4j:queue wont think 2 request are similar. } else { return false; } } //]]> </script> Serial# or MAC: <h:inputText id="txtSearch" maxlength="32" /> <!-- for command button, not using the javascript return value because queue is grouping/dropping requests --> <a4j:commandButton id="btnSend" value="Search" onclick="resetTextBox('frmMain:txtSearch', 'frmMain:hdnSearchValue');" disabled="#{equipmentTrackerItems.size ge 200}" ajaxSingle="true" immediate="true" bypassUpdates="true"> <s:defaultAction /> </a4j:commandButton> <a4j:jsFunction id="jsExecuteSearch" name="executeSearch" action="#{equipmentTracker.search}" status="statusSearching" ignoreDupResponses="false" immediate="true" requestDelay="0" reRender="dgEquipment, divMaxCountSound"> <a4j:actionparam name="param1" assignTo="#{equipmentTrackerSearchValue}" /> </a4j:jsFunction> <h:inputTextarea id="txtHdnClipboardContents" value="#{equipmentTracker.clipboardContents}" style="display:none;" /> <a4j:status id="statusSearching" startText="Processing...please wait" startStyle="color: #E96055; font: italic 900 14px sans-serif;" /> .... </a4j:form>