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
attribute.
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.

name=*"diagnosisDTO.primaryDiagnosis"*

list=*"primaryDiagnosisTypes"*

listKey=*"dstLookupTypeId"*

listValue=*"lookupValue"*





*Thanks[image: Inline image 1]*


On Mon, Apr 3, 2017 at 6:44 AM, Lukasz Lenart <lukaszlen...@apache.org>
wrote:

> 2017-04-02 22:58 GMT+02:00 Kiran Kongala <kirankongal...@gmail.com>:
>
> > 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 http://www.lenart.org.pl/
>

Reply via email to