troubleshooting Question

JSP - Loop through HTML table for changes - update javabean

Avatar of vandy02
vandy02Flag for United States of America asked on
JSP
1 Comment1 Solution677 ViewsLast Modified:
I have asked for assistance on a similar question where I did get some help and was able to display a table.  However, I do not know how to loop through the html table and then send the changes to get updated.
This is my previous question: JSP - Edit table containing Beans / XML
This is where I got started: http://java.sun.com/developer/technicalArticles/xml/WebAppDev2/

I was told to loop through the table and find those that are checked.  Then send the information to my JavaBean

<TABLE >
    <TR>
          <TH><input type="checkbox" name="masterChk"/></TH>
        <TH>Symbol</TH>
        <TH>Name</TH>
        <TH>Price</TH>

    </TR>

<%
      java.util.Iterator folio = portfolio.getPortfolio();
      Stock stock = null;
      int recordCnt = 0;      
     
      while (folio.hasNext())
      {      
            recordCnt++;
            stock = (Stock)folio.next();
            String stockSymbol = stock.getSymbol();
            String stockName = stock.getName();
            Float stockPrice = stock.getPrice();
%>            
            <TR>
                  <TD><input type="checkbox" name="chk<%=recordCnt%>" value="<%=stockSymbol%>"/></TD>
                  <TD><%=stockName%></TD>
                  <TD><%=stockSymbol%></TD>
                  <TD><input type=text name="stockPrice<%=recordCnt%>" value="<%=stockPrice%>"></TD>
            </TR>
<%
      }
%>
</TABLE>
ASKER CERTIFIED SOLUTION
Murali Murugesan
Full stack Java developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros