Any support for View/Edit mode of a page
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Buuck
Posted On:   Tuesday, January 22, 2002 02:18 PM

At times, it seems necessary to provide a view-only page that presents all the same information as an input form. It seems that the Struts HTML tags could be extended in some way to facilitate providing both the edit (Input form) and View (display only) presentations in a single JSP and thereby avoid duplicating so much of the same content. Has there been any discussion of that in the Struts initiative?

Re: Any support for View/Edit mode of a page

Posted By:   Ted_Husted  
Posted On:   Thursday, January 24, 2002 01:51 AM

One approach would be to set a property and then
key on that with the logic:present / logic:notPresent tags.
Though, it is often cleaner to just have two pages, and
then select one or the other at the controller level. The
chrome surrounding a form can be shared using the
Struts template tags or

Tiles
.



If you were thinking of a tag that would either do the
equivalent of bean:write or html:text, it probably
won't show up in the taglibs distributed with Struts.
Though, there is an active extension community,
including packages like

struts-layout

which does similar things. I could see an "readonly"
property being added to their field tag, where you
could specify a property in the form bean that
returned true or falses.



I agree that taglibs like layouts are useful, but right
now the Struts team is waiting for the JSTL to finalize,
and looking forward to other technologies like
JavaServer Faces.



HTH -Ted

About | Sitemap | Contact