How to add row of text box and combox dynamically using struts......!!!!!!!

Hi All,
In my JSP I have something like a row of TextBox-----Combox-----TextBox Button--Add
When user clicks on "Add" I need to add exactly the same row as above.
I am using struts and have following code
My jsp
<html:text property="paramName" size="20" maxlength="50"/>  
<html:select property="paramTypeId">
   <html:options collection="queryReturnType" property="value" labelProperty="label" />
</html:select>   
<html:text property="paramDefault" size="20" maxlength="50"/>  
<html:button property="buttonAdd" style="cursor:pointer" onclick="addRow()"> <bean:message key='button.add'/>  /html:button>  
My actionForm
     private String[] paramName;
     private int[] paramTypeId;
     private String[] paramDefault;
//having getter and setter method also for these three attibutesPlease help....it would be of great help if some one can give me a java script of code for adding a row like I mentioned above....!!!
Thanks

Hi inryji.
Thanks for your reply..!!!
I have written the below method to add a row and its adding also.
But when I submit the form....value for combox is not going to the newly addedd row.
here is my jsp code...
<table border="0" width="75%" cellspacing="1" id="myTable">
<tbody>
<tr>
     <td width="80%" class="evencellleft">
          <html:text property="paramName" size="20" maxlength="50"/>  
          <html:select property="paramTypeId">
               <html:options collection="queryReturnType" property="value" labelProperty="label" />
          </html:select>   
          <html:text property="paramDefault" size="20" maxlength="50"/>  
          <html:button property="buttonAdd" style="cursor:pointer" onclick="addRow()"> <bean:message key='button.add'/>  </html:button>  
          <html:button property="buttonDelete" style="cursor:pointer" onclick="removeRow()"><bean:message key='button.delete'/>  </html:button>
     </td>
</tr>
</tbody>
</table>
here is my java script code...
function addRow() {
     var tbody = document.getElementById('myTable').getElementsByTagName("TBODY")[0];
     var row = document.createElement("<tr>");
     var td1 = document.createElement("<td width='80%' class='evencellleft'>");
     td1.innerHTML+="   ";
     var myElement1 = document.getElementById('paramName');
     var el1 = myElement1.cloneNode(true);
     el1.id = "";
     td1.appendChild(el1);
     td1.innerHTML+="   ";
     var myElement2 = document.getElementById('queryReturnTypeId');
     var el2 = myElement2.cloneNode(true);
     el2.id = "";
     td1.appendChild(el2);
     td1.innerHTML+="    ";
     var myElement3 = document.getElementById('paramDefault');
     var el3 = myElement3.cloneNode(true);
     el3.id = "";
     td1.appendChild(el3);
     row.appendChild(td1);
     tbody.appendChild(row);
}Please help...!!!

