Announcement

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

    Fetch Every Time Filter Dropdown is Selected

    Hello,

    I have a ListGrid with a field that contains a ComboBoxItem as the filter properties.

    When I make some changes in the grid, I need the filter item to refetch to pull the new data. The criteria stays the same, but due to the changes in the grid, new options become available.

    Is there a way to accomplish this without using a click handler?

    Thanks

    #2
    Hi zhene,

    it is, see #3 and #5 here. In SmartGWT you'll need to add setPickListFilterCriteriaFunction() and add a random dynamic criteria like I do in the linked testcase for itemName with new Date().toJSON().
    For ComboBoxItem you'll also need to include the currently entered text from the item, that you can get from itemContext inside the function.

    Isomorphic: The forum is full of questions like this from various years. I could search and link them if needed. I think a sample in the SmartClient/SmartGWT for both SelectItem and ComboBoxItem would really help here.

    Best regards
    Blama

    Comment


      #3
      Hi Blama ,

      Thanks so much for getting back to me and sending me that example. It works now.


      Here is my working code:

      Code:
      setPickListFilterCriteriaFunction(formItemFunctionContext ->
      new AdvancedCriteria(OperatorId.AND, new Criterion[] {
      new Criterion(CONSTANT CRITERIA NAME, OperatorId.EQUALS, VALUE),
      new Criterion(UNUSED NAME, OperatorId.NOT_EQUAL, new Date().toString()) }));
      Last edited by zhene; 22 Apr 2022, 13:44.

      Comment

      Working...
      X