You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
When you try to open an object which is a member of a datatable then you can only reference the object via JavaScript. Using the event onRowDblClick you can change the url of the current page to the selected objects webpage. But if you try to use the url MyPage.xhtml then you get an access denied error from Seam. Therefore you have to use the following syntax:
<rich:dataTable
id="myDataTable" var="myObject"
value="#{myEntityQuery.resultList}"
rendered="#{not empty myEntityQuery.resultList}"
onRowDblClick="location.href='/MyPage.seam?
myObjectId=#{myObject.id}';"
rowKeyVar="rowNum">
...
</rich:dataTable>
The page MyPage.xhtml is a webpage like the pages generated by seam-gen where you pass an object id as JSF parameter when opening the page. In this example the parameter is named myObjectId. The value which is passed here is the id of the myObject instance of the object displayed in the row where the doubleclick is done.
Interesting - One technique I have been trying to figure out with seam/richfaces related to this is master-detail using richfaces subtable with seam. Say you had a list of email subjects as the main table and emails as a subtable. When you first render the table you only want to retrieve email subjects - when a user clicks on a subject you want to retrieve the data and populate and rerender the subtable.
This appears complicated to me for a few reasons - yet it would seem like a very common thing to want to do. Does anyone have an example?
Thanks
You can do this:
RequestParameter String param;
on your datamodel you put this
<s:link action="{action.method}"> <f:param value="{var.id}" id="param"/> </s:link>and on your method you iterate on your list to find row if equals param value;
regards,
Thomas.