1 Reply Latest reply on Oct 9, 2007 2:36 PM by Hans Georg Frey

    h:selectOneMenu, a4j:support and onclick

    Hans Georg Frey Newbie

      Hi,

      I have an oncklick, oncomplete and status attribute in an a4j:support element which does not work as expected. What l try to do is to show a sandglass while a4j does it's work, but there is no sandglass. The a4j:support element resides in a h:selectOneMenu element, which resides in a a4j:region element. a4j:status is also not repainted. See my coding beneath (search for serviceLevel for an example).

      Thank you for any help



      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich">
      
      <f:loadBundle basename="resources" var="msg" />
      <ui:composition>
      
       <h:panelGrid id="DLG_CONFIG_PNL_BASIC_PG" columns="3"
       columnClasses="gridContent">
      
       <h:panelGroup>
       <h:panelGrid id="DLG_CONFIG_PNL_BASIC_PG_SP_ID" columns="2">
      
       <h:panelGroup />
       <h:panelGrid>
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_TXT_VPN_ID_ERROR"
       for="DLG_CONFIG_PNL_BASIC_TXT_VPN_ID" />
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_TXT_SAP_NO_ERROR"
       for="DLG_CONFIG_PNL_BASIC_TXT_SAP_NO" />
       </h:panelGrid>
       <h:outputText value="#{msg.DLG_CONFIG_PNL_BASIC_LBL_SP_ID}" />
       <h:panelGrid columns="3">
       <h:inputText id="DLG_CONFIG_PNL_BASIC_TXT_VPN_ID"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_VPN_ID}" size="10"
       maxlength="10" title="#{msg.DLG_CONFIG_PNL_BASIC_TIT_VPN_ID}"
       value="#{configurationHandler.config.SAP_ID.VPN_ID}"
       converter="spims.VpnIdConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_ID-VPN_ID']}"
       disabled="!#{configurationHandler.mapEnabled['Configuration-SAP_ID-VPN_ID']}">
       <f:validateLength minimum="1" maximum="10" />
       <a4j:support event="onblur" reRender="panelError"
       ajaxSingle="true" limitToList="true" />
       </h:inputText>
       <h:outputText value="." />
       <h:inputText id="DLG_CONFIG_PNL_BASIC_TXT_SAP_NO"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_SAP_NO}" size="6"
       maxlength="6" title="#{msg.DLG_CONFIG_PNL_BASIC_TIT_SAP_NO}"
       value="#{configurationHandler.config.SAP_ID.SAP_NO}"
       converter="spims.SapNoConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_ID-SAP_NO']}">
       <f:validateLength maximum="6" />
       <a4j:support event="onblur" reRender="panelError"
       ajaxSingle="true" limitToList="true" />
       </h:inputText>
       </h:panelGrid>
      
       <h:panelGroup />
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_TXT_VPN_NAME_ERROR"
       for="DLG_CONFIG_PNL_BASIC_TXT_VPN_NAME" />
       <h:outputText id="DLG_CONFIG_PNL_BASIC_LBL_VPN_NAME"
       value="#{msg.DLG_CONFIG_PNL_BASIC_LBL_VPN_NAME}" />
       <h:inputText id="DLG_CONFIG_PNL_BASIC_TXT_VPN_NAME"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_VPN_NAME}"
       title="#{msg.DLG_CONFIG_PNL_BASIC_TIT_VPN_NAME}" maxlength="10"
       size="23" value="#{configurationHandler.config.SAP_INFO.VPN_NAME}"
       converter="spims.VrfNoConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-VPN_NAME']}">
       <f:validateLength maximum="10" />
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:inputText>
      
       <h:panelGroup />
       <h:message styleClass="error" id="techNetNameError"
       for="techNetName" />
       <h:outputText value="#{msg.DLG_CONFIG_PNL_BASIC_LBL_TECHNICAL_NET}" />
       <h:inputText id="techNetName"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_TECHNICAL_NET}"
       title="#{msg.DLG_CONFIG_PNL_BASIC_TIT_TECHNICAL_NET}"
       value="#{configurationHandler.config.SAP_INFO.TECHNICAL_NET_NAME}"
       converter="spims.TechNetNameConverter" size="23" maxlength="14"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-TECHNICAL_NET_NAME']}">
       <f:validateLength maximum="14" />
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:inputText>
      
       </h:panelGrid>
      
       <h:panelGrid columns="1">
       <rich:spacer width="1" height="15" />
       <rich:spacer width="300" height="0"
       style="border:1px solid #{a4jSkin.panelBorderColor}" />
       <rich:spacer width="1" height="15" />
       </h:panelGrid>
      
       <h:panelGrid columns="2">
      
       <h:panelGroup />
       <h:message styleClass="error" id="carError" for="car" />
       <h:outputText value="CAR:" />
       <h:selectOneMenu id="car" label="CAR" style="width: 150px"
       value="#{configurationHandler.config.SAP_INFO.CAR}"
       converter="spims.CarConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-CAR']}">
       <f:selectItems value="#{selectItemProvider.carList}" />
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:selectOneMenu>
      
       <h:panelGroup />
       <h:message styleClass="error" id="economyError" for="economy" />
       <h:outputText value="Economy (in %):" />
       <h:inputText id="economy" label="Economy" size="3"
       disabled="#{!configurationHandler.mapEnabled['Configuration-SAP_INFO-ECONOMY_BANDWIDTH']}"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-ECONOMY_BANDWIDTH']}"
       value="#{configurationHandler.bandwidth.ECONOMY_BANDWIDTH}" />
      
       <h:panelGroup />
       <h:message styleClass="error" id="businessError" for="business" />
       <h:outputText value="Business (in %):" />
       <a4j:region>
       <h:inputText id="business" label="Business Bandwidth" size="3"
       maxlength="3"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-BUSINESS_BANDWIDTH']}"
       value="#{configurationHandler.bandwidth.BUSINESS_BANDWIDTH}">
       <a4j:support event="onchange" ajaxSingle="true"
       reRender="economy,business,stream,panelError" />
       </h:inputText>
       </a4j:region>
      
       <h:panelGroup />
       <h:message styleClass="error" id="streamError" for="stream" />
       <h:outputText value="Stream (in %):" />
       <a4j:region>
       <h:inputText id="stream" label="Stream Bandwidth" size="3"
       maxlength="3"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-STREAM_BANDWIDTH']}"
       value="#{configurationHandler.bandwidth.STREAM_BANDWIDTH}">
       <a4j:support event="onchange" ajaxSingle="true"
       reRender="economy,business,stream,panelError" />
       </h:inputText>
       </a4j:region>
      
       <h:panelGroup />
       <h:message styleClass="error" id="voiceError" for="voice" />
       <h:outputText value="Voice (in Channels):" />
       <h:inputText id="voice" label="Voice" size="3"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-VOICE_BANDWIDTH']}"
       value="#{configurationHandler.config.SAP_INFO.VOICE_BANDWIDTH}">
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:inputText>
       </h:panelGrid>
       </h:panelGroup>
      
       <h:panelGrid columns="3">
       <rich:spacer width="15" height="1" />
       <rich:spacer width="0" height="300"
       style="vertical-align:middle;border:1px solid #{a4jSkin.panelBorderColor}" />
       <rich:spacer width="15" height="1" />
       </h:panelGrid>
      
       <h:panelGrid columns="2" id="DLG_CONFIG_PNL_BASIC_PG_INTERFACES">
      
       <h:panelGroup />
       <h:message styleClass="error" id="serviceLevelError"
       for="serviceLevel" />
       <h:outputText value="Service Level:" />
       <a4j:region>
       <h:selectOneMenu id="serviceLevel" label="Service Level"
       style="width: 150px"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-SERVICE_LEVEL']}"
       value="#{configurationHandler.config.SAP_INFO.SERVICE_LEVEL}"
       converter="spims.ServiceLevelConverter"
       validator="spims.ServiceLevelValidator"
       valueChangeListener="#{configurationHandler.changedServiceLevel}">
       <f:selectItems value="#{selectItemProvider.serviceLevelList}" />
       <a4j:support event="onchange" ajaxSingle="true"
       focus="serviceLevel" limitToList="true" immediate="true"
       onclick="document.getElementsByTagName('body')[0].style.cursor='wait'"
       oncomplete="document.getElementsByTagName('body')[0].style.cursor='auto'"
       status="DLG_CONFIG_PNL_CONTROL_REGION"
       reRender="DLG_CONFIG_PNL_BASIC_PG_INTERFACES,DLG_CONFIG_PNL_CPE_TXT_IP_CROSS_LINK" />
       </h:selectOneMenu>
       </a4j:region>
      
       <h:panelGroup />
       <h:message styleClass="error" id="protocolError" for="protocol" />
       <h:outputText value="Protocol:" />
       <a4j:region>
       <h:selectOneMenu id="protocol" label="protocol" style="width: 150px"
       value="#{configurationHandler.PROTOCOL}"
       converter="spims.ProtocolConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-PROTOCOL']}"
       disabled="#{!configurationHandler.mapEnabled['Configuration-SAP_INFO-PROTOCOL']}"
       valueChangeListener="#{configurationHandler.changedProtocol}">
       <f:selectItems value="#{selectItemProvider.protocolList}" />
       <a4j:support event="onchange" ajaxSingle="true" focus="protocol"
       onclick="document.getElementsByTagName('body')[0].style.cursor='wait'"
       oncomplete="document.getElementsByTagName('body')[0].style.cursor='auto'"
       status="DLG_CONFIG_PNL_CONTROL_REGION" immediate="true"
       limitToList="true" reRender="DLG_CONFIG_PNL_ALL" />
       </h:selectOneMenu>
       </a4j:region>
      
       <h:panelGroup />
       <h:message styleClass="error" id="backupError" for="backup" />
       <h:outputText value="Backup:" />
       <a4j:region>
       <h:selectOneMenu id="backup" label="Backup"
       value="#{configurationHandler.config.SAP_INFO.BACKUP_TYPE}"
       converter="spims.BackupConverter" validator="spims.BackupValidator"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-BACKUP_TYPE']}"
       disabled="#{!configurationHandler.mapEnabled['Configuration-SAP_INFO-BACKUP_TYPE']}"
       valueChangeListener="#{configurationHandler.changedBackup}">
       <f:selectItems value="#{selectItemProvider.backupList}" />
       <a4j:support event="onchange" ajaxSingle="true" focus="backup"
       onclick="document.getElementsByTagName('body')[0].style.cursor='wait'"
       oncomplete="document.getElementsByTagName('body')[0].style.cursor='auto'"
       status="DLG_CONFIG_PNL_CONTROL_REGION"
       reRender="DLG_CONFIG_PNL_ALL" limitToList="true" />
       </h:selectOneMenu>
       </a4j:region>
      
       <h:panelGroup />
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_CMB_CPE_TYPE_ERROR"
       for="DLG_CONFIG_PNL_BASIC_CMB_CPE_TYPE" />
       <h:outputText value="Type:" />
       <a4j:region>
       <h:selectOneMenu id="DLG_CONFIG_PNL_BASIC_CMB_CPE_TYPE"
       label="CPE Type" style="width: 150px"
       value="#{configurationHandler.config.CPE_ROUTER.TYPE}"
       converter="spims.CpeTypeConverter"
       required="#{configurationHandler.mapMandatory['Configuration-CPE_ROUTER-TYPE']}"
       disabled="#{!configurationHandler.mapEnabled['Configuration-CPE_ROUTER-TYPE']}"
       valueChangeListener="#{configurationHandler.changedCpeType}">
       <f:selectItems value="#{selectItemProvider.cpeTypeList}" />
       <a4j:support event="onchange" ajaxSingle="true"
       focus="DLG_CONFIG_PNL_BASIC_CMB_CPE_TYPE"
       onclick="document.getElementsByTagName('body')[0].style.cursor='wait'"
       oncomplete="document.getElementsByTagName('body')[0].style.cursor='auto'"
       status="DLG_CONFIG_PNL_CONTROL_REGION"
       reRender="DLG_CONFIG_PNL_BASIC_PG_INTERFACES" limitToList="true" />
       </h:selectOneMenu>
       </a4j:region>
      
       <h:panelGroup />
       <h:message styleClass="error" id="loadSharingError" for="loadSharing" />
       <h:outputText value="load-sharing:" />
       <h:selectOneMenu id="loadSharing" label="load sharing"
       value="#{configurationHandler.config.SAP_INFO.LOAD_SHARING}"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-LOAD_SHARING']}"
       converter="spims.YesNoConverter">
       <f:selectItems value="#{selectItemProvider.yesNoList}" />
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:selectOneMenu>
      
       <h:panelGroup />
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_LBL_MULTI_VPN_ERROR"
       for="DLG_CONFIG_PNL_BASIC_LBL_MULTI_VPN" />
       <h:outputText value="#{msg.DLG_CONFIG_PNL_BASIC_LBL_MULTI_VPN}" />
       <h:panelGrid columns="2">
       <a4j:region>
       <h:selectOneMenu id="DLG_CONFIG_PNL_BASIC_LBL_MULTI_VPN"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_MULTI_VPN}"
       value="#{configurationHandler.config.SAP_INFO.MULTI_VPN}"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-MULTI_VPN']}"
       valueChangeListener="#{configurationHandler.changedMultiVpn}"
       converter="spims.YesNoConverter">
       <f:selectItems value="#{selectItemProvider.yesNoList}" />
       <a4j:support event="onchange" ajaxSingle="true" limitToList="true"
       reRender="panelError,DLG_CONFIG_PNL_BASIC_TXT_MASTER_VPN_ID,
       DLG_CONFIG_PNL_BASIC_TXT_MASTER_SAP_NO,DLG_CONFIG_PNL_BASIC_LBL_PE_FINAL_TYPE" />
       </h:selectOneMenu>
       <h:selectOneMenu id="DLG_CONFIG_PNL_BASIC_LBL_PE_FINAL_TYPE"
       value="#{configurationHandler.config.SAP_INFO.PE_FINAL_TYPE}"
       converter="spims.PEFinalTypeConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-PE_FINAL_TYPE']}"
       disabled="#{!configurationHandler.mapEnabled['Configuration-SAP_INFO-PE_FINAL_TYPE']}"
       rendered="#{configurationHandler.mapVisible['Configuration-SAP_INFO-PE_FINAL_TYPE']}">
       <f:selectItems
       value="#{configurationHandler.selectItemsPEFinalType}" />
       <a4j:support event="onchange" ajaxSingle="true" limitToList="true"
       reRender="panelError,DLG_CONFIG_PNL_BASIC_TXT_MASTER_VPN_ID,
       DLG_CONFIG_PNL_BASIC_TXT_MASTER_SAP_NO" />
       </h:selectOneMenu>
       </a4j:region>
       </h:panelGrid>
      
       <h:panelGroup />
       <h:panelGrid>
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_TXT_MASTER_VPN_ID_ERROR"
       for="DLG_CONFIG_PNL_BASIC_TXT_MASTER_VPN_ID" />
       <h:message styleClass="error"
       id="DLG_CONFIG_PNL_BASIC_TXT_MASTER_SAP_NO_ERROR"
       for="DLG_CONFIG_PNL_BASIC_TXT_MASTER_SAP_NO" />
       </h:panelGrid>
       <h:outputText value="#{msg.DLG_CONFIG_PNL_BASIC_LBL_MASTER_SP_ID}" />
       <h:panelGrid columns="3">
       <h:inputText id="DLG_CONFIG_PNL_BASIC_TXT_MASTER_VPN_ID"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_MASTER_VPN_ID}" size="10"
       maxlength="10"
       title="#{msg.DLG_CONFIG_PNL_BASIC_TIT_MASTER_VPN_ID}"
       value="#{configurationHandler.config.SAP_INFO.MASTER_SAP_ID.VPN_ID}"
       converter="spims.VpnIdConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-MASTER_SAP_ID-VPN_ID']}"
       disabled="#{!configurationHandler.mapEnabled['Configuration-SAP_INFO-MASTER_SAP_ID-VPN_ID']}">
       <f:validateLength minimum="1" maximum="10" />
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:inputText>
       <h:outputText value="." />
       <h:inputText id="DLG_CONFIG_PNL_BASIC_TXT_MASTER_SAP_NO"
       label="#{msg.DLG_CONFIG_PNL_BASIC_LAB_MASTER_SAP_NO}" size="6"
       maxlength="6" title="#{msg.DLG_CONFIG_PNL_BASIC_TIT_MASTER_SAP_NO}"
       value="#{configurationHandler.config.SAP_INFO.MASTER_SAP_ID.SAP_NO}"
       converter="spims.SapNoConverter"
       required="#{configurationHandler.mapMandatory['Configuration-SAP_INFO-MASTER_SAP_ID-SAP_NO']}"
       disabled="#{!configurationHandler.mapEnabled['Configuration-SAP_INFO-MASTER_SAP_ID-SAP_NO']}">
       <f:validateLength maximum="6" />
       <a4j:support event="onblur" reRender="panelError" ajaxSingle="true"
       limitToList="true" />
       </h:inputText>
       </h:panelGrid>
      
       </h:panelGrid>
      
       </h:panelGrid>
      </ui:composition>
      </html>