I figured the solution would be a lot like in my previous post: using the generated URL. I again switched back to the default list view, and copied the URL for the 'Edit' action. Stripping it down, this is the result:
/your_page?p_p_id=169_INSTANCE_ToH96dipcgdr&struts_action=%2Fdynamic_data_list_display%2Fedit_record&cmd=update&redirect=%2Fyour_page&recordId=$record.getRecordId()Notice the p_p_id is copied from the URL (you can also get it from the $request), while the record id is dynamically fetched from the resultset's current record. Another important parameter is redirect. Provide it with the URL of the page you're going to display your list on. It will make sure the user will return to that page after saving or canceling the edit action. If you forget this, the user is stuck on the edit page.
How can i get the p_p_id from the $request?
ReplyDeleteThank you
Hi,
DeleteI believe you can do
$request.getAttribute("PORTLET_ID");
I can't test this at the moment, though, so please let me know if it works!
I found a solution with Velocity:
Delete#set($portletid = $request.get("attributes").get('PORTLET_ID'))
Do you know how I can add the delete button?
thanks for your answer :-)