1 2 Previous Next 17 Replies Latest reply on Apr 5, 2007 7:02 AM by ilya_shaikovsky Go to original post
      • 15. Re: suggestionbox event triggers form submit, second setter
        ilya_shaikovsky

         

        <rich:suggestionbox for="test" width="200" height="200" suggestionAction="#{bean.autocomplete}" var="cap">
         <a4j:support event="onselect" oncomplete="alert('onselect fires ajax request');"></a4j:support>
         <h:column>
         <h:outputText value="#{cap.text}"></h:outputText>
         </h:column>
        </rich:suggestionbox>
        


        After I select some Item - I'm able to see my alert. so check your code please.

        About focus - also need concrete points to reproduce.

        • 16. Re: suggestionbox event triggers form submit, second setter
          shooali

          Attached please find the code: the limitToList, requestDelay and the ignoreDupResponses does not influence the problems I have, in IE, sometimes the inputText get the focus all the time, and some times the server gets hit and the setPath method on the bean is called with null as parameter thus corrupting the OperatorOptions in the SelectOneMenu since it depends on it.

          thanks,

          <!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:a4j="https://ajax4jsf.dev.java.net/ajax"
           xmlns:c="http://java.sun.com/jstl/core"
           xmlns:jp="http://www.jenia.org/jsf/popup"
           xmlns:af="http://www.emc.com/ajax/jsf"
           xmlns:t="http://myfaces.apache.org/tomahawk"
           xmlns:rich="http://richfaces.ajax4jsf.org/rich">
          
          
          <body>
          
           <ui:composition>
           <c:set var="pageBean" value="#{policyEditingWizardStageAddCustomConstraintBean}"/>
           <script language="javascript" >resizeAllLayouts();</script>
          
           <span id="wizard_popup">
           <div class="wizard_body_hd" id="wizard_body_hd" >
           <div class="title" >#{ajax_msgs['RULE_CONDITIONS_PAGE.BAR_TITLE']}</div>
           </div>
          
           <table id="wizard_popup_table" cellpadding="0"
           cellspacing="10" border="2" width="100%"
           style="padding-left: 20px;padding-right: 20px;">
           <tr>
           <td>#{ajax_msgs['RULE_CONDITIONS_PAGE.TITLE']}
           <h:selectOneRadio id="constraintKindRadio"
           value="#{pageBean.selectedConstraintKind}"
           layout="pageDirection"
           converter="constraintKindConverter">
           <f:selectItems id="constraintKindItems" value="#{pageBean.constraintKindItems}"/>
           <a4j:support event="onclick" reRender="allPanels"/>
           </h:selectOneRadio>
           </td>
           </tr>
           <tr>
           <td valign="middle">
           <!-- ****************************************************** -->
           <!-- radio buttons above show and hide the following panels. -->
           <!-- ****************************************************** -->
           <h:panelGroup id="allPanels">
           <h:panelGroup
           id="ConfigItemAttributePanel"
           rendered="#{pageBean.configItemAttributeKind}">
           <table align="left" width="100%" height="200" border="3" cellspacing="0">
           <tr valign="top">
           <td width="15%">#{ajax_msgs['RULE_CONDITIONS_PAGE.ATTR_FULL_NAME']}</td>
           <td>
           <h:inputText id="configItemAttributePath"
           value="#{pageBean.ciAttributeBean.path}"
           style="width: 250px">
           <a4j:support event="onkeyup" reRender="ciAttributeOperator"
           ignoreDupResponses="true"
           requestDelay="200"
           limitToList="true"/>
           </h:inputText>
           <rich:suggestionbox
           id="attributePathSuggestBox"
           for="configItemAttributePath"
           var="attributePathSuggestion"
           suggestionAction="#{pageBean.ciAttributeBean.configItemAttributeSuggestions}"
           ignoreDupResponses="true"
           requestDelay="200"
           height="200" width="250">
           <a4j:support event="onselect" reRender="ciAttributeOperator"
           ignoreDupResponses="true"
           requestDelay="200"
           limitToList="true"/>
           <h:column>
           <h:outputText value="#{attributePathSuggestion}"/>
           </h:column>
           </rich:suggestionbox>
           </td>
           </tr>
           <tr valign="top">
           <td>
           <h:outputText id="ciAttributeOperatorLabel"
           value="#{ajax_msgs['RULE_CONDITIONS_PAGE.OPERATOR']}">
           <a4j:support event="onclick" reRender="ciAttributeOperator"
           ignoreDupResponses="true"
           requestDelay="200"/>
           </h:outputText>
           </td>
           <td colspan="2">
           <!-- ********** list box for choosing operator ********* -->
           <h:selectOneMenu id="ciAttributeOperator"
           value="#{pageBean.ciAttributeBean.operator}"
           converter="operatorConverter"
           style="width: 100px">
           <f:selectItems id="ciAttributeOperatorItems"
           value="#{pageBean.ciAttributeBean.operatorOptions}"/>
           </h:selectOneMenu>
           </td>
           </tr>
           <tr valign="top">
           <td>#{ajax_msgs['RULE_CONDITIONS_PAGE.VALUE']}</td>
           <td colspan="2">
           <h:inputText id="ciAttributeValue"
           value="#{pageBean.ciAttributeBean.value}"
           styleClass="emc_text"/>
           </td>
           </tr>
           </table>
           </h:panelGroup>
           <h:panelGroup
           id="FilePropertyPanel"
           rendered="#{pageBean.filePropertyKind}">
           <table align="left" width="100%" height="200" border="3" cellspacing="0">
           <tr height="10%" valign="top">
           <td width="15%">#{ajax_msgs['RULE_CONDITIONS_PAGE.CONFIGURATION_FILE']}</td>
           <td>
           <h:inputText id="filePropertyFilePath"
           value="#{pageBean.filePropertyBean.configurationFileName}"/>
           </td>
           </tr>
           <tr valign="top">
           <td width="15%">#{ajax_msgs['RULE_CONDITIONS_PAGE.PROPERTY']}</td>
           <td><h:inputText id="filePropertyName" value="#{pageBean.filePropertyBean.name}"/></td>
           </tr>
           </table>
           </h:panelGroup>
           <h:panelGroup
           id="ConfigItemCountPanel"
           rendered="#{pageBean.configItemCountKind}">
           <h:outputText value="config item count"/>
           </h:panelGroup>
           </h:panelGroup>
           </td>
           </tr>
           </table>
           </span>
          </ui:composition>
          </body>
          </html>


          • 17. Re: suggestionbox event triggers form submit, second setter
            ilya_shaikovsky

            The bug about keeping focus was fixed yesterday.

            1 2 Previous Next