public class GxCellEditorSuggestionResolver
implements GxCellEditorSuggestionResolverInterface
An generic implementation of GxCellEditorSuggestionResolverInterface
The class implements the resolve
method defined in GxCellEditorSuggestionResolverInterface
and exposes some helpers methods like addItem
, createItem
to help building
the suggestion list.
Any Custom object which extends this class must implement the doResolve
method
which accepts the search term.
ex:
use ::BBjGridExWidget/GxCellEditors.bbj::GxCellEditorSuggestionResolver class public CustomResolver extends GxCellEditorSuggestionResolver method public void doResolve(BBjString term!) sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore")) rs! = sbc!.retrieve(String.format("SELECT TITLE , MUSICTYPE, CDNUMBER FROM CDINVENTORY WHERE TITLE LIKE '%%%s%%' ORDER BY MUSICTYPE", term!)) it! = rs!.iterator() while it!.hasNext() next! = it!.next() label! = String.format("[%s] %s", #getColumn().getName(), next!.getFieldAsString("TITLE")) value! = next!.getFieldAsString("CDNUMBER") group! = next!.getFieldAsString("MUSICTYPE") #addItem(label!, value!, group!) wend methodend classend
Modifier and Type | Field and Description |
---|---|
GxClientColumnModel | Column! The column model |
JsonArray | List! A json array which is used by the |
GxClientRowModel | Row! The row model |
BBjString | Term! The search term |
Modifier and Type | Method and Description |
---|---|
void | addItem(BBjString label!, BBjString value!, BBjString group!) add a new suggestion item |
void | addItem(BBjString label!, BBjString value!) Add a new suggestion item |
void | addItem(BBjString label!) Add a new suggestion item |
JsonObject | createItem(BBjString label!, BBjString value!, BBjString group!) Create a new suggestion item |
JsonObject | createItem(BBjString label!, BBjString value!) Create a new suggestion item |
JsonObject | createItem(BBjString label!) Create a new suggestion item |
JsonArray | resolve(BBjString term!, GxClientColumnModel column!, GxClientRowModel row!) Resolve/build the suggestion list |
public GxClientColumnModel Column!
The column model
public JsonArray List!
A json array which is used by the addItem
methods and it
will be returned by the implemented resolve
method
public GxClientRowModel Row!
The row model
public BBjString Term!
The search term
public void addItem(BBjString label!, BBjString value!, BBjString group!)
add a new suggestion item
BBjString
label! The item label. It will be used to display the item in the listBBjString
value! The item value. It will be used to inset the input's valueBBjString
group! The item group. Display suggestions separated into one or multiple groupspublic void addItem(BBjString label!, BBjString value!)
Add a new suggestion item
BBjString
label! The item label. It will be used to display the item in the listBBjString
value! The item value. It will be used to inset the input's valuepublic void addItem(BBjString label!)
Add a new suggestion item
BBjString
label! The item label. It will be used to display the item in the listpublic JsonObject createItem(BBjString label!, BBjString value!, BBjString group!)
Create a new suggestion item
BBjString
label! The item label. It will be used to display the item in the listBBjString
value! The item value. It will be used to inset the input's valueBBjString
group! The item group. Display suggestions separated into one or multiple groupspublic JsonObject createItem(BBjString label!, BBjString value!)
Create a new suggestion item
BBjString
label! The item label. It will be used to display the item in the listBBjString
value! The item value. It will be used to inset the input's valuepublic JsonObject createItem(BBjString label!)
Create a new suggestion item
BBjString
label! The item label. It will be used to display the item in the listpublic JsonArray resolve(BBjString term!, GxClientColumnModel column!, GxClientRowModel row!)
Resolve/build the suggestion list
BBjString
term! The search termGxClientColumnModel
column! The column modelGxClientRowModel
row! The row model