Similar Messages

  • How can I autosize a text box and when I change text the objects below it got auto pushed down and up?

    Now the text box seems at absolutely position and fixed size.
    What I need is when I change text it grows or shrinks accordingly. And all objects after it also move up or down. How can I do that?
    Thanks.

    The Text will not scale with the Textbox.
    Peter

  • How to add a single check box and a label to a image in Muse?

    Hello!
    I need help with adding a check box with a label to the right of it. I know about the forms, and how you can add a check box there but i don't need all the other form options.

    Hi
    It is not possible to use only checkbox from a form at the moment. An alternate way could be inserting it using html, something like below
    <input type="checkbox" name="Muse" value="Muse"> A sample checkbox<br>
    I am not sure what exactly you are trying to achieve, but this will work  with Form tag only, like in the example here
    Tryit Editor v2.5
    Do let me know if you have any question.

  • I created a 5x7 postcard document in Word with text boxes and graphics.  When I converted it to PDF, some of the items were missing, even though they were in the boundaries of the page and looked fine on the Word document.  What happened, and how do I fix

    I created a 5x7 postcard document in Word with text boxes and graphics.  When I converted it to PDF, some of the items were missing, even though they were in the boundaries of the page and looked fine on the Word document.  What happened, and how do I fix it?  I'm trying to upload the PDF version to Vistaprint.  Thanks.

    Reader doesn’t create pdf files. You can use Acrobat (ask in that forum) to create pdfs. You can subscribe to the Adobe PDF Pack which has a create pdf functionality (please ask in that forum), or you can use a third party utility such as ghostscript, cutepdf, or Microsoft’s own PDF creation capability. For third party pdf creation you will need to ask in a forum dedicated to that software as fellow users of Reader are unlikely to have the knowledge to help.

  • How to copy/paste anchor text box to its anchor point in text and delete all empty anchors?

    hi all
    i have a document of few pages but one story. The right column is the main text box and on many places anchored text boxes are placed which appeared on the left column as shown below.
    i want text of each anchor-text-box to be cut from its place and paste at its insertion/anchor point and delete all empty anchored boxes.
    I am trying since morning but i unable to reach anchor object reference. Any help on how to start with will be helpful.
    virender

    Ok, let's say you have one main text box (not anchored) and three text boxes that are anchored to text within it. The first one is anchored with text, the second one is unanchored, and the third one is empty (I'm not going to get into inline anchoring vs. custom anchoring since you didn't bring it up in your post).
    We cycle through the items on the page:
    function main(){
      var myDoc = app.activeDocument;
      var myPages = myDoc.pages.everyItem().getElements();
      for (var i = 0; i < myPages.length; i++){
        var myPage = myPages[i];
        //Checks that the page is valid, and that it is not a master page. If either is true, skips to the next page.
        if (myPage.isValid == false) continue;
        if (myPage.parent instanceof MasterSpread) continue;
        var myItems = myPage.allPageItems;
        for (var j = 0; j < myItems.length; j++){
          //Current item.
          var myItem = myItems[j];
          //If myItem doesn't have a Character parent, it is not anchored.
          //The first and third text frames would fail this test.
          if (!(myItem.parent instanceof Character)) continue;
          //We only care about text frames.
          if (!(myItem instanceof TextFrame)) continue;
          //I think the only way this would happen would be if you had an image or
          //something else unexpected within the frame. I check for it so no content
          //is inadvertently lost.
          else if (myItem.texts.length > 1) continue;
          //If we're still in this iteration of the loop, all qualifications are met.
          //Flatten the text frame.
          //I don't use layers that often so, to me, flatten makes sense. You may want
          //to use a different term if there's a chance for confusion.
          flattenItem(myItem);
    function flattenItem(funcItem)
         //Hold onto the anchor character.
        var myParent = funcItem.parent;
         //Duplicate the text from within the frame so that it appears right after the anchor.
         //There may be other methods, but this works for me. I try to avoid copy/paste
         //so as not to deal with any clipboard mishaps. I added a check in case of empties.
         if (funcItem.texts.length > 0){funcItem.texts[0].duplicate(LocationOptions.AFTER, myParent.insertionPoints[0]);}
         //Replace the anchor character itself with a space (or whatever) which also
         //deletes the text frame it was anchoring.
        myParent.contents = " ";
    I guess the takeaway might be that you're not looking at the main text frame and then checking to see if anything is anchored to it. You're looking at each text frame and figuring out if it is anchored. That's my approach, anyway.

  • How to get the text boxes and select lists dynamically?

    Hi,
    I have a requirement such that I need to create the text boxes and select lists depending on the user input at the run time. It means that if the user requires four text boxes/select lists then I need to have 4 such thing. If the user need 6 then I need to have 6.
    The design may be such that initially only one text box/select list will be available when the page launches. Then as ad when the user asks for more those will be available to the user accordingly.
    regards,
    Dipankar.

    You can use Ajax to call textboxes and select list based on what user enters.
    Otherwise make those items conditional and based on what user enters you can display textbox or select list.
    You can call Single Textbox and Select List using Ajax for any number of conditions.
    Regards
    Chandra

  • How can i pin a text box to the bottom of a VBOX

    Hi,
    Thank you in advance for your time, the question is how do i pin a text box to the bottom of a VBox, i dont know what code to add kindly help me out. The code i have with me is
    VBox {
    translateX: 10
    translateY: 10
    spacing: 20
    content: [
    Label {
    text: "TextBox:"
    TextBox {
    layoutInfo: LayoutInfo { minWidth: 100 width: 150 maxWidth: 200 }
    ] //contents
    //VBox
    now the text box has to go to the bottom of the VBox even if the VBox has other objects or if its resized.
    Regards,
    Kibu

    Vbox, acts much like a linear layout like in other languages.
    Just keep your declared textbox at the bottom of your content (content :[] ), then the text box will continue to get pushed further down your view, as you add other controls to your content.
    layoutX and layoutY will just increase your spacing from the previous declared control in that content.

  • Text box and radiobutton in smartforms

    Dear Friends,
    How to use text boxes and radiobuttons provided in web properties tab  of text  in smartforms.
    Please give some code if possible .
    Neetesh

    Hi Neetesh,
    U can add text box using  using TEMPLATE.
    right click on a window node->create->template
    You should be able to do that even outside a table / template object.
    However, if you have a tabular format to display and your data is in a internal table, you go for a table object.
    If you don't have the data in a internal table, you usually go for a TEMPLATE object
    Regard,
    Priyanka.

  • Master's w/black text box and foreign language

    How do I edit the text box in a master, its black, i want something like a grey background.  Why is the default text a foreign language...  Is there a way to change the border or page colors.  Its currently white, can I do something like grey

    Are you trying to create a photobook?
    The backgrounds of the text fields are defined by the theme. You have to find a theme with a color you like. You can only switch between the default color and transparent. If I want a different background I add a picture with constant color and add a textfield with transparent background  on top.
    The foreign language is a kind of latin. It is this way to help you to easily recognize that you need to enter your own text instead of the default text.
    What you can change in a theme, widely depends on the theme you selected. To modify the elements, click "Edit Layout".
    Then click the "fan"-button to select a background.
    If you want more control over the themes, you need to manually edit the theme files in the Library.
    Regards
    Léonie

  • How to add rows using DefaultTableModel?

    I'm trying to figure out the ins-and-outs of creating a dynamic table.
    I looked for a tutorial, but none of the example programs I found dealt with my particular issue, nor did they explain anything.
    For instance, most of the examples looked like this:
            table = new JTable();
            defaultModel = new DefaultTableModel(10,5);
            setModel(defaultModel);But that doesn't work for me -- I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem.
              public MyTableModel() {
                            super(data, columnNames);
                    ...The above code complains that "you can't access data or columnNames until you call super()!"
    But I've seen plenty of example code that DOES send in parameters to super(). How do they get away with that? Is it because they are parameters to the constructor, whereas private/public members of the class are somehow different?
    I thought a variable is a variable -- why is one allowed but not the other?
    Lastly, I'm trying to figure out, practically speaking, how to load a database with X items, and be able to add rows later. Does that mean I need to use a vector for my data instead of Object[][]?
    I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables -- is there any difference between them as far as dynamic tables are concerned?
    I was under the impression that I needed to "switch" from ADM to DTM if I wanted to be able to add rows to my table at runtime.
    Here are some references to previous discussions I found/participated in on this topic:
    http://forum.java.sun.com/thread.jspa?threadID=5224966
    http://forum.java.sun.com/thread.jspa?threadID=439141&start=0&tstart=0
    Thanks in advance for any help,
    Matthew

    -> I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem
    Well, you would pass in the data and columnNames as parameter when you create your table model.
    -> Lastly, I'm trying to figure out, practically speaking, how to load a
    -> database with X items, and be able to add rows later. Does that
    -> mean I need to use a vector for my data instead of Object[][]?
    You just said you extended DefaultTableModel. Well you don't need to do anything it already manages the data for you. You just use the methods provided to update and change the data.
    -> I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables
    No you haven't. You really don't understand what an AbstractDataModel is do you? Its nothing. You can't use it. It doesn't have any storage for the data, and since there is no data storage you can't access the data or change it. You can't even create an AbstractTableModel. Read your Java text on what an Abstract class it.
    The DefaultTableModel extends the AbstractTableModel to provide data storage and ways to get the data and change the data. It notifies the table when any change is made to the data so the table can repaint itself.
    -> How to add rows using DefaultTableModel?
    Finally, the DTM provides methods that make the model dynamic. Methods for adding and removing rows or adding and removing columns. Read the API for more information.
    If you still don't understand how how the methods work then search the forum for examples that use the methods you don't understand. I've posted an example the uses the methods required to add rows or columns.

  • How can I make a text box in Aperture transparent??

    Hello,
    After a great trip to Thailand I want to make a book of all my pictures using Aperture 3. At some places in the book I use a title to indicate what will be shown on the image. This title is made by the text box and it is put on the image itself. Now what I would like is to make is a transparent bar of the text box, so that I still can see the details of the image through this bar and also read the text about the image easily.
    I have no problems making this text box and putting it in the right place, the thing that I don't understand, after two nights of trying, is how to make this text box transparent.
    Any help is appreciated!
    Thanks in advance!

    Perhaps I need to reformulate what I exactly want to do...!
    I would like to use transparent text boxes but not as transparent as the image itself. I want to show the text box as a real bar but slightly different than the original image colour. So something between a normal image and a white bar so that it will be a bit transparent but also shown as a real bar..
    I think the text boxes of each theme are identical, so yes you are right about the transparent text boxes of art collection but they are the same as photo essay.
    Do you understand what I mean?

  • How do I turn off text box in pages?

    how do I turn off text box in pages?

    Thank you Peter and Jerry.
    Screen shot above. I know it's not much, but there it is.
    In actual fact I can make the text box bigger, but I just want to have the option of not having a text box.
    It should be simple, and not actually need a screen shot: just simple instructions. It seems pretty fundamental to me.  Does anyone know how to do this?
    Best, Angela

  • How to enter values in JList box and JTable ???

    Hi friends...
    i am new to Swing
    SInce i am using Netbeans IDE 5.5
    and there is easy to do swing programming using this IDE
    now i am confused using JTable and JList box
    since i used method Insert in AWT
    but how to add values in LIST BOX ( JList )
    ex.
    JList list = new JList( );
    list.add(mystringvalue, ? );
    here it ask for component so what should i write here..
    when i write here this, gives error.
    what to do to insert string or vector or object in JList
    and to enter value in JTable
    THanks

    hi Ghanshyam,
    i am also new to swing i was just wondering are you using the swing palette to create your interface
    by the look of the code
    JList list = new JList( );
    list.add(mystringvalue, ? );you may not be because every JList is put in a JScrollPane
    but if you do want to do it through the palette there is an option in properties - model which you can uses to add in values.
    and if your looking to get info. from a database look up
    AbstractListModel &
    AbstractTableModel
    the is a lot of info on the internet (example net beans CarTableModel) is a
    good start off
    happy hunting.
    JJ

  • Converting images that include text boxes and callouts in FM

    Hello,
    I'm on a new project (TCS 3.5, RH 9, FM 10) that requires me to include text boxes and lines (callouts) on top / in front of many of the images in FM. The reason they are not allowing me to add the text/callouts to the images themselves is because they want to keep the text boxes editable for translation.
    The problem: After importing into RH, these images have white borders on all sides that they didn't have previously and I can't figure out what's causing it.
    When I remove the text/callouts from over the images in question, then reimport, the problem resolves and the white borders disappear. When I view the original image files, there are no borders present. After I import, I view the image file in the RH folder and it does include the border. (So the border is on the image itself.)
    Presently, the Object Properties for the images are as follows:
    Offset From:
    Top: 0.0"
    Left: 0.0"
    Border Width: 0.015 (which is lowest FM allows me to set... I get an error message when I try to enter 0.0)
    Anchored Frame settings:
    Anchoring Position: Below Current Line
    Alignment: Left
    Cropped/Floating: both unchecked
    I've tried many different variations and tests; probably too many to list here. In short, the "border" appears when there is text/callouts on the image and it disappears when I delete the text/callouts. I was hoping that someone may have had a similar issue. Please let me know if you need more info to troubleshoot and thanks for reading.
    Best,
    Tom

    I had the same problem with callouts, but my solution was to add them directly to the image, so that doesn't help you.
    Another things you can try to is ensure that the edges of the image do not touch the edges of the anchored frame. Make sure there is a bit of white space. I don't know why, but when any of my images touch the anchored frame, the conversion looks awful.
    Also, my images appeared best in Robohelp when I set the properties for the image in Robohelp as follows:
    File > Project Settings
    Import tab
    Edit conversion settings for FrameMaker documents
    On the left side, select Image
    Set Width and Height to 0pt (this ensures that the image is not resized)

  • How to recognize the linked text boxes in In Design

    How to recognize the linked text boxes in In Design? I mean is there any indication, where I will come to know so an so tex boxes are linked together?
    Thanks in advance.

    HI Peter,
    well In Quark Express as as wrote earlier, that you can see other text frames highlighted immediately, after you select any of the text frame among the threaded text frames, say there are 5 text frames which are threaded together, even if I click on 2 nd or say 4th text frame, it shows me all the text frames highlighted which are threaded together, so If I am working in a catalog which has multiple pages, it's easy for me to see which text frames are threaded together, as if you make any text changes, say add or delete text in a text frame, the other text frames get affected by that. I mean text shifts accordingly, it's easy to track in Quark which text frames will get affected if I change something in a threaded frame.
    Anyways, it seems this option is not available in In Design. That's fine. I am not in preview or Overprint previed mode.
    Thanks for your help.

Maybe you are looking for