Map<String,String> params = context.getExternalContext().getRequestParameterMap();
String eventName = params.get(Constants.PARTIAL_BEHAVIOR_EVENT_PARAM);
String clientId = this.getClientId(context);
FacesEvent wrapperEvent = null;
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
if(eventName.equals("rowSelect")) {
String rowKey = params.get(clientId + "_instantSelectedRowKey");
wrapperEvent = new SelectEvent(this, behaviorEvent.getBehavior(), this.getRowData(rowKey));
wrapperEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
else if(eventName.equals("rowUnselect")) {
String rowKey = params.get(clientId + "_instantUnselectedRowKey");
wrapperEvent = new UnselectEvent(this, behaviorEvent.getBehavior(), this.getRowData(rowKey));
wrapperEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
else if(eventName.equals("page")) {
wrapperEvent = new PageEvent(this, behaviorEvent.getBehavior(), this.getPage());
wrapperEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
else if(eventName.equals("sort")) {
boolean asc = Boolean.valueOf(params.get(clientId + "_sortDir"));
Column sortColumn = findColumn(params.get(clientId + "_sortKey"));
wrapperEvent = new SortEvent(this, behaviorEvent.getBehavior(), sortColumn, asc);
wrapperEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
else if(eventName.equals("filter")) {
wrapperEvent = event;
wrapperEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
else if(eventName.equals("rowEdit")) {
int editedRowIndex = Integer.parseInt(params.get(clientId + "_editedRowIndex"));
setRowIndex(editedRowIndex);
wrapperEvent = new RowEditEvent(this, behaviorEvent.getBehavior(), this.getRowData());
}
else if(eventName.equals("colResize")) {
String columnId = params.get(clientId + "_columnId");
int width = Integer.parseInt(params.get(clientId + "_width"));
int height = Integer.parseInt(params.get(clientId + "_height"));
wrapperEvent = new ColumnResizeEvent(this, behaviorEvent.getBehavior(), width, height, findColumn(columnId));
}
super.queueEvent(wrapperEvent);
}
else {