You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gundersen, Richard" <Ri...@london-scottish.com> on 2006/12/04 13:00:24 UTC

Map backed properties

Hi

 

I've been happily working with map based properties in my forms for a
while now, but I've come across something that I really can't figure
out. 

 

I started off with a DynaValidatorForm, and in the mapping, I had this:

 

<form-property name="checklistItemNoteIds" type="java.util.HashMap"/>

 

I was able to use this nicely, by populating it in the action class, and
storing it as a hidden field in my JSP like so:

 

<html:hidden property="checklistItemNoteIds(${checklistItem.id})"/>

 

That results in a nice: <input type="hidden"
name="checklistItemNoteIds(120)" value="7">

 

But, I need to access the value of the property now to do some extra
processing, something along the lines of

 

<c:if test="${checklistItemNoteIds(120) == 7})">

            // do this

</c:if>

 

And it doesn't work. I've even made my own concrete ActionForm class
with these kinds of methods:

 

    public Object getChecklistItemNoteId(String key) {

        return checklistItemNoteIds.get(key);

    }

 

With no success. Has anyone got this working? 

 

Thanks

 

Richard


*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@London-Scottish.com as soon as possible and delete the message from all places in your computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication. 

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

RE: Map backed properties

Posted by "Strachan, Paul" <Pa...@det.nsw.edu.au>.
try something like:

<c:if test="${formname.map.checklistItemNoteIds[120] == 7}">
...
</c:if>


-----Original Message-----
From: Gundersen, Richard [mailto:Richard.Gundersen@london-scottish.com] 
Sent: Monday, 4 December 2006 11:00 PM
To: user@struts.apache.org
Subject: Map backed properties

Hi

 

I've been happily working with map based properties in my forms for a
while now, but I've come across something that I really can't figure
out. 

 

I started off with a DynaValidatorForm, and in the mapping, I had this:

 

<form-property name="checklistItemNoteIds" type="java.util.HashMap"/>

 

I was able to use this nicely, by populating it in the action class, and
storing it as a hidden field in my JSP like so:

 

<html:hidden property="checklistItemNoteIds(${checklistItem.id})"/>

 

That results in a nice: <input type="hidden"
name="checklistItemNoteIds(120)" value="7">

 

But, I need to access the value of the property now to do some extra
processing, something along the lines of

 

<c:if test="${checklistItemNoteIds(120) == 7})">

            // do this

</c:if>

 

And it doesn't work. I've even made my own concrete ActionForm class
with these kinds of methods:

 

    public Object getChecklistItemNoteId(String key) {

        return checklistItemNoteIds.get(key);

    }

 

With no success. Has anyone got this working? 

 

Thanks

 

Richard


*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use
of the addressee. It may contain private and confidential information.
The information, attachments and opinions contained in this E-mail are
those of its author only and do not necessarily represent those of
London Scottish Bank PLC or any other members of the London Scottish
Group. 

If you are not the intended addressee, you are prohibited from any
disclosure, distribution or further copying or use of this communication
or the information in it or taking any action in reliance on it. If you
have received this communication in error please notify the Information
Security Manager at ISM@London-Scottish.com as soon as possible and
delete the message from all places in your computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security
of electronic communications and you are advised to check any
attachments for viruses. We do not accept liability for any loss
resulting from any corruption or alteration of data or importation of
any virus as a result of receiving this electronic communication. 

Replies to this E-mail may be monitored for operational or business
reasons. London Scottish Bank PLC is regulated by the Financial Services
Authority.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

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