struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <Gin.C...@NielsenMedia.com>
Subject RE: Setting html tag attribute value
Date Wed, 16 Jul 2003 20:12:16 GMT
Or:
<c:out escapeXml="false" value="<div
style='visibility:${editDeForm.initialPrecVisiblity}'>"/>

Or: (better suited for a boolean)
<c:choose>
   <c:when test="${editDeForm.initialPrecVisiblity == 'hidden'}>
	<div style="visibility:hidden">
   </c:when>
   <c:otherwise>
	<div style="visibility:blah">
   </c:otherwise>
</c:choose>

BTW: JSP 2.0 will support ${blah} notation outside of the JSTL taglib so
even if it looks ugly and awkward right now. It is just temporary :)
-Tim


-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Wednesday, July 16, 2003 4:02 PM
To: Struts Users Mailing List
Subject: RE: Setting html tag attribute value


What happens if you do something like this:

<div style="visibility: <c:out
value='${editDeForm.initialPrecVisiblity}'/>"/>

-----Original Message-----
From: Craig Berry [mailto:Craig.Berry@portblue.com]
Sent: Wednesday, July 16, 2003 3:54 PM
To: struts-user@jakarta.apache.org
Subject: Setting html tag attribute value


On a jsp page, I need to set the visibility of a div element based on
the value of a form attribute.  The div is inside an <html:form> element
for the form in question (editDeForm).  The fragment should look
something like:

<div style="visibility: ${editDeForm.initialPrecVisibility}"    ...>

but JSTL EL attribute tags don't work in non-JSTL tags.  I could go to
the trouble of doing a jsp:bean to grab the form bean, then call the
getter method explicitly to get the value, all inside <% %> in the attr
value, but that strikes me as being far clumsier than it should be using
the JSTL/Struts combo.  So, can someone please point me in the right
direction to handle this?

--
Craig Berry
x7546




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message