Friday 26 July 2013

How to get parameter map from http request in java.

How to get parameter map from httpServlet request in java.

public static Map<String, String> getRequestMap(HttpServlet request){
         Map<String, String> r = new HashMap<String, String>();
         for (Map.Entry<String, String[]> entry: request.getParameterMap().entrySet()){
           String[] value = entry.getValue();
           if (value !=null && value .length>0) r.put(entry.getKey(), value[0]);
         }
         return r;

       }

Thursday 18 July 2013

How to Handle grid selection model in accordion layout in collapsed mode.

How to Handle grid selection model in accordion layout in collapsed mode.

Problem:   I have three grid which  are within accordion layout. I have to select the record in gird which is collapsed mode first time view is loaded.



We are getting error as view is not available in  collapse mode.

Solution : we need to handle like below code. Need to add listener to grid to select the grid data after grid expanded first time.

Source Code:

    if (grid.collapsed !== true) {
         grid.getSelectionModel().select(recordArray, true, false);
    } else {
      grid.addListener('expand', function() {
         grid.getSelectionModel().select(recordArray, true, false);
         }, grid, {
             single: true
         });
    }