You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shamdasani Nimmi-ANS004 <AN...@motorola.com> on 2001/06/13 17:52:01 UTC

Need help with updatable indexed properties.

Hi,

Can someone please show me how to use the 'Iterate' and 'Select' tags instead in JSP code below for the indexed properties some of which are modifiable :



<%SubmitQuotesForm submitQuotesForm=(SubmitQuotesForm)session.getAttribute("submitQuotesForm");%>

<%for (int i=0; i < submitQuotesForm.getRfqListBean().getTotalRfqCount();i++) {%>     [WANT TO USE ITERATE HERE]
  <tr>

    <td align="center" width="6%"><font SIZE="1" face = "Arial">
      <%=submitQuotesForm.getRfqListBean().getRfqList(i).getUsingLocationCode()%>
    </font>
    </td>

    <td width="7%"><font SIZE="1" face = "Arial"> [THIS HAS TO BE DROPDOWN LIST. HOW TO USE SELECT TAG HERE]
      <%=submitQuotesForm.getRfqListBean().getRfqList(i).getResponseIndicatorCode()%>
    </font>
    </td>

    <td width="15%"><font SIZE="1" face = "Arial">
      <%=submitQuotesForm.getRfqListBean().getRfqList(i).getManufacturerPartNbr()%>
    </font>
    </td>

    <td width="5%"><font SIZE="1" face = "Arial">
      <input type="text" name="rfqListBean.rfqList[<%=i%>].supplierQuotedprice"
 value="<%=submitQuotesForm.getRfqListBean().getRfqList(i).getSupplierQuotedPrice()%>">
    </font>
    </td>

    <td width="2%"><font SIZE="1" face = "Arial">
      <input type="text" name="rfqListBean.rfqList[<%=i%>].priceDescription"
 value="<%=submitQuotesForm.getRfqListBean().getRfqList(i).getPriceDescription()%>">
    </font>
    </td>

  </tr>
  <%}%>



This is what my 'SubmitQuotesForm', 'RfqListBean' look like:

public final class SubmitQuotesForm extends ActionForm {

  public SubmitQuotesForm() {

  }

  private RfqListBean rfqListBean = new RfqListBean();


  public RfqListBean getRfqListBean() {
    return rfqListBean;
  }

  public void setRfqListBean(RfqListBean rfqListBean) {
    this.rfqListBean = rfqListBean;
  }

}

public final class RfqListBean implements Serializable {

    public RfqListBean() {
    }

    private int totalRfqCount = 0;
    private RfqBean[] rfqList;

    public RfqBean getRfqList(int index) {
      return rfqList[index];
    }

    public void setRfqList(int index, RfqBean rfqBean) {
      this.rfqList[index] = rfqBean;
    }
}

and RfqBean is just a regular bean with various properties.


TIA.

-Nimmi


Re: Need help with updatable indexed properties.

Posted by Jeff Trent <jt...@structsoft.com>.
Try looking in www.mail-archive.com under struts-user for the keywords
"Grid" or "Matrix".  You'll find some material there.


----- Original Message -----
From: "Shamdasani Nimmi-ANS004" <AN...@motorola.com>
To: "struts-user@jakarta. apache. org (E-mail)"
<st...@jakarta.apache.org>
Sent: Wednesday, June 13, 2001 11:52 AM
Subject: Need help with updatable indexed properties.


> Hi,
>
> Can someone please show me how to use the 'Iterate' and 'Select' tags
instead in JSP code below for the indexed properties some of which are
modifiable :
>
>
>
> <%SubmitQuotesForm
submitQuotesForm=(SubmitQuotesForm)session.getAttribute("submitQuotesForm");
%>
>
> <%for (int i=0; i <
submitQuotesForm.getRfqListBean().getTotalRfqCount();i++) {%>     [WANT TO
USE ITERATE HERE]
>   <tr>
>
>     <td align="center" width="6%"><font SIZE="1" face = "Arial">
>
<%=submitQuotesForm.getRfqListBean().getRfqList(i).getUsingLocationCode()%>
>     </font>
>     </td>
>
>     <td width="7%"><font SIZE="1" face = "Arial"> [THIS HAS TO BE DROPDOWN
LIST. HOW TO USE SELECT TAG HERE]
>
<%=submitQuotesForm.getRfqListBean().getRfqList(i).getResponseIndicatorCode(
)%>
>     </font>
>     </td>
>
>     <td width="15%"><font SIZE="1" face = "Arial">
>
<%=submitQuotesForm.getRfqListBean().getRfqList(i).getManufacturerPartNbr()%
>
>     </font>
>     </td>
>
>     <td width="5%"><font SIZE="1" face = "Arial">
>       <input type="text"
name="rfqListBean.rfqList[<%=i%>].supplierQuotedprice"
>
value="<%=submitQuotesForm.getRfqListBean().getRfqList(i).getSupplierQuotedP
rice()%>">
>     </font>
>     </td>
>
>     <td width="2%"><font SIZE="1" face = "Arial">
>       <input type="text"
name="rfqListBean.rfqList[<%=i%>].priceDescription"
>
value="<%=submitQuotesForm.getRfqListBean().getRfqList(i).getPriceDescriptio
n()%>">
>     </font>
>     </td>
>
>   </tr>
>   <%}%>
>
>
>
> This is what my 'SubmitQuotesForm', 'RfqListBean' look like:
>
> public final class SubmitQuotesForm extends ActionForm {
>
>   public SubmitQuotesForm() {
>
>   }
>
>   private RfqListBean rfqListBean = new RfqListBean();
>
>
>   public RfqListBean getRfqListBean() {
>     return rfqListBean;
>   }
>
>   public void setRfqListBean(RfqListBean rfqListBean) {
>     this.rfqListBean = rfqListBean;
>   }
>
> }
>
> public final class RfqListBean implements Serializable {
>
>     public RfqListBean() {
>     }
>
>     private int totalRfqCount = 0;
>     private RfqBean[] rfqList;
>
>     public RfqBean getRfqList(int index) {
>       return rfqList[index];
>     }
>
>     public void setRfqList(int index, RfqBean rfqBean) {
>       this.rfqList[index] = rfqBean;
>     }
> }
>
> and RfqBean is just a regular bean with various properties.
>
>
> TIA.
>
> -Nimmi
>
>