How to create a Dynamic grid in JSP page ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baskarpr
    New Member
    • Oct 2006
    • 33

    How to create a Dynamic grid in JSP page ?

    Hi everybody,
    I have a web page containing of table with columns like product name, id, price etc. I want to edit the contents of a row, instead of entering in a text box and updating. It will be better if that grid is scrollable and dynamically editable.
    Thanks guyz...
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by baskarpr
    Hi everybody,
    I have a web page containing of table with columns like product name, id, price etc. I want to edit the contents of a row, instead of entering in a text box and updating. It will be better if that grid is scrollable and dynamically editable.
    Thanks guyz...
    But you can also create table rows dynamically

    Assuming you have your products in an Iterator called iterator
    [HTML]
    <FORM name ="form1" method = "post" action = "<%=path">
    <TABLE border="0">
    <TBODY>
    <TR>
    <TH >ID</TH>
    <TH >Name</TH>
    </TR>
    <%
    while(iterator. hasNext()) {
    pr = (Product)iterat or.next();
    %>
    <TR>
    <TD > <INPUT type="text" name="id<%=pr.g etID() %>" size="20" value="<%=pr.ge tID() %>" readonly></TD>
    <TD > <INPUT type="text" name="name<%=pr .getID() %>" size = "20" value="<%=pr.ge tName() %>"> </TD>
    <TD > <INPUT type="text" name="price<%=p r.getID() %>" size = "20" value=".<%=pr.g etPrice() %>"></TD>
    </TR>
    <%
    }
    %>
    </TBODY>
    </TABLE>
    </FORM>

    [/HTML] Restricts id to be uneditable. The id gives each input box its uniqueness

    Comment

    • baskarpr
      New Member
      • Oct 2006
      • 33

      #3
      Its good. But I am seeking a grid similar to ASP .net environment, you might have seen in doc.google. Anyway, thanks a lot...

      Comment

      • vikramcbz
        New Member
        • Jun 2007
        • 5

        #4
        after creating the grid
        i want to access the values in the next page of particular text box how it is possible......?
        can u provide me an example how to access the things in next page.......?

        Comment

        • Sarabjeet Singh
          New Member
          • Apr 2013
          • 1

          #5
          @baskarpr I am also asp.net developer and now I switch to java.There is grid view control ,I created in jsp you can find here http://behindjavascene.blogspot.com/...ically-in.html

          Comment

          Working...