struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Kongala <>
Subject Re: Issue with Struts2 s:select tag with Object inside a Model Object
Date Mon, 03 Apr 2017 14:04:45 GMT
Hi Lukasz,

Thank you for helping. I am new to Struts2. What are the other attributes I
need to use if not listkey and listvalue.
In my example, I defined the select as below with name as
diagnosisDTO.primaryDiagnosis and list as primaryDiagnosisTypes which is an
object which has dstLookupTypeID as key and lookupValue as the value.
I am thinking the listkey is compared with the value pointed by the name
For eg: If I have the diagnosistypes list has an object with key as '536'
and the value as 'Chronic Hepatitis B' and if I get the '536' from the
service in action and if I assign that value to 'diagnosisDTO.primaryDiagnosis'
name in the action model, I thought it will pick that value as selected. If
I remove the listKey and list Value from the s:select tag, I am getting the
complete object in the drop down as below. Please correct me if I am wrong.





*Thanks[image: Inline image 1]*

On Mon, Apr 3, 2017 at 6:44 AM, Lukasz Lenart <>

> 2017-04-02 22:58 GMT+02:00 Kiran Kongala <>:
> > Hi Lulasz,
> >
> >
> > *I am not comparing the same objects.I am trying to compare the String to
> > a constant String.Still do I need to override the equals and hashCode
> > methods.*
> >
> > *I added a <s:debug/> tag in the jsp and I see the values.But the value
> > doesnt set the value back to the s:select drop down list.*
> >
> If you are comparing Strings why do use listKey and listValue? These
> attributes are used to fetch an object's property and compare it with value
> pointed by the "name" attribute.
> Regards
> --
> Ɓukasz
> + 48 606 323 122

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message