This doesn't answer anything Taglib specific but it may give you an idea of
"... how to make
something that *looks* like a text-box (with CSS?)".



<style type="text/css">
<!--
.readOnlyformField { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 7pt; color: #000000; border-color: #666666 #CCCCCC #CCCCCC
#666666; border-style: solid; border-top-width: 2px; border-right-width:
1px; border-bottom-width: 1px; border-left-width: 2px}
-->
</style>

...

<html:form action="/Action.do">
<table border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td class="readOnlyformField">
      <bean:write name="Form" property="name"/>
      <html:hidden name="Form" property="name"/>
    </td>
  </tr>
</table>

...

</html:form>


You will notice the I am using Struts also.

Be aware the this displays a value on the page and puts it into a box that
looks like an html input of type text or <input type="text"... >. The hidden
field is used to make the value available in the request when the html form
is submitted.

I've only tested this technique in IE 5.x, but to that point the use of the
readonly attribute in a text field is also an IE only technique. You may
want to check out the disabled attribute as well. An important difference
between a disabled text field and a readonly text field is that the disabled
one is not placed in the request.

Also, the CSS style resembles a standard Windows text field. So if the user
changes there desktop appearance, or is on a Mac or some browser other than
IE, this field may no longer look like the other fields on the page.

-----Original Message-----
From: Wendy Smoak [mailto:Wendy.Smoak@;asu.edu]
Sent: Friday, October 18, 2002 7:56 PM
To: 'Tag Libraries Users List'
Subject: RE: JSTL for Maps?


> Section A.3.4 of the specification talks about using the "[]" operator to
> access maps.  From this, you can see that your EL expression would be
> "${preferredNames[staffMember]}".  If you're using Struts-EL, you can just
> use that as your "value" value on your "html-el:text" element.

I can't use the html-el tag for this, because then Struts wants to
pre-populate the text box and will complain that there are no
getJunk/getJunk methods in my ActionForm.  If I could figure out how to make
something that *looks* like a text-box (with CSS?), I'd do that instead.
But lacking that knowledge, a read-only text box is what I'm using.

Thanks for the syntax help.  Looks like I need the c:out tag:

<input type="text" name="junk" readonly="readonly" size="50" 
      value="<c:out value="${preferredNames[staffMember]}"/>"/>

(This is starting to look like Perl!)

-- 
Wendy Smoak 
http://sourceforge.net/projects/unidbtags 

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to