How to create dynamic tables in jsp page

Hi,
Iwant to create a table with 8 rows.each row will have two select boxes and one text box.besides i have add button.intially the screen shows only one row.if user clicks on add button then another row is added.like this upto 8 rows.
how can solve this problem..
regards,

Hi I am not a big programmer but i can suggest a method to u
try something like this..
this could be quite adjusted in html page itself.....
<html>
<head>
<script language="javascript">
var count=1
fucntion addRow(){
if(count<8){
count=count+1
row.innerHTML=row.innerHTML+"<tr><td><input type='text' name="+count+"></td><td><input type='button' onclick=addRow() value='Add' name='add'></td></tr>"
else if(count==8){
row.innerHTML=row.innerHTML+"<tr><td><input type='text' name="+count+"></td><td></td></tr>"
</script >
</head>
<body>
<form action='Myservlet" method='post'>
<table>
<div name='row' name='row'><tr><td><input type='text' name=1></td><td><input type='button' onclick=addRow() value='Add' name='add'></td></tr></div>
</table>
</form>
</body>
</html>
I believe it could be quite adjusted @ client side itself.... as per your description...

Similar Messages

  • How to create Dynamic Table Control

    Hi
    How to create Dynamic Table control , The field names and values to be displayed in table control are to be fetched from Add-on Tables.
    Regards
    Prasath

    Hi Jonathan,
    Actually the columns to be displayed are not constant . It will be increased based on the database values, Anyhow it will not exceed 100.
    Please confirm my understanding.
    1. In this case I have to create 100 custom columns and make it visible / invisible based on my requirement and I can set the title at runtime.
    2. How can i assosicate / reassociate the datadictionary reference for the columns that i use. Because I need to show the search help values for the
    dynamic columns.
    Your opinion on this will be helpful.
    Regards
    Prasath

  • Need Dynamic Table in JSP page

    Hi Friends,
    I need to build table dynamically in my JSP page.
    My requirement like:
    I have a Button in my JSP page when i click that it should go to another jsp where it will ask me the row and column counts, after i entered some values then i have a button to say OK it should go to the first page again there i want the table for the rows and columns dynamically.
    (like MS- Word when u create table it will ask the row count and column count after that its building a table)
    Please help me....

    Make use of JSTL's c:forEach.

  • How to create dynamic Textbox in JSP

    I created dynamic Textboxes using javascript in JSP.But i want to give every textbox a unique name..But I dont know how to give unique name to all the textbox which are created dynamically.....Can u help me Please.............
    <script code="text/javascript">
    function dynam(val)
    var d= document.getElementById("Bottom");
    d.innerHTML='<table>';
    for(i=1;i<=val;i++)
    d.innerHTML += '<tr><td>Parameter</td><td><INPUT type="text" name="week"'+i+'size = 15></td>';
    d.innerHTML +='</table>' ;
    </script>in the above code."val" is the integer value passed while calling this function. "Bottom" is the id of <DIV> tag in my JSP page.
    My problem is : when i creating a text box. the Unique name of the textbox in not getting generated.All the text bok has the same name as "week",but i want the name to be as week1,week2,week3,.....etc
    Edited by: AnilTcs on Jan 21, 2009 1:31 AM

    Try this:
    d.innerHTML += '<tr><td>Parameter</td><td><INPUT type="text" name="week '+i+' " size = 15></td>';I have just changed the quotes around week. Hope this helps.

  • How to format this table in jsp page?

    I have a table in database and there are four data field in it.They are "id","name","email","registetime".
    In javabean,I add all this data to a vector:" ResultSet rs;
    while(rs.next()){
    vec.add(rs.getString("id");
    vec.add(rs.getString("name");
    vec.add(rs.getString("email");
    vec.add(rs.getString("registetime");} ";
    I use a Iterator to read all the data to jsp page:"
                   iter=vec.iterator();
                   while(iter.hasNext()){
                   int i=0;               
                   %>
                   <table border="1" bordercolor="#FF6699" bgcolor="#CCCC99">
                   <%
                   if(i==0|i%8==0){
                   out.println("<td><tr>");
                   %>
                   <%=iter.next()%>
                   </td>
    <%
                   if(i%8==0)
                   out.println("</tr></td>");
                   i++;
                   %></table>
    I use a variable i for change range.I want to output a '\n' after output 4 data.But now the data in IE is this:
    1
    lyo
    [email protected]
    2003-6
    2
    Yashnoo
    [email protected]
    2003-7
    It not that I want to get.I means I want to get data like this:
    1 lyo [email protected] 2003-6
    2 Yashnoo [email protected] 2003-7
    How can I do? :(

    Anyone has idea?But I change it to this:
    <body>
    <table border="1" bordercolor="#FF6699" bgcolor="#CCCC99">
    <%
    Iterator iter=null;
    ResultSet rs=null;
    Vector vec=new Vector();
    vec=lyo.addData(rs,vec);
    iter=vec.iterator();
    try{
    while(iter.hasNext()){
    int i=0;
    %>
    <%
    if(i%8==0){
    out.print("<tr>");
    out.print("<td>");
    %>
    <%=iter.next()%>
    <%
    out.print("</td>");
    if(i%8==0){
    out.print("</tr>");
    i++;
    %></table>
    <%
    }catch(Exception e){
    out.println(e.toString());
    %>
    It can't help? Why?

  • How to create dynamic table using POJO based DataControl

    Hi,
    I'm using JDeveloper 11.1.1.5.0. I'm not using ADF BC.
    I've a requirement to display the Dynamic table in my search page.
    In our product we are using POJO based Data controls.
    I created a task-flow and page fragment. I tried to create the dynamic table by drag-drop of searchResults from my Data control, I see the option for Read-Only Dynamic Table, but when I select this option, I don't see anything happening.
    Does the Dynamic Table work with POJO data controls?
    Any inputs would be helpful.
    Thanks
    Ravi

    First U have to crate Extended View Object to your actual View obj.
    Now take Page with Panel  Splitter ,on First facet drag View obj as table and on second Facet Drag Extended View Obj as table.On page loading U have delete all rows from Extended View object.And then u have write bean code on button click to get current select rows from above view objct,and for Filter rows from Second View obj according to selection of rows from first view obj...

  • How to create dynamic LOV in a page

    Hi,
    I am trying to create a cascading selection feature in a page.
    That is:
    Suppose I have a data in Oct. Nov. DEC. in 1998, May, June, July, August in 1999, and Sep. Oct, Nov. in 2000, Jan., Feb., Mar., in 2001.
    If I choose 2000 in the first selection box then in the second selection box(month box) will show only Sep., Oct., Nov.,. I could create this feature with select and redirect with selection box.
    However I want to create one with Multi_selection box.
    Does anyone knows how to create one with multi selection box or check box?
    Thanks,
    Message was edited by:
    user459223

    Hi
    Sorry Could not understand ur problem exactly.
    Anyhow a solution for ur problem is to use a select list with submit option for the first select list.
    for second select list in the LOV part write the query with the where clause:
    where a = :b(where b is the first select list)
    try it
    regards
    ameya

  • How do create a table of contents page from a series of bookmarks?

    I am compiling bundles of documents for printing, starting from single PDFs. I combine them using Acrobat Pro X for Mac which gives me a single PDF, with a series of bookmarks for each document. I then insert page numbers.
    What I need is a way of creating a table of contents for printing (as opposed to a "digial T.O.C" - ie the bookmarks list). Ideally, I would need a script that would copy the list of bookmarks and the page numbers for each and dump them to a new page in the PDF bundle (or a text file).
    That way I can print the PDF with a Table of Contents at the front.
    There was an entry on the Acobrat for Legal Professionals blog a while back (http://blogs.adobe.com/acrolaw/2009/12/list_bookmarks_with_a_free_scrip/) - as far as I can tell that hint only works for Acrobat 9.
    Any help gratefully received

    Rick Borstein created an Action in Acrobat X Pro., that allows you to create a Bookmark Report. You might see if that does the trick.

  • How to create dynamic links in one page with div panels

    HI
    I am using Dreamweaver CS3 with developer toolbox.
    I have a PHP page where I have two separated tabbed div
    panels.
    I want to show dynamic summary of data from database in one
    panel.
    In the other panel I have a table with dynamic text.
    I want to click on a link in the first panel with the summary
    data and see the whole record in the other panel table.
    How do I tell the dynamic link to send the wuery and show the
    data in the detailed panel without having to reload the whole page.
    I hope I am clear enough....
    Idan Agmon

    I asked something similar to this last week and was told by
    others much more experienced that it couldn't be done. Hopefully
    your quest will yield something.

  • How to generate dynamic table in JSPX page?(Use ADF to realize OAF)

    Dear all,
    My requirment is to realized the a EBS standard OAF page(PDH module) function by ADF technique. The key point is to realize Dynamic Search Layout and Dynamic Result Table Layout by ADF.
    If anyone who is skill at OAF and ADF, proficient in PDH module is prefered, your question will be highly appreciated.
    Because it is hard to paste image into this thread, so I will appreciate it very much if you can refer the attachment ifile of SR 3-1397372841 for detail information. Sorry for the trouble, I really thanks for your help.
    Edited by: user12264776 on 2010/02/22 17:32

    Hi,
    Thanks for the quick reply. I am using JSF for my ADF application.Could u please elaborate how to use the PhaseListener for Auditing user navigation?
    Arijit

  • How to create menu bar in jsp page using struts-tles

    I have started working with struts-tiles. I want to create menu bar using struts-tiles. please guide me.

    I've done this very recently. In fact, tiles has very little to do with the menu itself.
    In your layout, define where you want the menu to go.
    <tiles:insert attribute="menu" />Now, in the actual file, create your menu structure. This part is up to you. I've used http://www.brainjar.com/ as a starting point for the client side actions.
    On my menu page, I call a method on a custom object that returns the menu bar object. Currently, I'm working on putting this menu into some sort of cached object so it doesn't have to rebuild it on every page request.
    Perhaps I've misread your post and you're looking to use tiles, in and of itself, to simulate menus? Otherwise, I hope my post helps.

  • How to create Dynamic Table with more than one column?

    Hi,
    I'm trying to learn Dreamweaver. I'm trying to display 2 units from my database in the same row then I would like go to next row.
    By default DW shows single record in each row. Is it possible to display more than one?
    Thank you

    Of course. You will not name the divs differently, they will all be <div class="RowContainer">  (in the example below) and the reason they will look like
    1 2
    3 4
    5 6
    is because they will "stack themselves up". That is, the first will float to the top left, the next will float up next to it. The third will not fit on the top line floating next to two, so it will start a new row. Four will float up next to it, and five will start the new row.
    Think of the string of divs (don't put wordspaces between them...) as a continuous ribbon or chain of divs. That is a slightly poor analogy, since the second and third won't be next to each other, as a chain or a ribbon might be. But you should be able to have as many divs as you have records... you define the div in the CSS and in your page markup really only show one div.
    Here's a modified example from one of my files:
    <div spry:region="ds1" class="...">
      <div spry:repeat="ds1" class="RowContainer"> <!--this is the div that you would style to float -->
        {category} {title} {medium}<br>
         {price} {sold} {date}<br>
         {sold_to_purchase_price}
      </div>
    </div>
    Beth

  • How to Create a Table Component Dynamically based on the Need

    Hello all,
    I have a problem i need to create dynamically tables based on the no of records in the database. How can i create the table object using java code.
    Please help.

    Winston's blog will probably be helpful:
    How to create a table component dynamically:
    http://blogs.sun.com/roller/page/winston?entry=creating_dynamic_table
    Adding components to a dynamically created table
    http://blogs.sun.com/roller/page/winston?entry=dynamic_button_table
    Lark
    Creator Team

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • How to create a Table of content in pages?

    I am using iPad pages, and figuring out how to create a table of content.

    I would say: Try and Error. Create a copy of your document and unmark in the copied document in the document inspector all boxes for the TOC. Then mark them again. Maybe you should also delete the paragraph styles and mark them again. If that doesn't work, try to copy the complete text of your document to a new created one. Maybe that works.
    Good luck!
    P.S.: If that doesn't work look here. Maybe this helps.

Maybe you are looking for