5 Replies Latest reply on Jan 14, 2008 11:42 PM by robertocarlos1

    SuggestionBox Issue

      I have a page that contain several objects, every object is rendered when is required, these controls are tables, dorpdowns, etc. when some action is raised only the data for controls that are rendering are loaded. But when the autocomplete of the suggestionbox is executed the data of all controls is loaded. I dont have code in the autocomplete that can cause that behavior. Thats look like if suggestionBox dont restrict the execution of some phase events or methods for the controls that is not rendering in the interface.

      I will apreciate any help or suggest for change this behavior or any aclaration about some misunderstanding?

      Thanks.

        • 1. Re: SuggestionBox Issue

          could you say more?

          • 2. Re: SuggestionBox Issue

            this is part of the code in the page

            ....
             <rich:tabPanel id='myTabPanel' switchType='ajax'>
             <rich:tab id='tab_1' switchType='ajax' opened='true' limitToList='true' reRender='myTabPanel'>
             <!-- some controls like dropdowns and datatables -->
             </rich:tab>
             <rich:tab id='tab_2' switchType='ajax' opened='true' limitToList='true' reRender='myTabPanel'>
             <!-- some controls like dropdowns and datatables -->
             </rich:tab>
             <rich:tab id='tab_3' switchType='ajax' opened='true' limitToList='true' reRender='myTabPanel'>
             <!-- some controls like dropdowns and datatables and suggestionBox -->
             </rich:tab>
             </rich:tabPanel>
            ....
            


            in the bean i have properties that contains the control's datamodels. In the get Methods of these properties i'm loading the information from the database and putting in the datamodel. Something like that:

             ......
             public class MyBean(){
             private List myTable1List = new ArrayList();
             .....
             .....
             public List getMyTable1List(){
             if (myTable1List.isEmpty()){
             //Get information from database and put in myTable1List
             }
             return this.myTable1List;
             }
             }
            


            when i clic in the tab2 only the get methods for the datamodels of the controls that are rendering in that tab are executed and the same happen if i clic in some button for save or refresh the information. This behavior is OK for me, because i want only load the information of the rendered controls.

            The behavior is diferent with the suggestionBox, when put some chars, the request is sending to the server for get the suggestion list, when that happens all the methods get of the properties containing the datamodels even those that aren't rendered are executed, causing the loading of information for all controls, spending more time for show the suggestion list.

            Thanks for your reply.

            • 3. Re: SuggestionBox Issue

              i was wrong, only when all the contained controls in the tab cause the undesired behavior (For me). only when i clic in the tabs is loaded only the information of the controls that will be rendered.

              but still i need a way to change that behavior.

              • 4. Re: SuggestionBox Issue

                why you rerender the whole tab panel when you click on the tab?

                • 5. Re: SuggestionBox Issue

                  if i dont rerender the whole tab panel, the selected tab never change to the clicked tab, i tried to put rerender for the id of the same tab where is the rerender property, but the tab selected never change.

                  Thanks for your reply