1 Reply Latest reply on Dec 1, 2011 4:16 PM by narvava

    Error while selecting value from rich suggestion box

    narvava Newbie

      Hi All,

       

      I am using rich suggestion box as combo box due to a requirement. When I select first time value from Suggestion box, it is working fine. But when I try to select the value again from the same suggestion box, I am getting following javascript error.

       

      I need to implement this very urgently. Could anybody suggest, what could be done to resolve this?

       

      Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLInputElement.setSelectionRange]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: suggestionbox.js :: <TOP_LEVEL> :: line 7"  data: no]

       

      Code :

      <h:panelGrid columns="2">

                <h:panelGrid columns="2">

                 <h:panelGrid columns="2" border="0" cellpadding="0"

                  cellspacing="0">

                  <h:inputText style="margin:0px;width:180px;"

                   id="primaryContact" value="#{sdlRegDetails.primaryContact}" >

                   </h:inputText>

                  <h:graphicImage value="/common/images/arrow.png"

                   onclick="#{rich:component('suggestion1')}.callSuggestion(true)"

                   alt="" />

                 </h:panelGrid>

                </h:panelGrid>

                <a4j:region id="primaryContactArea">

                <rich:suggestionbox height="100" width="200"

                 usingSuggestObjects="false" immediate="true"

                 suggestionAction="#{scheduleAction.fetchMemberContactList}"

                 var="cnct" for="primaryContact"

                 fetchValue="#{cnct.firstName} #{cnct.lastName}"

                 id="suggestion1">

                 <h:column>

                  <h:outputText value="#{cnct.firstName} #{cnct.lastName}"/>

                 </h:column>

                 <a4j:support event="onselect" ajaxSingle="true" reRender="primaryContact" ignoreDupResponses="true">

                  <f:setPropertyActionListener value="#{cnct.contactId}"

                   target="#{sdlRegDetails.primaryContactId}" />

                  <f:setPropertyActionListener value="#{cnct.firstName} #{cnct.lastName}"

                   target="#{sdlRegDetails.primaryContact}" />

                 </a4j:support>

                </rich:suggestionbox>

                </a4j:region>

               </h:panelGrid>