Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2A9D6200C4A for ; Sun, 2 Apr 2017 22:58:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 291E9160B8E; Sun, 2 Apr 2017 20:58:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A2999160B79 for ; Sun, 2 Apr 2017 22:58:24 +0200 (CEST) Received: (qmail 25898 invoked by uid 500); 2 Apr 2017 20:58:18 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 25886 invoked by uid 99); 2 Apr 2017 20:58:18 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Apr 2017 20:58:18 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B6D1EC12BD for ; Sun, 2 Apr 2017 20:58:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.129 X-Spam-Level: ** X-Spam-Status: No, score=2.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id o6I4sRgyNesG for ; Sun, 2 Apr 2017 20:58:15 +0000 (UTC) Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 0F1865F659 for ; Sun, 2 Apr 2017 20:58:14 +0000 (UTC) Received: by mail-vk0-f45.google.com with SMTP id r69so119688805vke.2 for ; Sun, 02 Apr 2017 13:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=PLJrCSwCEAjiekAdmRfuwvjxKHNC3Q2rcjgwYtvhL4Y=; b=NdFj7JjmnB36p7nNPzGlahRdA4SJgnuEeM9p6F7Ld/kRtrevtYGamMPDm9YNoBz8A3 etLSfYlpXOLC0HHANtSFBP9cfeujENBixdGLnV1bdSQJK6w0ji9N6+TIbcsuEIWDeynq tZKjU3p7b3hG50nKWq6DdM9rAXKRFcMW5ndgwv/JLiUX1O349udfFI+fzoD20P3RBPA/ ZUh47qkdkYQrNwW2jCvU3hwRv8shWW+KLY1NpJAghuKGC5nbhXT2zAiYpSa8/i+AYt1P 1qDRGWIf9riyoinJrLcfSJiejdoEN/RwPVGPd4neg5unrdliUYn9ykPGvfrV6tI3KIx7 WIlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=PLJrCSwCEAjiekAdmRfuwvjxKHNC3Q2rcjgwYtvhL4Y=; b=jqvea2PWF7lz4ylJs+2M2bbjkDEDqwJkNz4qRwLiZPHcP+bEy2kmOqN6kYeRRi2mDF 8nj3sV/a2csivlbKir6JyIuA6shD6/C5GyqLkZoNo3qhgtcjplq2rtBBGAXewpoE/6cq UzX530yicXoHiCvLtxB/wPIexFZSwcT9hcNhfjF9qtbB2qM+a6no1C03+nU5R6Bnsob/ HQebsDCyGrjLTP+YA7l7h0YnxLpC4sw/QLEvOZlhHy8oCYxRbZ7cP63hFdySeZxrYnGX ijzBTgxaquOH1SevJBtSdjECHi92eINJDPlZujN0F8iVdqBwXDA+LTuEP/8SLl42r9ku V9lA== X-Gm-Message-State: AFeK/H3uFyGJUv45u+k2xdDNXCNlj9RwPcUE/QgY2gVN7RNNlLhP/s4FmB8DZcEbhZIhfmJKhNmRoD2wzw5mMA== X-Received: by 10.159.53.98 with SMTP id o89mr5768134uao.113.1491166692676; Sun, 02 Apr 2017 13:58:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.37.40 with HTTP; Sun, 2 Apr 2017 13:58:11 -0700 (PDT) In-Reply-To: <3a92a99f-235e-4c14-a77d-7c877343d775@email.android.com> References: <3a92a99f-235e-4c14-a77d-7c877343d775@email.android.com> From: Kiran Kongala Date: Sun, 2 Apr 2017 16:58:11 -0400 Message-ID: Subject: Re: Issue with Struts2 s:select tag with Object inside a Model Object To: Struts Users Mailing List Content-Type: multipart/related; boundary=94eb2c03ff6004f36e054c354d3b archived-at: Sun, 02 Apr 2017 20:58:26 -0000 --94eb2c03ff6004f36e054c354d3b Content-Type: multipart/alternative; boundary=94eb2c03ff6004f36c054c354d3a --94eb2c03ff6004f36c054c354d3a Content-Type: text/plain; charset=UTF-8 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 tag in the jsp and I see the values.But the value doesnt set the value back to the s:select drop down list.* *The below are the three classes being used in the code other than the Model(DiseaseTracking)* *From the Service class, I have the list of DSTLookupDTO objects with dstLookupId as the int value.* *I loop through the list and if a string value matches a constant string value, I add the dstLookupId value to the primaryDiagnosis property of the DiagnosisDTO object and I set that object to the DiseaseTracking model object. I have similar conditions for other properties.* public class DSTLookupDTO implements Serializable { private int dstLookupId; public DSTLookupDTO() { } //Has proper setter and getter methods for the properties } public class DiagnosisDTO implements Serializable { private int primaryDiagnosis; //Has proper setter and getter methods for the properties } public class DstLookupType implements DataValidation, Cloneable,Serializable { private String dstLookupTypeId = ""; private String lookupValue = ""; //Has proper setter and getter methods for the properties } public void convertDiagnosisListToDiagnosisDTO(List alDstLookup) throws CpsEntException { DiagnosisDTO dt = null; try { if(alDstLookup != null && alDstLookup.size() != 0) { dt = new DiagnosisDTO(); for (final DSTLookupDTO dstLookup : alDstLookup) { String grpCodeId = dstLookup.getDstLookupGrpCodeId(); if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_PRD)) { dt.setPdDstLookupId(dstLookup.getDstLookupId()); dt.setPrimaryDiagnosis(dstLookup.getDstLookupTypeId()); dt.setPdDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); dt.setOtherPrimaryDiagnosis(dstLookup.getOtherValue()); } else if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_GNT)) { dt.setGenoTypeDstLookupId(dstLookup.getDstLookupId()); dt.setGenoType(dstLookup.getDstLookupTypeId()); dt.setGenoTypeDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); dt.setOtherGenoType(dstLookup.getOtherValue()); } else if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_GNT2)) { dt.setGenoType2DstLookupId(dstLookup.getDstLookupId()); dt.setGenoType2(dstLookup.getDstLookupTypeId()); dt.setGenoType2DstSubModuleRowId(dstLookup.getDstSubModuleRowId()); dt.setOtherGenoType2(dstLookup.getOtherValue()); } else if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_HVC)) { dt.setHivDstLookupId(dstLookup.getDstLookupId()); dt.setHivCoinfection(dstLookup.getDstLookupTypeId()); dt.setHivDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); } else if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_GRP_CODE_ID_RNI)) { dt.setRenalDstLookupId(dstLookup.getDstLookupId()); dt.setRenalImpairment(dstLookup.getDstLookupTypeId()); dt.setRenalDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); dt.setOtherRenalImpairment(dstLookup.getOtherValue()); } else if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_SPLT)) { dt.setPostLiverDstLookupId(dstLookup.getDstLookupId()); dt.setPostLiverTransplant(dstLookup.getDstLookupTypeId()); dt.setPostLiverDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); } } } } catch (Exception e) { e.printStackTrace(); throw new CpsEntException(e.getMessage()); } diseasetracking.setDiagnosisDTO(dt); } public String getHepC() throws Exception { setAllLookups(); DiseaseTrackingDelegate dstDelegate = new DiseaseTrackingDelegate(); int dstId = 20000048; diseasetracking = dstDelegate.getDSTById(user.getCurrentClientId(), dstId, null); convertDiagnosisListToDiagnosisDTO(diseasetracking.getAlDstLookup()); System.out.println("diseasetracking: "+diseasetracking); System.out.println("diseasetracking DiagnosisDTO.PrimaryDiagnosis: "+diseasetracking.getDiagnosisDTO().getPrimaryDiagnosis()); return "success"; } I don't know even if the value of the select drop down matches (536), the option is not selected. Below is the debug information of value stack. [image: Inline image 1] Thanks On Sun, Apr 2, 2017 at 2:31 PM, Paul Zepernick < Paul.Zepernick@healthsmart.com> wrote: > I notice that you are using the # notation to access the property. Does > it work without it? It seems like something is not available on the > action. You could add value="#diagnosisDTO.primaryDiagnosis" to your > select and it will pull from the value stack just like the property did > instead of searching your action, but your setup should work. I believe > there is just some other information we are missing as to why it is not > functioning. > > On Apr 1, 2017 11:56 PM, Kiran Kongala wrote: > Hi, > > Before calling the return "success" in the action method I added couple of > println statements and I am seeing the data for the dropdown > and below are the values > > diseasetracking: DiseaseTracking: dstId = 20000048 > DstCodeId = HPC > paID = 2 > memberID = 100 > memberIdentTypeID = 1 > memberAddressID = 2 > memberPhonePhoneID = 3 > memberFaxPhoneID = 4 > prescriberID = 100 > prescriberIdentTypeID = 1 > prescriberAddressID = 2 > prescriberPhonePhoneID = 3 > prescriberFaxPhoneID = 4 > mdSpecialtyTypeID = 1 > comments = null > startDate = 2017-03-31T00:20:13.729339 > endDate = 9999-12-30T19:00 > createdBy = 0 > diagnosisDTO = DiagnosisDTO: primaryDiagnosis = 536 > otherPrimaryDiagnosis = null > genoType = 541 > otherGenoType = null > genoType2 = 675 > otherGenoType2 = null > hivCoinfection = 551 > renalImpairment = 555 > otherRenalImpairment = null > postLiverTransplant = 559 > > diseasetracking DiagnosisDTO.PrimaryDiagnosis: 536 > > And I added this property value="#diagnosisDTO.primaryDiagnosis"/> > > but the value is not selected in the select tag. > > And when I view the source, I am seeing the below source of the jsp > > > Everything looks correct but I am not seeing the value selected in the drop > down(536). > > Thanks > > > > > > On Sat, Apr 1, 2017 at 10:31 PM, Paul Zepernick < > Paul.Zepernick@healthsmart.com> wrote: > > > What happens when you use a s:property to evaluate > > diagnosisDTO.primaryDiagnosis? If you do not get a value, then check to > > make sure the path is right or that something is not wrong in your action > > that is populating it. Also verify that the key property in your list is > > the same type as the value being set, both Integer for example. > > > > On Apr 1, 2017 7:38 PM, Kiran Kongala wrote: > > Hi, > > > > I am trying to use the Struts2 s:select tag but the drop down value > coming > > from the db is not being set to the drop down as selected value and the > > screen always shows the default first value in the list. > > > > Can some one please help me. > > > > *JSP Code* > > > > > list="primaryDiagnosisTypes" > > listKey="dstLookupTypeId" > > listValue="lookupValue" > > multiple="false" > > headerKey="-1" > > headerValue="Please Select" > > size="1"/> > > > > *Action Class Code* > > > > > > *I have Disease Tracking as a Model object and inside that model I have > > DiagnosisDTO object where I have properties which are matched to the jsp > > select tag above* > > > > > > > > > > *This is the Model Object defined in the Action Class public > > DiseaseTracking getModel() { return this.diseasetracking; }* > > > > *DiseaseTracking Object with DiagnosisDTO property below * > > > > > > > > > > > > > > > > > > *private DiagnosisDTO diagnosisDTO; public DiagnosisDTO getDiagnosisDTO() > > { return diagnosisDTO; } public void setDiagnosisDTO(DiagnosisDTO > > diagnosisDTO) { this.diagnosisDTO = diagnosisDTO; }* > > > > > > *DiagnosisDTO Object with property **primaryDiagnosis **and getter and > > setter* > > > > > > > > > > * private int primaryDiagnosis; public int getPrimaryDiagnosis() { > return > > primaryDiagnosis; }* > > > > > > > > > > * public void setPrimaryDiagnosis(int primaryDiagnosis) > > { this.primaryDiagnosis = primaryDiagnosis; }* > > > > > > *This method is a service call to get the disease tracking object* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > * public String getHepC() throws Exception { List allDstLookupTypes = > > GenCache.getListOfDstLookupType(user.getCurrentClientId()); > > setPrimaryDiagnosisTypes(this.getSpecificDstLookupTypes( > > Constants.DST_LOOKUP_GRP_CODE_ID_PRD, > > allDstLookupTypes)); DiseaseTrackingDelegate dstDelegate = new > > DiseaseTrackingDelegate(); int dstId = 20000048; //The below is the > > service call to db which will get the disease tracking object with some > > lists objects. diseasetracking = > > dstDelegate.getDSTById(user.getCurrentClientId(), dstId, null); //the > > below is the code to convert the list returned from service to another > > object Diagnosis DTO and set that back to Disease Tracking model > > object convertDiagnosisListToDiagnosisDTO(diseasetracking. > > getAlDstLookup()); > > return > > "success"; } public List getSpecificDstLookupTypes(String > > grpLookupTypeId, List > > allDstLookupTypes){ List lookupTypes = new > > ArrayList(); for(int i=0; i < > > allDstLookupTypes.size();i++) { if( > > allDstLookupTypes.get(i).getDstLookupGrpCodeId(). > equals(grpLookupTypeId)){ > > lookupTypes.add(allDstLookupTypes.get(i)); } } return > > lookupTypes;}* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > * public void convertDiagnosisListToDiagnosisDTO(List > > alDstLookup) throws CpsEntException { DiagnosisDTO dt = null; > > try { if(alDstLookup != null && alDstLookup.size() != 0) > > { dt = new DiagnosisDTO(); for (final DSTLookupDTO > > dstLookup : alDstLookup) { > > if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_ > > GRP_CODE_ID_PRD)) > > { dt.setPdDstLookupId(dstLookup.getDstLookupId()); > > //dt.setPrimaryDiagnosis(dstLookup.getDstLookupTypeId()); > > diseasetracking.setPrimaryDiagnosis(dstLookup.getDstLookupTypeId()); > > dt.setPdDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); > > dt.setOtherPrimaryDiagnosis(dstLookup.getOtherValue()); > > } else > > if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_ > > GRP_CODE_ID_GNT)) > > { > > dt.setGenoTypeDstLookupId(dstLookup.getDstLookupId()); > > dt.setGenoType(dstLookup.getDstLookupTypeId()); > > dt.setGenoTypeDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); > > dt.setOtherGenoType(dstLookup.getOtherValue()); } > > else > > if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_ > > GRP_CODE_ID_GNT2)) > > { > > dt.setGenoType2DstLookupId(dstLookup.getDstLookupId()); > > dt.setGenoType2(dstLookup.getDstLookupTypeId()); > > dt.setGenoType2DstSubModuleRowId(dstLookup.getDstSubModuleRowId()); > > dt.setOtherGenoType2(dstLookup.getOtherValue()); } > > else > > if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_ > > GRP_CODE_ID_HVC)) > > { dt.setHivDstLookupId(dstLookup.getDstLookupId()); > > dt.setHivCoinfection(dstLookup.getDstLookupTypeId()); > > dt.setHivDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); > > } else > > if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_ > > GRP_CODE_ID_RNI)) > > { dt.setRenalDstLookupId(dstLookup.getDstLookupId()); > > dt.setRenalImpairment(dstLookup.getDstLookupTypeId()); > > dt.setRenalDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); > > dt.setOtherRenalImpairment(dstLookup.getOtherValue()); > > } else > > if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LOOKUP_ > > GRP_CODE_ID_SPLT)) > > { > > dt.setPostLiverDstLookupId(dstLookup.getDstLookupId()); > > dt.setPostLiverTransplant(dstLookup.getDstLookupTypeId()); > > dt.setPostLiverDstSubModuleRowId(dstLookup.getDstSubModuleRowId()); > > } } } } catch (Exception e) { > > e.printStackTrace(); throw new > > CpsEntException(e.getMessage()); } > > diseasetracking.setDiagnosisDTO(dt); } * > > > > Thanks > > > > > > > > > > Disclaimer: This communication and any files transmitted with it may > > contain information that is privileged, confidential and/or exempt from > > disclosure under applicable law. If you are not the intended recipient, > you > > are hereby notified that any disclosure, copying, distribution, or use of > > the information contained herein (including any reliance thereon) is > > strictly prohibited. If you received this communication in error, please > > immediately contact the sender and destroy the material in its entirety, > > whether in electronic or hard copy format. Thank you. > > > > > > > Disclaimer: This communication and any files transmitted with it may > contain information that is privileged, confidential and/or exempt from > disclosure under applicable law. If you are not the intended recipient, you > are hereby notified that any disclosure, copying, distribution, or use of > the information contained herein (including any reliance thereon) is > strictly prohibited. If you received this communication in error, please > immediately contact the sender and destroy the material in its entirety, > whether in electronic or hard copy format. Thank you. > --94eb2c03ff6004f36c054c354d3a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Lulasz,

I= am not comparing the same objects.I am trying to compare the String to a c= onstant String.
Still do I need to override the equals and hashCode meth= ods.
I added a <s:debug/> tag in th= e jsp and I see the values.
But the value doesnt set the value back to t= he s:select drop down list.

The below=C2=A0are the three classes being used i= n the code other than the Model(DiseaseTracking)
From the Service class, I have the list of DSTLookupDTO objects wit= h dstLookupId as the int value.
I loop th= rough the list and if a string value matches a constant string value, I add= the dstLookupId value to the primaryDiagnosis property of the DiagnosisDTO= object and I set that object to the DiseaseTracking model object. I have s= imilar conditions for other properties.
public class DSTLookupDTO implements Serializable {
=C2=A0p= rivate int dstLookupId;
=C2=A0public DSTLookupDTO()
=C2=A0{
=C2=A0}
=C2=A0//Has proper setter and getter methods for the properties=
}
public class DiagnosisDTO implements Serializable {<= br>=C2=A0=C2=A0=C2=A0 private int primaryDiagnosis;
=C2=A0=C2=A0=C2=A0 /= /Has proper setter and getter methods for the properties
}
pub= lic class DstLookupType implements DataValidation, Cloneable,Serializable{
=C2=A0private String dstLookupTypeId =3D "";
=C2=A0priv= ate String lookupValue =3D "";
=C2=A0//Has proper setter and g= etter methods for the properties
}


public void convertDiagnosisListToDiagnosisDTO(L= ist<DSTLookupDTO> alDstLookup) throws CpsEntException {
DiagnosisD= TO dt =3D null;
try {
=C2=A0if(alDstLookup !=3D null && alDst= Lookup.size() !=3D 0)
=C2=A0{
=C2=A0=C2=A0dt =3D new DiagnosisDTO();<= br>=C2=A0=C2=A0for (final DSTLookupDTO dstLookup : alDstLookup) {
=C2=A0= =C2=A0=C2=A0String grpCodeId =3D dstLookup.getDstLookupGrpCodeId();
=C2= =A0=C2=A0=C2=A0if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_PRD))=C2=A0=C2=A0=C2=A0{
=C2=A0=C2=A0=C2=A0=C2=A0dt.setPdDstLookupId(dstLoo= kup.getDstLookupId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setPrimaryDiagnosis(ds= tLookup.getDstLookupTypeId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setPdDstSubMod= uleRowId(dstLookup.getDstSubModuleRowId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.s= etOtherPrimaryDiagnosis(dstLookup.getOtherValue());
=C2=A0=C2=A0=C2=A0}<= br>=C2=A0=C2=A0=C2=A0else if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE= _ID_GNT))
=C2=A0=C2=A0=C2=A0{
=C2=A0=C2=A0=C2=A0=C2=A0dt.setGenoTypeD= stLookupId(dstLookup.getDstLookupId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setGe= noType(dstLookup.getDstLookupTypeId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setGe= noTypeDstSubModuleRowId(dstLookup.getDstSubModuleRowId());
=C2=A0=C2=A0= =C2=A0=C2=A0dt.setOtherGenoType(dstLookup.getOtherValue());
=C2=A0=C2=A0= =C2=A0}
=C2=A0=C2=A0=C2=A0else if(grpCodeId.equals(Constants.DST_LOOKUP_= GRP_CODE_ID_GNT2))
=C2=A0=C2=A0=C2=A0{
=C2=A0=C2=A0=C2=A0=C2=A0dt.set= GenoType2DstLookupId(dstLookup.getDstLookupId());
=C2=A0=C2=A0=C2=A0=C2= =A0dt.setGenoType2(dstLookup.getDstLookupTypeId());
=C2=A0=C2=A0=C2=A0= =C2=A0dt.setGenoType2DstSubModuleRowId(dstLookup.getDstSubModuleRowId());=C2=A0=C2=A0=C2=A0=C2=A0dt.setOtherGenoType2(dstLookup.getOtherValue());<= br>=C2=A0=C2=A0=C2=A0}
=C2=A0=C2=A0=C2=A0else if(grpCodeId.equals(Consta= nts.DST_LOOKUP_GRP_CODE_ID_HVC))
=C2=A0=C2=A0=C2=A0{
=C2=A0=C2=A0=C2= =A0=C2=A0dt.setHivDstLookupId(dstLookup.getDstLookupId());
=C2=A0=C2=A0= =C2=A0=C2=A0dt.setHivCoinfection(dstLookup.getDstLookupTypeId());
=C2=A0= =C2=A0=C2=A0=C2=A0dt.setHivDstSubModuleRowId(dstLookup.getDstSubModuleRowId= ());
=C2=A0=C2=A0=C2=A0}
=C2=A0=C2=A0=C2=A0else if(dstLookup.getDstLo= okupGrpCodeId().equals(Constants.DST_LOOKUP_GRP_CODE_ID_RNI))
=C2=A0=C2= =A0=C2=A0{
=C2=A0=C2=A0=C2=A0=C2=A0dt.setRenalDstLookupId(dstLookup.getD= stLookupId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setRenalImpairment(dstLookup.g= etDstLookupTypeId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setRenalDstSubModuleRow= Id(dstLookup.getDstSubModuleRowId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setOthe= rRenalImpairment(dstLookup.getOtherValue());
=C2=A0=C2=A0=C2=A0}
=C2= =A0=C2=A0=C2=A0else if(grpCodeId.equals(Constants.DST_LOOKUP_GRP_CODE_ID_SP= LT))
=C2=A0=C2=A0=C2=A0{
=C2=A0=C2=A0=C2=A0=C2=A0dt.setPostLiverDstLo= okupId(dstLookup.getDstLookupId());
=C2=A0=C2=A0=C2=A0=C2=A0dt.setPostLi= verTransplant(dstLookup.getDstLookupTypeId());
=C2=A0=C2=A0=C2=A0=C2=A0d= t.setPostLiverDstSubModuleRowId(dstLookup.getDstSubModuleRowId());
=C2= =A0=C2=A0=C2=A0}
=C2=A0=C2=A0}
=C2=A0}
} catch (Exception e) {
= =C2=A0=C2=A0=C2=A0 e.printStackTrace();
=C2=A0=C2=A0=C2=A0 throw new Cps= EntException(e.getMessage());
}
diseasetracking.setDiagnosisDTO(dt);=
}
=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0
public String getHe= pC() throws Exception {
=C2=A0setAllLookups();
=C2=A0DiseaseTrackingD= elegate dstDelegate =3D new DiseaseTrackingDelegate();
=C2=A0int dstId = =3D 20000048;
=C2=A0diseasetracking =3D dstDelegate.getDSTById(user.getC= urrentClientId(), dstId, null);
=C2=A0convertDiagnosisListToDiagnosisDTO= (diseasetracking.getAlDstLookup());
=C2=A0System.out.println("disea= setracking: "+diseasetracking);
=C2=A0System.out.println("dise= asetracking DiagnosisDTO.PrimaryDiagnosis: "+diseasetracking.getDiagno= sisDTO().getPrimaryDiagnosis());
=C2=A0return "success";
}<= /div>

I don't know=C2=A0even if the value of the sel= ect drop down matches=C2=A0(536), the option is not selected.
Below is the debug information of value stack.

=3D"Inline

Thanks=C2=A0

On Sun, Apr 2, 2017 at 2:31 PM, Paul Zepernick = <Pau= l.Zepernick@healthsmart.com> wrote:
I notice that you are using the # notation to access the property.= =C2=A0 Does it work without it?=C2=A0 It seems like something is not availa= ble on the action.=C2=A0 You could add value=3D"#diagnosisDTO.pri= maryDiagnosis" to your select and it will pull from the value stack ju= st like the property did instead of searching your action, but your setup s= hould work.=C2=A0 I believe there is just some other information we are mis= sing as to why it is not functioning.

On Apr 1, 2017 11:56 PM, Kiran Kongala <kirankongala06@gmail.com> wrote:
Hi,

Before calling the return "success" in the action method I added = couple of
println statements and I am seeing the data for the dropdown
=C2=A0and below are the values

diseasetracking: DiseaseTracking: dstId =3D 20000048
DstCodeId =3D HPC
paID =3D 2
memberID =3D 100
memberIdentTypeID =3D 1
memberAddressID =3D 2
memberPhonePhoneID =3D 3
memberFaxPhoneID =3D 4
prescriberID =3D 100
prescriberIdentTypeID =3D 1
prescriberAddressID =3D 2
prescriberPhonePhoneID =3D 3
prescriberFaxPhoneID =3D 4
mdSpecialtyTypeID =3D 1
comments =3D null
startDate =3D 2017-03-31T00:20:13.729339
endDate =3D 9999-12-30T19:00
createdBy =3D 0
diagnosisDTO =3D DiagnosisDTO: primaryDiagnosis =3D 536
otherPrimaryDiagnosis =3D null
genoType =3D 541
otherGenoType =3D null
genoType2 =3D 675
otherGenoType2 =3D null
hivCoinfection =3D 551
renalImpairment =3D 555
otherRenalImpairment =3D null
postLiverTransplant =3D 559

diseasetracking DiagnosisDTO.PrimaryDiagnosis: 536

And I added this property <s:property
value=3D"#diagnosisDTO.primaryDiagnosis"/>

but the value is not selected in the select tag.

And when I view the source, I am seeing the below source of the jsp
<select name=3D"diagnosisDTO.primaryDiagnosis" size=3D&qu= ot;1"
id=3D"addEditHEPC_diagnosisDTO_primaryDiagnosis" class=3D&qu= ot;form-control">
=C2=A0 =C2=A0 =C2=A0<option value=3D"-1"
=C2=A0 =C2=A0 =C2=A0>Please Select</option>
=C2=A0 =C2=A0 =C2=A0<option value=3D"533">Chronic Hepatitis= C</option>
=C2=A0 =C2=A0 =C2=A0<option value=3D"536">Chronic Hepatitis= B</option>
=C2=A0 =C2=A0 =C2=A0<option value=3D"537">Chronic Hepatitis= C and B</option>
=C2=A0 =C2=A0 =C2=A0<option value=3D"538">Acute Hepatitis C= </option>
=C2=A0 =C2=A0 =C2=A0<option value=3D"539">Unknown / Not doc= umented</option>
=C2=A0 =C2=A0 =C2=A0<option value=3D"540">Other</option&= gt;
=C2=A0</select>

Everything looks correct but I am not seeing the value selected in the drop=
down(536).

Thanks





On Sat, Apr 1, 2017 at 10:31 PM, Paul Zepernick <
Paul.Zepernick@healthsmar= t.com> wrote:

> What happens when you use a s:property to evaluate
> diagnosisDTO.primaryDiagnosis?=C2=A0 If you do not get a value, then c= heck to
> make sure the path is right or that something is not wrong in your act= ion
> that is populating it.=C2=A0 Also verify that the key property in your= list is
> the same type as the value being set, both Integer for example.
>
> On Apr 1, 2017 7:38 PM, Kiran Kongala <kirankongala06@gmail.com> wrote:
> Hi,
>
> I am trying to use the Struts2 s:select tag but the drop down value co= ming
> from the db is not being set to the drop down as selected value and th= e
> screen always shows the default first value in the list.
>
> Can some one please help me.
>
> *JSP Code*
>
> <s:select name=3D"diagnosisDTO.primaryDiagnosis"
>=C2=A0 =C2=A0 list=3D"primaryDiagnosisTypes"
>=C2=A0 =C2=A0 listKey=3D"dstLookupTypeId"
>=C2=A0 =C2=A0 listValue=3D"lookupValue"
>=C2=A0 =C2=A0 multiple=3D"false"
>=C2=A0 =C2=A0 headerKey=3D"-1"
>=C2=A0 =C2=A0 headerValue=3D"Please Select"
>=C2=A0 =C2=A0 size=3D"1"/>
>
> *Action Class Code*
>
>
> *I have Disease Tracking as a Model object and inside that model I hav= e
> DiagnosisDTO object where I have properties which are matched=C2=A0 to= the jsp
> select tag above*
>
>
>
>
> *This is the Model Object defined in the Action Class=C2=A0 =C2=A0 pub= lic
> DiseaseTracking getModel() {=C2=A0 =C2=A0 =C2=A0 =C2=A0 return this.di= seasetracking;=C2=A0 =C2=A0 }*
>
> *DiseaseTracking Object with DiagnosisDTO property below *
>
>
>
>
>
>
>
>
> *private DiagnosisDTO diagnosisDTO; public DiagnosisDTO getDiagnosisDT= O()
> {=C2=A0 return diagnosisDTO; } public void setDiagnosisDTO(DiagnosisDT= O
> diagnosisDTO) {=C2=A0 this.diagnosisDTO =3D diagnosisDTO; }*
>
>
> *DiagnosisDTO Object with property **primaryDiagnosis **and getter and=
> setter*
>
>
>
>
> * private int primaryDiagnosis; public int getPrimaryDiagnosis() {=C2= =A0 return
> primaryDiagnosis; }*
>
>
>
>
> * public void setPrimaryDiagnosis(int primaryDiagnosis)
> {=C2=A0 this.primaryDiagnosis =3D primaryDiagnosis; }*
>
>
> *This method is a service call to get the disease tracking object*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> * public String getHepC() throws Exception {=C2=A0 List allDstLookupTy= pes =3D
> GenCache.getListOfDstLookupType(user.getCurrentClientId());<= br> >=C2=A0 setPrimaryDiagnosisTypes(this.getSpecificDstLookupTypes( > Constants.DST_LOOKUP_GRP_CODE_ID_PRD,
> allDstLookupTypes));=C2=A0 DiseaseTrackingDelegate dstDelegate =3D new=
> DiseaseTrackingDelegate();=C2=A0 int dstId =3D 20000048;=C2=A0 //The b= elow is the
> service call to db which will get the disease tracking object with som= e
> lists objects.=C2=A0 =C2=A0diseasetracking =3D
> dstDelegate.getDSTById(user.getCurrentClientId(), dstId, null);= =C2=A0 //the
> below is the code to convert the list returned from service to another=
> object Diagnosis DTO and set that back to Disease Tracking model
> object=C2=A0 convertDiagnosisListToDiagnosisDTO(diseasetracking.<= br> > getAlDstLookup());
>=C2=A0 return
> "success"; } public List<DstLookupType> getSpecificDst= LookupTypes(String
> grpLookupTypeId, List<DstLookupType>
> allDstLookupTypes){ List<DstLookupType> lookupTypes =3D new
> ArrayList<DstLookupType>(); for(int i=3D0; i <
> allDstLookupTypes.size();i++) {=C2=A0 if(
> allDstLookupTypes.get(i).getDstLookupGrpCodeId().equals(grpL= ookupTypeId)){
>=C2=A0 =C2=A0lookupTypes.add(allDstLookupTypes.get(i));=C2=A0 } } = return
> lookupTypes;}*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *=C2=A0 =C2=A0 public void convertDiagnosisListToDiagnosisDTO(Lis= t<DSTLookupDTO>
> alDstLookup) throws CpsEntException {=C2=A0 =C2=A0 =C2=A0DiagnosisDTO = dt =3D null;
> try {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if(alDstLookup !=3D null &&= amp; alDstLookup.size() !=3D 0)
>=C2=A0 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dt =3D new DiagnosisDTO();= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (final DSTLookupDTO
> dstLookup : alDstLookup) {
>=C2=A0 =C2=A0 if(dstLookup.getDstLookupGrpCodeId().equals(Con= stants.DST_LOOKUP_
> GRP_CODE_ID_PRD))
>=C2=A0 =C2=A0 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dt.setPdDstLoo= kupId(dstLookup.getDstLookupId());
>=C2=A0 =C2=A0 =C2=A0//dt.setPrimaryDiagnosis(dstLookup.getDstLooku= pTypeId());
>=C2=A0 =C2=A0 =C2=A0diseasetracking.setPrimaryDiagnosis(dstLookup.= getDstLookupTypeId());
>=C2=A0 =C2=A0 =C2=A0dt.setPdDstSubModuleRowId(dstLookup.getDs= tSubModuleRowId());
>=C2=A0 =C2=A0 =C2=A0dt.setOtherPrimaryDiagnosis(dstLookup.getOther= Value());
>=C2=A0 =C2=A0 }=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else
> if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LO= OKUP_
> GRP_CODE_ID_GNT))
>=C2=A0 =C2=A0 {
>=C2=A0 =C2=A0 =C2=A0dt.setGenoTypeDstLookupId(dstLookup.getDstLook= upId());
>=C2=A0 =C2=A0 =C2=A0dt.setGenoType(dstLookup.getDstLookupTypeId())= ;
>=C2=A0 =C2=A0 =C2=A0dt.setGenoTypeDstSubModuleRowId(dstLookup= .getDstSubModuleRowId());
>=C2=A0 =C2=A0 =C2=A0dt.setOtherGenoType(dstLookup.getOtherValue())= ;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 else
> if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LO= OKUP_
> GRP_CODE_ID_GNT2))
>=C2=A0 =C2=A0 {
>=C2=A0 =C2=A0 =C2=A0dt.setGenoType2DstLookupId(dstLookup.getDstLoo= kupId());
>=C2=A0 =C2=A0 =C2=A0dt.setGenoType2(dstLookup.getDstLookupTypeId()= );
>=C2=A0 =C2=A0 =C2=A0dt.setGenoType2DstSubModuleRowId(dstLooku= p.getDstSubModuleRowId());
>=C2=A0 =C2=A0 =C2=A0dt.setOtherGenoType2(dstLookup.getOtherValue()= );=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 else
> if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LO= OKUP_
> GRP_CODE_ID_HVC))
>=C2=A0 =C2=A0 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dt.setHivDstLo= okupId(dstLookup.getDstLookupId());
>=C2=A0 =C2=A0 =C2=A0dt.setHivCoinfection(dstLookup.getDstLookupTyp= eId());
>=C2=A0 =C2=A0 =C2=A0dt.setHivDstSubModuleRowId(dstLookup.getD= stSubModuleRowId());
>=C2=A0 =C2=A0 }=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else
> if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LO= OKUP_
> GRP_CODE_ID_RNI))
>=C2=A0 =C2=A0 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dt.setRenalDst= LookupId(dstLookup.getDstLookupId());
>=C2=A0 =C2=A0 =C2=A0dt.setRenalImpairment(dstLookup.getDstLookupTy= peId());
>=C2=A0 =C2=A0 =C2=A0dt.setRenalDstSubModuleRowId(dstLookup.ge= tDstSubModuleRowId());
>=C2=A0 =C2=A0 =C2=A0dt.setOtherRenalImpairment(dstLookup.getOtherV= alue());
>=C2=A0 =C2=A0 }=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else
> if(dstLookup.getDstLookupGrpCodeId().equals(Constants.DST_LO= OKUP_
> GRP_CODE_ID_SPLT))
>=C2=A0 =C2=A0 {
>=C2=A0 =C2=A0 =C2=A0dt.setPostLiverDstLookupId(dstLookup.getDstLoo= kupId());
>=C2=A0 =C2=A0 =C2=A0dt.setPostLiverTransplant(dstLookup.getDstLook= upTypeId());
>=C2=A0 =C2=A0 =C2=A0dt.setPostLiverDstSubModuleRowId(dstLooku= p.getDstSubModuleRowId());
>=C2=A0 =C2=A0 }=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0}=C2=A0 =C2=A0 =C2=A0 =C2=A0 } catch (Exception e) {
> e.printStackTrace();=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 throw ne= w
> CpsEntException(e.getMessage());=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
> diseasetracking.setDiagnosisDTO(dt);=C2=A0 =C2=A0 } *
>
> Thanks
>
>
>
>
> Disclaimer: This communication and any files transmitted with it may > contain information that is privileged, confidential and/or exempt fro= m
> disclosure under applicable law. If you are not the intended recipient= , you
> are hereby notified that any disclosure, copying, distribution, or use= of
> the information contained herein (including any reliance thereon) is > strictly prohibited. If you received this communication in error, plea= se
> immediately contact the sender and destroy the material in its entiret= y,
> whether in electronic or hard copy format. Thank you.
>




Disclaimer: This communication and any files transmitted with it may contai= n information that is privileged, confidential and/or exempt from disclosur= e under applicable law. If you are not the intended recipient, you are here= by notified that any disclosure, copying, distribution, or use of the infor= mation contained herein (including any reliance thereon) is strictly prohib= ited. If you received this communication in error, please immediately conta= ct the sender and destroy the material in its entirety, whether in electron= ic or hard copy format. Thank you.

--94eb2c03ff6004f36c054c354d3a-- --94eb2c03ff6004f36e054c354d3b--