Hi Joseph,

using Scriptlets you might (setting all rows with type='rotype' to readonly):

1) <db:body>
     <% String isReadOnly = 
      "rotype".equalsIgnoreCase(currentRow_system_attributes_vw.get("type")) ?
        "true" : "false"; %>
   ...
     <db:textField fieldName="f1" readOnly="<%= isReadOnly %>"
           styleClass=".." readOnlyStyleClass="..." />
   ...

   But be aware thar the readonly implementation of textFields within 
   dbforms uses JavaScript, those who have JS deactivated might be able 
   to edit the field!

   So you could consider to:

2) <db:body>
     <% boolean isReadOnly = 
      "rotype".equalsignoreCase(currentRow_system_attributes_vw.get("type")) ; %>
   ...
   <% if (isReadOnly) { %>
     ...<db:dataLabel ieldName="f1"../> ...
   <%} else { %>
     ...<db:textField fieldName="f1" .../>...
   <% } %>

You surely can use other taglibs (e.g. jstl) to replace the scriptlets
by tags, but that does not make a real difference. 

Regards

Dirk


Joseph Prosser wrote:
> 
> Hey Folks,
> I'm displaying an attribute-value table for an asset
> tracking system I'm building.
> 
> Some of the rows are read-only and some are editable.
> This information is stored in another field in the
> table. (i.e.
> currentRow_system_attributes_vw.get("type"))
> 
> I'm new to JSP (if it isn't obvious already,) and
> found this tool to be easy and fun to get something
> substantial up and running with in very little time.
> 
> I understand that this "logic" shouldn't really be a
> part of the jsp, but I can't figure out how to express
> this within the dbForms framework.  I can evaluate
> this using a scriptlet, but it get's messy.  There
> doesn't seem to be a way to access it using
> struts-logic either.
> 
> Is there a better way?
> 
> Thanks!
> -Joe Prosser


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to