ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Unable to refresh grid

Tarang
7 Sep 2010 12:51:16 GMT
7 Sep 2010 12:51:16 GMT

Hi,
Please help me, I am very new to zk , I explained the my requirement as pseudo code:

public class Sample() implemnts EventListener{

Grid grid = new Grid();
public Sample(){
// sets the paging

loadGrid();
}
public void loadGrid(){
// creates the instance for the column
// sets the labels to the columns
// creates the row instance
// sets the record to the rows , data from DB by query


// here I am registring event for row as:
// rows.addEventListener(Events.ON_CLICK,this);

// some code.....................

}
public void onEvent(Event e){
if(e.getName().equals("ON_CLICK")){

// Here code is to open the window related to the row (i.e. record)
// of the grid ob which the user clicks
// after opening the window the control backs to grid i.e. just to open the window.


// HERE IS ACTUAL PROBLEM
/***********************************************************
* on the window I am doing some operation and after closing that wondow
* my grid should be automatically refresh for new data.
*/

}
}

I tried following things:
1. ON_FOCUS event listner but when I move the mouse over grid, no event is triggred.
2. invalidate()
3. renderall() 2 & 3 I tried as per my knowledge it is not working
if any one can tell how the renderall and invalidate works with sample code.

Please help , I am very new to zk.

Thank you,
TARANG

terrytornadoTop Contributor
7 Sep 2010 15:01:02 GMT
7 Sep 2010 15:01:02 GMT

// HERE IS ACTUAL PROBLEM
/***********************************************************
* on the window I am doing some operation and after closing that wondow 
* my grid should be automatically refresh for new data.
*/

}

you must actualize your grid model new from db.

Tarang
7 Sep 2010 23:59:52 GMT
7 Sep 2010 23:59:52 GMT

Thanks for your response Terry.

Could you please elaborate "actualize your grid model"?

terrytornadoTop Contributor
9 Sep 2010 04:42:13 GMT
9 Sep 2010 04:42:13 GMT

You have it in your own code.

  . . .
  // sets the record to the rows , data from DB by query
  . . .

recall the DB query.

The model is the engine. The grid is only for showing what the engine brings to it.

best
Stephan