-
1. Re: Context menu in rich:datatable
robertocarlos1 Jan 16, 2008 10:49 AM (in response to sansaric)I think this demo can be useful for you.
http://livedemo.exadel.com/richfaces-demo/richfaces/contextMenu.jsf;jsessionid=51443942667788B0B925B6C45EE0AEC5?c=contextMenu -
2. Re: Context menu in rich:datatable
sansaric Jan 16, 2008 11:33 AM (in response to sansaric)Thanks for suggesting the demo. I actually played with the demo source code before posting the question and tried to implement the functionality I described in the original message, however, after selecting a menu item from a selected table row, I was not able to successfully retrieve the row object using DataModel.getRowData in the menu handling method.
Any suggestions ? -
3. Re: Context menu in rich:datatable
robertocarlos1 Jan 16, 2008 11:45 AM (in response to sansaric)are you using <rich:dataTable> tag?
What is the type of myJobsDataModel? -
4. Re: Context menu in rich:datatable
sansaric Jan 16, 2008 12:13 PM (in response to sansaric)Yes, I switched from <h:dataTable> to <rich:dataTable> tag and reused the code in the demo with some modifications.
myJobsDataModel is of type DataModel
thanks again,
Marcel -
5. Re: Context menu in rich:datatable
robertocarlos1 Jan 16, 2008 12:27 PM (in response to sansaric)can you add binding property to datatable, define a field in the bean of Type org.richfaces.component.html.HtmlDataTable create the get and set methods and use this field to take the row data?.
Something like that<rich:dataTable binding="#{myHandler.myTable}" ....> .......... <rich:dataTable>
add this to your beanprivate org.richfaces.component.html.HtmlDataTable myTable = new org.richfaces.component.html.HtmlDataTable() public org.richfaces.component.html.HtmlDataTable getMyTable(){ this.myTable; } public void setMyTable(org.richfaces.component.html.HtmlDataTable myTable){ this.myTable = myTable; } // change your action to. public String handleMyCurrentJob() throws Exception { myCurrentJob = (JobBean) myTable.getRowData(); ........ }
this is the way that I'm getting the row data and it is working fine for me. -
6. Re: Context menu in rich:datatable
sansaric Jan 16, 2008 12:39 PM (in response to sansaric)Looks good. I will give it a shot.
Thanks