You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Craig Berry <Cr...@portblue.com> on 2003/07/16 21:54:06 UTC

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
 
 

RE: Setting html tag attribute value

Posted by Mike Jasnowski <mj...@bea.com>.
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