struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "elyes sallem" <elyes.sal...@gmail.com>
Subject populate pb of the selected Item
Date Tue, 02 Dec 2008 21:08:36 GMT
Hello,
i have a page, in which there is two form
the second form contains 2 pair of 2 select
the first pair add an OR to shortlist when we click on sumbit button (this
submit works ), the second pair is to delete an or from a shortlist
so when i select a shortlist, the list of OR in second select will be
updated
my problem  is when i submit the second pair of select, the properties
selected are not populated
they took the value i set in the constructor of the actionForm, not those
selected by the user
*here is my jsp*

            <html:form action="EditShortList.do?do=addOrShortList">


nom de la Short list  :

              <html:text property="addedList"/>
              <html:submit value="ajouter"/><br />

              <br />
              </html:form>
              <table style="border: 1px solid rgb(80, 142, 204);"
 border="0" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>

                    <td
 style="border: 1px solid rgb(80, 142, 204); width: 2591px; height: 22px;
background-color: rgb(80, 142, 204); text-align: left;"> Ajout d'OR dans une
Short
list</td>

                  </tr>
                  <tr>

                </tr>
                </tbody>
              </table>

              <br />
<html:form action="EditShortList.do?do=ajouterOuSupprimerOr">
Short list  :
<nested:nest property="selectedAddShortlist">
<nested:select property="orshortlistId"
onchange="form.action='EditShortList.do?do=refreshOrShortList';
form.submit();">
<html:optionsCollection property="shortListsAdd" value="orshortlistId"
label="orshortlistNom" />
</nested:select>
</nested:nest>
    OR :
<nested:nest property="selectedAddOr">
<nested:select property="orId">
<html:optionsCollection property="addOrList" value="orId" label="orCode" />
</nested:select>
</nested:nest>
  <nested:submit value="ajouter" property="faire"/>


              <table style="border: 1px solid rgb(80, 142, 204);"
 border="0" cellpadding="0" cellspacing="0">
                <tbody>

                  <tr>
                    <td
 style="border: 1px solid rgb(80, 142, 204); width: 2591px; height: 22px;
background-color: rgb(80, 142, 204); text-align: left;"> Suppression d'OR
dans une Short
list</td>
                                      </tr>
                                      <tr>

                </tr>
                </tbody>
              </table>

Short list  :
<nested:nest property="selectedDeleteShortlist">
<nested:select  property="orshortlistId"
 onchange="form.action='EditShortList.do?do=refreshOrShortList';
form.submit();">
<html:optionsCollection property="shortListsDelete" value="orshortlistId"
label="orshortlistNom" />
</nested:select>
</nested:nest>
    OR :
<nested:nest property="selectedDeleteOr">
<nested:select  property="orId" >
<html:optionsCollection property="delOrList" value="orId" label="orCode" />
</nested:select>
</nested:nest>
  <nested:submit value="supprimer" property="faire"  />
</html:form>


*
and the action form :*

public class ShortListEditForm extends ActionForm{
        String addedList;
        String faire;
        OrShortList selectedAddShortlist;
        OrShortList selectedDeleteShortlist;
        OrdreRegrpmt selectedAddOr;
        OrdreRegrpmt selectedDeleteOr;



        java.util.List<OrShortList> shortListsAdd = new
ArrayList<OrShortList>();
        java.util.List<OrShortList> shortListsDelete = new
ArrayList<OrShortList>();
        java.util.List<OrdreRegrpmt> addOrList = new
ArrayList<OrdreRegrpmt>();
        java.util.List<OrdreRegrpmt> delOrList = new
ArrayList<OrdreRegrpmt>();




        public ShortListEditForm() {
                faire="";
                selectedDeleteShortlist=new OrShortList(0,"select a short
list");
                selectedAddShortlist=new OrShortList(0,"select a short
list");
                selectedDeleteOr=new OrdreRegrpmt(0,"select a Short list");
                selectedAddOr=new OrdreRegrpmt(0,"select a Short list");

        }

        public java.util.List<OrdreRegrpmt> getAddOrList() {
                if (selectedAddShortlist.getOrshortlistId()==0){
                        java.util.List<OrdreRegrpmt> addOrList1 = new
ArrayList<OrdreRegrpmt>();
                        addOrList1.add(new OrdreRegrpmt(0,"select a Short
list"));
                        setSelectedAddOr(new OrdreRegrpmt(0,"select a Short
list"));
                        setAddOrList(addOrList1) ;
                }
                return this.addOrList;
        }
        public void setAddOrList(java.util.List<OrdreRegrpmt> addOrList) {
                this.addOrList = addOrList;
        }




        public java.util.List<OrdreRegrpmt> getDelOrList() {
                if (selectedDeleteShortlist.getOrshortlistId()==0){
                        java.util.List<OrdreRegrpmt> delOrList1 = new
ArrayList<OrdreRegrpmt>();
                        delOrList1.add(new OrdreRegrpmt(0,"select a Short
list"));
                        setSelectedDeleteOr(new OrdreRegrpmt(0,"select a
Short list"));
                        setDelOrList(delOrList1);

                }
                return this.delOrList;
        }
        public void setDelOrList(java.util.List<OrdreRegrpmt> delOrList) {
                this.delOrList = delOrList;
        }
        public void setAddedList(String addedList) {
                this.addedList = addedList;
        }

        public String getAddedList() {
                return addedList;
        }
        public OrShortList getSelectedAddShortlist() {
                return selectedAddShortlist;
        }
        public void setSelectedAddShortlist(OrShortList
selectedAddShortlist) {
                this.selectedAddShortlist = selectedAddShortlist;
        }
        public OrShortList getSelectedDeleteShortlist() {
                return selectedDeleteShortlist;
        }
        public void setSelectedDeleteShortlist(OrShortList
selectedDeleteShortlist) {
                                this.selectedDeleteShortlist =
selectedDeleteShortlist;
        }
        public OrdreRegrpmt getSelectedAddOr() {
                return selectedAddOr;
        }
        public void setSelectedAddOr(OrdreRegrpmt selectedAddOr) {
                this.selectedAddOr = selectedAddOr;
        }
        public OrdreRegrpmt getSelectedDeleteOr() {
                return selectedDeleteOr;
        }
        public void setSelectedDeleteOr(OrdreRegrpmt selectedDeleteOr) {
                //JOptionPane.showMessageDialog(null, " Or Code
="+selectedDeleteOr.getOrCode());
                this.selectedDeleteOr = selectedDeleteOr;
        }

        public java.util.List<OrShortList> getShortListsAdd() {
                return shortListsAdd;
        }

        public void setShortListsAdd(java.util.List<OrShortList>
shortListsAdd) {
                this.shortListsAdd = shortListsAdd;
        }

        public java.util.List<OrShortList> getShortListsDelete() {
                return shortListsDelete;
        }

        public void setShortListsDelete(java.util.List<OrShortList>
shortListsDelete) {
                this.shortListsDelete = shortListsDelete;
        }

        public String getFaire() {
                return faire;
        }

        public void setFaire(String faire) {
                this.faire = faire;
        }

}


I'm really running out of solution, i appreciate your help

Thanks
Laes

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