>From: Costa Basil <[EMAIL PROTECTED]>
>Yes, I think your approach is good. But unfortunatelly, if I do this the table row >events (the clicks on commandLink links stored in the table) are not fired >because the table is not populated at that time (apply request values) and in the >end I have to use other methods to simulate the row clicks.
>
>I think the issue is that there seems to be no way to tell if is this is a real
>Yes, I think your approach is good. But unfortunatelly, if I do this the table row >events (the clicks on commandLink links stored in the table) are not fired >because the table is not populated at that time (apply request values) and in the >end I have to use other methods to simulate the row clicks.
>
>I think the issue is that there seems to be no way to tell if is this is a real
>postback (to the same page) or a postback to navigate somewhere else. Shale
>reports isPostBack=true in both cases.
>
>
In JSF, you will always post back to the same page (view) that rendered the page. The command in the view that was invoked determines where to navigate to. The command is found in the component tree that builds the page.
The ViewController's "prerender" callback method is invoked before the page is rendered. The "prerender" is invoked before the rendering of each component.
When you click on a datatable row commandLink, the view controller "preprocess" callback will be invoked and then the action bound to the command link. This is where you deleted the row and now need to refresh the datatable but you don't have to do that here because the next view controller post back event will be "prerender".
If you are navigating to the same page, the "prerender" will be invoked and a fresh result set loaded.
If you are not seeing the "prerender" invoked after the commandLink on the row, you probabaly don't have a navigation rule back to the same page. This could be why you are not seeing the updated data. The component tree is rendererd with the old state.
Make sure you have a navigation rule back to the resultset page for the delete commandLink.
<navigation-case>
<from-action>#{viewController.delete}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/deleteRset.jsp</to-view-id>
</navigation-case>
<from-action>#{viewController.delete}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/deleteRset.jsp</to-view-id>
</navigation-case>
Gary

