This content has been marked as final.
Show 3 replies
-
1. Re: how to do edit and new by using the same xhtml page
lazo Oct 19, 2010 4:05 AM (in response to tienlantri)I'm using similar approach to switch between edit and view mode on the same xhtml page.
Try adding
<param name="mode" />
in detailOperation.page.xml and then in detailOperation.xhtml get value with
#{mode}
-
2. Re: how to do edit and new by using the same xhtml page
cbensemann Oct 19, 2010 5:00 PM (in response to tienlantri)Generally if I have one page for edit and add of an entity such as operation i would use EL like #{operation.id == null} to check if this object has been persisted. If the id is null then the object is not yet saved so its an add. if its not null then we are editing an existing entity.
-
3. Re: how to do edit and new by using the same xhtml page
tienlantri Oct 20, 2010 3:03 AM (in response to tienlantri)In fact we don't need to declare
<param name=... />
inside the redirect in xml. We can get operation.id as Craig suggested. But we compare #{operation.id == 0} means it's a new object because when I redirect to newOp, I instantiate the object.
Thanks for your response!!!
Tina