Skip to content

Commit

Permalink
fix: 🐛 SetFilter filter throws warnnings in aggv23.2
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The GxClientModels.GxClientFilterSetFilterModel
requires calling the `update` method after calling any of its methods
(ex: selectEverything()). Check Demo/FilterAPI )
  • Loading branch information
hyyan committed Jun 26, 2020
1 parent fb48c2c commit cc8d4b6
Show file tree
Hide file tree
Showing 5 changed files with 561 additions and 623 deletions.
24 changes: 11 additions & 13 deletions GxClientModels.bbj
Expand Up @@ -17,6 +17,7 @@ use com.google.gson.Gson
use com.google.gson.JsonParser
use com.google.gson.JsonObject
use com.google.gson.JsonArray
use com.google.gson.JsonPrimitive
use com.basiscomponents.db.DataRow
use java.util.ArrayList
use java.util.Arrays
Expand Down Expand Up @@ -1487,23 +1488,17 @@ class public GxClientFilterSetFilterModel extends GxClientFilterAbstractModel
rem * Select all values generated by the UI
rem *
rem * <br><b><small>#API</small></b>
rem *
rem * @throws 256 when the column or the widget are not defined
rem */
method public void selectEverything()
code! = String.format(";%s.selectEverything();" , #getFilterInstance())
#getWidget().getExecutor().execute(code! + #execute(0))
#setValues(null())
methodend
rem /**
rem * Clears the selection
rem *
rem * <br><b><small>#API</small></b>
rem *
rem * @throws 256 when the column or the widget are not defined
rem */
method public void selectNothing()
code! = String.format(";%s.selectNothing();", #getFilterInstance())
#getWidget().getExecutor().execute(code! + #execute(0))
#setValues(new JsonArray())
methodend
rem /**
rem * Change on the fly the available options
Expand All @@ -1528,8 +1523,10 @@ class public GxClientFilterSetFilterModel extends GxClientFilterAbstractModel
rem * @throws 256 when the column or the widget are not defined
rem */
method public void selectValue(BBjString value!)
code! = String.format(";%s.selectValue('%s');" , #getFilterInstance(), value!)
#getWidget().getExecutor().execute(code! + #execute(0))
values! = #getValues()
if(values! <> null()) then
values!.add(value!)
fi
methodend
rem /**
rem * Selects a value
Expand All @@ -1553,8 +1550,10 @@ class public GxClientFilterSetFilterModel extends GxClientFilterAbstractModel
rem * @throws 256 when the column or the widget are not defined
rem */
method public void unselectValue(BBjString value!)
code! = String.format("%s.unselectValue('%s');", #getFilterInstance(), value!)
#getWidget().getExecutor().execute(code! + #execute(0))
values! = #getValues()
if(values! <> null()) then
values!.remove(new JsonPrimitive(value!))
fi
methodend
rem /**
rem * Unselects a value
Expand All @@ -1579,7 +1578,6 @@ class public GxClientFilterSetFilterModel extends GxClientFilterAbstractModel
rem */
method public void clearFilter()
#super!.clearFilter()
#setValues(new JsonArray())
#selectEverything()
methodend
rem /**
Expand Down

0 comments on commit cc8d4b6

Please sign in to comment.