• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Getting Indexed properties

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I had having trouble retrieving the values of the indexed properties.. I am trying to created a shoping cart and have a list of products with their name, id and quantity, the user edit the field quantity but I can not get that value into my form class

ProductsForm:
private List<Productos> productsList;

public List<Productos> getProductsList()
{
return productsList;
}

public void setProductsList(List<Productos> productsList) {
this.productsList = productsList;
}
public Productos getProducts(int index)
{
return (Productos) productsList.get(index);
}

JSP:
<logic:iterate name="products_form" property="productsList" indexId="index" id="products" >
<td><table cellpadding=1 cellspacing=1>
<tr><td>
<H1 Style="Font: 10px Verdana;color:#D00000">Bsf. <bean:write name="products" property="costo" /></H1>
</td>
<td><H1 Style="Font: 10px Verdana;color:#787878">cant <html:text name="products" property="cant" size="3" indexed="true" /></ </H1>
</td></tr>
</table>
</td>
</logic:iterate>

struts-config.html
<action path="/openProducts" type="com.jnj.actions.ProductsAction" parameter="method" name="products_form" input="/shoppingcar/shopping.jsp" scope="session" validate="false">
<forward name="success" path="/shoppingcar/shopping.jsp" />
<forward name="backlogin" path="/index.jsp"></forward>
</action>

when I try to get the new quantities I get null, can some one help
Thanks
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic