You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ajaya Agrawalla <AA...@strllc.com> on 2005/08/26 17:33:26 UTC

Configurable Forms Fields Authorization

Folks,

I am working on simple struts application and using formdef plugin.  I need
to have customizable way where I can control whether users are allowed to
fill in values for some fields.  This requirement varies depending on
installation. 

I am thinking of having a config file where we can specify whether a form
field is accesible or not and then display the fields accordingly in JSP.

Any thoughts??

AJ

Re: Configurable Forms Fields Authorization

Posted by Gareth Evans <ga...@msoft.co.uk>.
Hi,

I use a similar method to generate a form,
Use a xml file to define the form e.g.

<form>
  <group name="section1">
   <field property="value1" type="text" />
   <field property="value2" type="date" />
....

I then use a custom tag to parse the xml tag and set the form config within the page context for me 
to iterate through and display.

I've added options to display a date selector, or a select box based on either values defined in the 
  xml or on a collection within the request context.

I use the grouping function to wrap fieldsets around parts of the form just to split it up.

Another nice feature is to pull the label for a field directly from the message resources e.g 
"field.name.value1" or "group.name.section1".

This approach works well for me!

Regards,

Gareth

Ajaya Agrawalla wrote:

> Folks,
> 
> I am working on simple struts application and using formdef plugin.  I need
> to have customizable way where I can control whether users are allowed to
> fill in values for some fields.  This requirement varies depending on
> installation. 
> 
> I am thinking of having a config file where we can specify whether a form
> field is accesible or not and then display the fields accordingly in JSP.
> 
> Any thoughts??
> 
> AJ
> 

-- 
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

-- 
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.



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