-
1. Re: using a4j:support onblur and onclick js confirm at same
asookazian Jun 16, 2008 2:22 PM (in response to asookazian)<p>when I do this: <br/> <br/>["><h:commandButton id="submit" value="Submit" onclick="return true;" action="#{addHardware.populateHardwareAndNotes}" disabled="#{addHardware.submitDisabled}"/> | <h:commandButton id=] <br/> <br/>it works so that means the popping up of the confirmation dialog onclick event is preventing the SFSB method from being executed. <br/> <br/>is there any way around that or do I need to simply remove the "are you sure you want to submit?" confirmation?</p>
-
2. Re: using a4j:support onblur and onclick js confirm at same
asookazian Jun 16, 2008 2:22 PM (in response to asookazian)sorry, this is the new code I tried...
<h:commandButton id="submit" value="Submit" onclick="return true;" action="#{addHardware.populateHardwareAndNotes}" disabled="#{addHardware.submitDisabled}"/>
-
3. Re: using a4j:support onblur and onclick js confirm at same
asookazian Jun 16, 2008 2:24 PM (in response to asookazian).js function:
function confirmMode(modeString) { var returnVal = false; var confirmStr = "Do you wish to "+modeString; var answer; confirmStr = confirmStr + " ? "; answer=window.confirm(confirmStr); if (answer==true) { returnVal = true; } else { returnVal = false; } return returnVal; }
-
4. Re: using a4j:support onblur and onclick js confirm at same
ilya_shaikovsky Jun 17, 2008 8:33 AM (in response to asookazian)do not return anything if you need request to be sent and return false in other case.
-
5. Re: using a4j:support onblur and onclick js confirm at same
asookazian Jun 17, 2008 4:44 PM (in response to asookazian)I tried that as follows and it doesn't work, still does not submit request:
function confirmMode(modeString) { var confirmStr = "Do you wish to "+modeString; var answer; confirmStr = confirmStr + " ? "; answer=window.confirm(confirmStr); if (answer==false) { return false; } }
-
6. Re: using a4j:support onblur and onclick js confirm at same
asookazian Jun 18, 2008 11:11 AM (in response to asookazian)the following code in xhtml with rich:modalPanel works fine:
<rich:panel> <rich:dataTable id="dataTable1" value="#{hardwareAndHardwareNoteList}" var="list"> <rich:column width="2%"> <f:facet name="header"><h:outputText value="#"/></f:facet> <h:outputText id="row" value="#{list.rowCount}"/> </rich:column> <rich:column width="5%"> <f:facet name="header"><h:outputText value="Barcode"/></f:facet> <!-- <h:inputText id="barcode" maxlength="5" size="10" value="#{list.o1.coxBarcode}" valueChangeListener="#{addHardware.processValueChange}"> --> <h:inputText id="barcode" maxlength="5" size="10" value="#{list.o1.coxBarcode}"> <s:validate/> <a4j:support event="onblur" action="#{addHardware.processValueChange(hardwareAndHardwareNoteList.getRowIndex())}" reRender="barcode, submit"/> </h:inputText> </rich:column> <rich:column width="5%"> <f:facet name="header"><h:outputText value="Serial Number"/></f:facet> <h:inputText id="serialNumber" value="#{list.o1.serialNo}" maxlength="20" size="25" onblur="autoTab(this)"/> </rich:column> <rich:column width="48%"> <f:facet name="header"><h:outputText value="Notes"/></f:facet> <h:inputText id="notes" value="#{list.o2.hardwareNote}" size="120" maxlength="2000"/> </rich:column> </rich:dataTable> <a4j:commandButton id="submit" type="button" value="Submit" onclick="Richfaces.showModalPanel('mpConfirmSubmit')" disabled="#{addHardware.submitDisabled}"/> <a4j:commandButton id="cancel" type="button" value="Cancel" action="#{addHardware.cancel}" disabled="false"/> </rich:panel> <h:inputHidden id="tempcompid" value="#{addHardware.compId}"/><br></br> </body> </h:form> <rich:modalPanel id="mpConfirmSubmit" minHeight="200" minWidth="450" height="200" width="450"> <f:facet name="header"> <a4j:outputPanel> <h:outputText id="mpConfirmation" value="Confirmation"/> </a4j:outputPanel> </f:facet> <a4j:form id="a4jChangePeer"> <h:outputText value="Are you sure you want to submit?"/> <BR/> <h:panelGrid columns="2"> <a4j:commandButton value="ok" ajaxSingle="true" action="#{addHardware.populateHardwareAndNotes}" onclick="Richfaces.hideModalPanel('mpConfirmSubmit');"/> <BR/> <a4j:commandButton value="cancel" onclick="Richfaces.hideModalPanel('mpConfirmSubmit');return false;"/> </h:panelGrid> </a4j:form> </rich:modalPanel>