This thread recalls the second part of the following thread:
http://forums.smartclient.com/showth...t=23364&page=2
I have two ListGrids, Grid1 and Grid2.
Grid1 shows some records and has a field named "ElementID".
Grid2 shows informations about every Grid1's elements.
At runtime, when i click on a Grid1's record, i get the ElementID and i create Grid2. Grid2 fetches data executing a jpa query (server side) depending on this ElementID, so i do the following:
Grid1 code ---------------------------
--------------------------------------
.
.
Grid1.addCellClickHandler(new CellClickHandler() {
@Override
public void onCellClick(CellClickEvent event) {
ListGridRecord record = hisInfoGrid.getSelectedRecord();
int elementID = Integer.parseInt(record.getAttribute("elementID"));
Grid2 = new Grid2(elementID));
}
});
.
.
Grid2 code ---------------------------
--------------------------------------
public Grid2(int id) {
.
.
String elementID = id;
DSRequest myDSRequest = new DSRequest();
Map params = new HashMap();
params.put("elementID", elementID);
myDSRequest.setParams(params);
ListGrid.fetchData(new Callback(), myDSRequest);
.
.
}
Server side, i get the parameter, i execute the correct jpa query, and i return a DSResponse.
Now, i need to do the same with filter and Grid header (for sorting), i need this parameter in DSRequests. This parameter must always be sent when fetching, but his value is decided at runtime.
How can i set parameters at runtime for filtering operation?
Thank you,
Giervella
http://forums.smartclient.com/showth...t=23364&page=2
I have two ListGrids, Grid1 and Grid2.
Grid1 shows some records and has a field named "ElementID".
Grid2 shows informations about every Grid1's elements.
At runtime, when i click on a Grid1's record, i get the ElementID and i create Grid2. Grid2 fetches data executing a jpa query (server side) depending on this ElementID, so i do the following:
Grid1 code ---------------------------
--------------------------------------
.
.
Grid1.addCellClickHandler(new CellClickHandler() {
@Override
public void onCellClick(CellClickEvent event) {
ListGridRecord record = hisInfoGrid.getSelectedRecord();
int elementID = Integer.parseInt(record.getAttribute("elementID"));
Grid2 = new Grid2(elementID));
}
});
.
.
Grid2 code ---------------------------
--------------------------------------
public Grid2(int id) {
.
.
String elementID = id;
DSRequest myDSRequest = new DSRequest();
Map params = new HashMap();
params.put("elementID", elementID);
myDSRequest.setParams(params);
ListGrid.fetchData(new Callback(), myDSRequest);
.
.
}
Server side, i get the parameter, i execute the correct jpa query, and i return a DSResponse.
Now, i need to do the same with filter and Grid header (for sorting), i need this parameter in DSRequests. This parameter must always be sent when fetching, but his value is decided at runtime.
How can i set parameters at runtime for filtering operation?
Thank you,
Giervella
Comment