You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kalpesh Modi <mo...@yahoo.com> on 2008/03/25 14:00:41 UTC
HashMap and updates
Hi,
I am having a problem in updates.
I have a base class Employee.java. I have subclasses HourlyEmployee.java, ContractEmployee.java, FullTimeEmployee.java.
I display these three types of employees under 3 tabs on my JSP.
I create 3 lists for each type of employees and put these lists in a HashMap with different keys.
Map employeeMap = new HashMap();
employeeMap.put ("HE", hourlyEmployeeList);
employeeMap.put ("CE", contractEmployeeList);
employeeMap.put ("FE", fullTimeEmployeeList);
I am able to display the list of employees properly. But when I change the values and submit the form, the new values dont show up in the action.
Can anyone help please.
Thanks.
---------------------------------
Never miss a thing. Make Yahoo your homepage.
Re: HashMap and updates
Posted by Laurie Harper <la...@holoweb.net>.
Kalpesh Modi wrote:
> Hi,
>
> I am having a problem in updates.
> I have a base class Employee.java. I have subclasses HourlyEmployee.java, ContractEmployee.java, FullTimeEmployee.java.
> I display these three types of employees under 3 tabs on my JSP.
> I create 3 lists for each type of employees and put these lists in a HashMap with different keys.
>
> Map employeeMap = new HashMap();
> employeeMap.put ("HE", hourlyEmployeeList);
> employeeMap.put ("CE", contractEmployeeList);
> employeeMap.put ("FE", fullTimeEmployeeList);
>
> I am able to display the list of employees properly. But when I change the values and submit the form, the new values dont show up in the action.
That's definately doable, so it's probably a simple tag usage error. You
don't include your code, so it's impossible to say where the problem is,
but I'd suggest you start by simplifying things down; start by making
sure you can edit a single employee; then get it working with a list of
employees; then with a list in a map. Along the way you'll probably
discover which asspect of your data addressing is incorrect.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org