9 Replies Latest reply on Oct 12, 2010 1:14 PM by Ponic Pan

    Issues With SuggestionBox, Results Not Getting Displayed

    Ponic Pan Newbie

      Hello,

       

      I am using RF 3.1.6  with JSF 1.1 on Jdeveloper 10.1.3.

       

      When I run the JSP page and I type in letters, no results are getting displayed.

      Below is snippet of code I am using for suggestionbox.

       


      <inputText value="#{suggestionBox.property}" id="text"></inputText>
      <rich:suggestionbox id="suggestionBoxId" for="text"
             tokens=",[" rules="#{suggestionBox.rules}" suggestionAction="#{suggestionBox.autocomplete}"
             var="result" fetchValue="#{result.text}" first="#{suggestionBox.intFirst}" minChars="#{suggestionBox.minchars}"
             shadowOpacity="#{suggestionBox.shadowOpacity}" border="#{suggestionBox.border}" width="#{suggestionBox.width}"
             height="#{suggestionBox.height}" shadowDepth="#{suggestionBox.shadowDepth}"
             cellpadding="#{suggestionBox.cellpadding}">
             <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
             <h:column>
             <h:outputText value="#{result.text}"/>
             </h:column>
             <h:column>
             <h:outputText value="#{result.price}">
             <f:convertNumber pattern="#,##.00" type="currency"/>
             </h:outputText>
             </h:column>
             </rich:suggestionbox>

       

      How can I resolve this issue?

       

      Any help is highly appreciable.

       

      Thanks

        • 1. Re: Issues With SuggestionBox, Results Not Getting Displayed
          Ilya Shaikovsky Master

          1) have you checked that ajax request actually called (e.g. in FireBug)? If not check if the form component present around the ajax component,.

          2) if there are any exceptions at server log?

          3) if your suggestion method called?

          4) anything in a4j:log about errors on client-side?

          • 2. Re: Issues With SuggestionBox, Results Not Getting Displayed
            Ponic Pan Newbie

            Thanks for the reply.

             

            Ilya Shaikovsky wrote:

             

            1) have you checked that ajax request actually called (e.g. in FireBug)? If not check if the form component present around the ajax component,.

             

            AJAXREQUEST=_viewRoot&suggestionbox_form%3A_id0=blueSky&suggestionbox_form%3Atext=a&suggestionbox_form%3AsuggestionBoxId_selection=&suggestionbox_form%3AsuggestionBoxId1_selection=&suggestionbox_form%3Atext1=&suggestionbox_form%3A_id62=&suggestionbox_form=suggestionbox_form&suggestionbox_form%3A_idcl=&suggestionbox_form%3AsuggestionBoxId=suggestionbox_form%3AsuggestionBoxId&inputvalue=a&

            2) if there are any exceptions at server log?

            No exceptions in log, couldn't find any log messages in jdeveloper embedded server log.

            3) if your suggestion method called?

            My autocomplete method is not getting invoked, I could see log messages in constructor of the class.

            4) anything in a4j:log about errors on client-side?

            I have attached a4j log messages for your kind reference.

             

            Thanks

            Jac

             

            Message was edited by: Ponic Jac

            • 3. Re: Issues With SuggestionBox, Results Not Getting Displayed
              Ilya Shaikovsky Master

              add please phase tracker and check it output about lifecycle.

              • 4. Re: Issues With SuggestionBox, Results Not Getting Displayed
                Ponic Pan Newbie

                HI,

                 

                Here's the output for phace tracker, sorry I couldn't understand much from below. Something wrong?

                Oct 11, 2010 2:38:49 PM org.exadel.jsf.PhaseTracker beforePhase
                INFO: BEFORE RESTORE_VIEW 1
                Oct 11, 2010 2:38:49 PM org.exadel.jsf.PhaseTracker afterPhase
                INFO: AFTER RESTORE_VIEW 1
                Oct 11, 2010 2:38:49 PM org.exadel.jsf.PhaseTracker beforePhase
                INFO: BEFORE RENDER_RESPONSE 6
                Oct 11, 2010 2:38:50 PM org.exadel.jsf.PhaseTracker afterPhase
                INFO: AFTER RENDER_RESPONSE 6

                 

                Message was edited by: Ponic Jac

                • 5. Re: Issues With SuggestionBox, Results Not Getting Displayed
                  Ponic Pan Newbie

                  Not sure why it skipped phase 2 to 5, how to figure out why it skipped?

                   

                  Thanks

                  • 6. Re: Issues With SuggestionBox, Results Not Getting Displayed
                    Ponic Pan Newbie

                    I modified web.xml and phases from 1-6 getting executed and I can autocomplete method is invoked as well.

                     

                    Now the issue is a4j log is showing error

                    debug[11:27:20,219]: call getElementById for id= suggestionbox_form:suggestionBoxId:suggest
                    error[11:27:20,219]: New node for ID suggestionbox_form:suggestionBoxId:suggest is not present in response
                    debug[11:27:20,220]: call getElementById for id= ajax-view-state
                    Besides in firebug the following error occurs in script
                    element.selectNodes is not a function 
                    What could be reason for this?
                    Thanks
                    • 7. Re: Issues With SuggestionBox, Results Not Getting Displayed
                      Ilya Shaikovsky Master

                      It could be a problem of non w3c-complaint  markup of the page itself.

                      • 8. Re: Issues With SuggestionBox, Results Not Getting Displayed
                        Ponic Pan Newbie

                        Could you kindly provide more insight on non w3c-complaint issue in page?

                        here is the code in my page, do you find anything suspicious?

                         

                        Thanks

                         

                        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                        "http://www.w3.org/TR/html4/loose.dtd">
                        <%@ page contentType="text/html;charset=windows-1252"%>
                        <html>
                          <head>
                            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
                            <title>bean</title>
                            <style type="text/css">
                                .sb_test_column1 {
                                    vertical-align: top;
                                    text-align: left;
                                    padding-right: 5px;
                                }
                                .sb_test_column2 {
                                    vertical-align: middle;        
                                    text-align: center;
                                    padding-left: 5px;
                                }
                            </style>
                          </head>
                                <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
                             <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
                             <%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
                             <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
                                
                                
                        <f:view>
                          
                           
                          <h:form id="suggestionbox_form">      
                               <h:panelGrid columns="2" columnClasses="sb_test_column1,sb_test_column2" width="100%">
                                    <h:panelGroup>
                                        <h:inputText value="#{capitalsBean.capital}" id="text" />
                                        <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]"                   
                                            suggestionAction="#{capitalsBean.autocomplete}" var="result"
                                            fetchValue="#{result.name}"
                                            first="0"
                                            minChars="1"
                                            shadowOpacity="2"
                                            border="2" width="300"
                                            height="180"
                                            shadowDepth="3"
                                            cellpadding="2"
                                            nothingLabel="No capitals found">
                                            <h:dataTable>                   
                                            <h:column>
                                                <h:outputText value="#{result.name}" />
                                            </h:column>                  
                                            </h:dataTable>
                                        </rich:suggestionbox>             
                                        <a4j:log popup="false"/>
                                    </h:panelGroup>
                                </h:panelGrid>      
                            </h:form>
                        </f:view>
                        </html>

                        • 9. Re: Issues With SuggestionBox, Results Not Getting Displayed
                          Ponic Pan Newbie

                          Could someone provide some help, actually I am stuck with this error!.