How to create a dynamic(programatically) webgrid editable.
Hello Gautam,
Here is the code snippets for you:
...HtmlGridEditing editing = new HtmlGridEditing();MethodBinding mb= application.createMethodBinding("#{GridBean.cellValueChange}", new Class[]{CellValueChangeEvent.class});editing.setCellValueChangeListener(mb); grid.getTemplateItemsBehaviors().getFacets().put(GridView.FACET_GRID_EDITING, editing);....public void cellValueChange(CellValueChangeEvent evt){ System.out.println("Vlaue Has been Changes");}
Hope it helps you.
Roshan
Hello Goutam, I came across some issue while method binding for cellValueChangeListener. However, we are working on the same and shall provide solution soon.
Thank you for your patience!
Swetha
Can some one provide me some lines of code to define the
CellValueChangeListener dynamically? I am looking for sample code snipplet.
Yes it is , I was following the same steps defined by you.
Can you please provide me the syntax for the same?
I got stuck there.
Its simple...
You need to create the instance of HtmlGridEditing and use the methodbinding expression for this where you declear the event handler name. After creating this HtmlGridEditing object, you add this object to the template behavior as the Swetha suggested..