[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
serach in the grid withouth popup  XML
Forum Index -> Development
Author Message
gseijo

Active

Joined: 29/09/2020 14:14:26
Messages: 21
Offline

Hello Björn,

I would like to add a search function without a popup for my grid.

Searching with onOpenGridFunctions is good, but would be better for my project without popup, I need a field where I can search directly.
is there such a thing?

Thnxx
Gori
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5530
Online

Hi Gori,

the popup uses the API of "<yourGridInstance>.getTextSearcher()" returning a class of type "FIXGRIDBinding.TextSearcher".

Use methods...
Code:
 setText(...)
 onPrevious(...)
 onNext(...)
 clearSrearchResult(...)
 


Regards, Björn

Björn Müller, CaptainCasa GmbH
gseijo

Active

Joined: 29/09/2020 14:14:26
Messages: 21
Offline

Hello Björn,

a little more information please, I'm still new here
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5530
Online

Sorry! ;-)

In your page you have somewhere...

Code:
 ...
 <row>
 <t:fixgrid ... objectbinding="#{d.Xyz.grid}" .../>
 </row>
 ...
 


So in your code you have:

Code:
 public class Xyz
 {
     FIXGRIDListBinding<GridItem> m_grid = new FIXGRIDListBinding<GridItem>();
     public FIXGRIDListBinding getGrid() { return m_grid; }
 }
 


So now add a field + button to your layout (e.g. in a row on top of the grid)

Code:
 ...
 <row>
 <t:field ... text="#{d.Xyz.searchText}" .../>
 <t:button ... text="Seach!" actionListener="#{d.Xyz.onSearchAction}" .../>
 </row>
 <row>
 <t:fixgrid ... objectbinding="#{d.Xyz.grid}" .../>
 </row>
 ...
 


and add to your code:

Code:
 public class Xyz
 {
     FIXGRIDListBinding<GridItem> m_grid = new FIXGRIDListBinding<GridItem>();
     public FIXGRIDListBinding getGrid() { return m_grid; }
 
     String m_searchText = "";
     public set/getSearchText ...
 
     public void onSearchAction(ActionEvent event)
     {
         m_grid.getTextSearcher().setText(m_searchText);
         m_grid.getTextSearchrer().onNext(null);
     }
 
 }
 


Hope this makes it clearer... I did write the code directly into the text above + hope I did not make too many typoes...

Regards, Björn

Björn Müller, CaptainCasa GmbH
gseijo

Active

Joined: 29/09/2020 14:14:26
Messages: 21
Offline

Hello Björn,

it workz like a charm

Thnxx
Gori
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team