Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    InvalidateCache on ComboBoxItem doesn't working

    Hi, I have a comboboxitem (actually a lot of them) with OptionDataSource that read data from server.
    I simply want to have the option to invalidate datasource cache so next time when combo is opened data will be fetched again from server.

    !!! 'combobox.getOptionDataSource().invalidateCache()' does't working, why is that?
    Log after 'invalidateCache()':
    14:34:30.236:INFO:ResultSet:isc_ResultSet_2 (created by: isc_PickListMenu_0):setCriteria: filter criteria unchanged
    14:34:30.236:DEBUG:ResultSet:isc_ResultSet_2 (created by: isc_PickListMenu_0):getRange(0, 4) satisfied from cache

    * I can't call 'combobox.fetchData()' because i don't want the data to be loaded automatic, only when user interact with combobox.
    * I can't override 'getPickListFilterCriteria()' because (in my case) I can't create relationships between datasources. I tried lots of tricks with overriding this method but give me a lot of problems.

    1. Is this a BUG?
    2. Is there a workaround or another solution to achieve this?

    I use SmartGWT Version: 2.2, Ubuntu 9.04
    Last edited by David_Max; 22 Sep 2010, 22:12.

    #2
    Hi Isomorphic, I think i had placed this thread in wrong place, actually a use SmartGWT 2.2. Can you move this threat under 'Smart GWT Technical Q&A' please?

    Comment


      #3
      I finally succeeded to achieve my goal using showcase model (http://www.smartclient.com/smartgwt/showcase/#form_dep_db_dep_selects) without creating datasource relationships

      Comment


        #4
        How did you do that? I'm having the same problem. Any hint would be appreciated.

        Thanks

        Comment


          #5
          Suppose we had two combobox's, one with users and one color. Somehow users are brought, depending on the colors, but not through a direct relationship.
          In the sample below, after you select a color, users field will clear selection and next time when you open combo, fetch operation will be called.
          Hope this will help you

          Sample:
          Code:
           
          		final ComboBoxItem users = new ComboBoxItem("users", "Users")
          		{
          			protected Criteria getPickListFilterCriteria() 
          			{
          				Criteria criteria = new Criteria("colors", getForm().getValueAsString("colors"));
          				return criteria;
          			};
          		};
          
          		final ComboBoxItem colors = new ComboBoxItem("colors", "Colors");
          		colors.addChangedHandler(new ChangedHandler() {
          			
          			@Override
          			public void onChanged(ChangedEvent event) {
          				users.clearValue();
          				
          			}
          		});

          Comment

          Working...
          X