Dynamic adding a textfield

Hi!
I am new to struts and JSP!
So i am developing a webapplikation with that.
Now, i want a dynamic change of a form!
For example: Click on add and a new textfield or a new select will be created.
How can i do that? And how to solve the form.properties problem in the struts-config file, because they are not fixed when i could change the form dynamicly!
Thank u for ur help!

In general, when i need to attach a font, i don't add it to
the library. What I do is to create some text dummy text fields
with the fonts embedded. This gives me less font issues.
This also allows me to see clearly that i embedded all
variations of the font (regular, bold, italic, italic bold,
etc).

Similar Messages

  • Why data are not getting poulated in dynamically added tab in a tab navigator???

    Hi All,
    I am facing a very strange problem and need you expert opinion on this. Ok so the problem goes like this:
    In my application i have a tab navigator where i have 2 fixed tabs say tab A and tab B. In tab B I have a data grid where All the user name are getting populated. Once the user clicks on any datagrid row i am dynamically adding a new tab based on username , so if in my datagrid u1,u2 and u3 are getting displayed then once you clik on u1 a new tab called u1 is getting displayed. Code for this goes like this:
    var vbox1: VBox= new VBox();
    box1.label=mydatagrid.selectedItem.uName;
    var sde:* = new searchDetails();
    vbox1.addChild(sde);
    myTabnavigator.addChild(vBox1);
    Application.application.searchdetails.displayall();
    I have created a component called searchDetails where i have designed the page wit various fields for this tab.This also has a method called displayall() which is populating the data in all fields using php an my sql where i have designed the page wit various fields for this tab.
    New tab is getting displayed perfectly. My problem is once the tab is getting displayed fields are not getting populated with data.
    Please let me know what wrong i am doing. I am really struggling

    Hmm.. you have to assign text to the labelfields on creation complete not before that, the fllow will be like this
    var vbox1: VBox= new VBox();
    var sde:* = new searchDetails();
    vbox1.addEventListener(creationcompleteevent,function);
    vbox1.addChild(sde);
    myTabnavigator.addChild(vBox1);
    function(e:event):void{
    box1.label = "text";

  • Reading the Data from dynamically added rows of a table...

    Hi,
                  I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code).  I have to fech these data into an internal table. But I can read only the first row data..
                  Also While adding rows dynamically the same data is repeating for the consecutive rows..
                  I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
    1) How to solve repeatative data while adding rows..?
    2) How to read dynamically added row data during runtime into internal table..?
    Thanks,
    Surya.

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Dynamic adding of components (doesn't work when programmatically)

    Hi, I don't understand, why this doesn't work. I'll explain it on this example:
    import java.util.concurrent.ScheduledThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    public class NewFXMain extends Application {
        Group root;
        public static void main(String[] args) {
            Application.launch(NewFXMain.class, args);
        @Override
        public void start(Stage primaryStage) {
            primaryStage.setTitle("Hello World");
            root = new Group();
            Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
            Button btn = new Button();
            btn.setLayoutX(100);
            btn.setLayoutY(80);
            btn.setText("Add button now");
            btn.setOnAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                    addButton();
            root.getChildren().add(btn);  
            primaryStage.setScene(scene);
            primaryStage.setVisible(true);
            System.err.println("Number of buttons before: "+root.getChildren().size());
            ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
            executor.schedule(new MyTask(), 5, TimeUnit.SECONDS);
        private void addButton() {
            System.err.println("Button adding");
            root.getChildren().add(new Button("YEAH"));
            System.err.println("Number of buttons after: "+root.getChildren().size());
        class MyTask implements Runnable {
            public void run() {
                addButton();
    }There are two ways how a new button can be added. Either by clicking on existing button or programmatically by the program itself after 5 seconds.
    If you add it by button, there is no problem. The error print is:
    Number of buttons before: 1
    Button adding
    Number of buttons after: 2
    But if you just wait, then the error print is:
    Number of buttons before: 1
    Button adding
    and no button is added. In fact, the error printing after the adding isn't performed either.
    I'd like to ask if there is some solution for this because I'd love to do some changes by schedulers. Thx
    Edited by: 876949 on 14.8.2011 9:09
    Edited by: 876949 on 14.8.2011 9:11

    No, these are not error messages, they are just for purpose of example. Here it doesn't matter whether err or out... (yes, 'out' would be better ;)
    But thanx, it's working. By the way, I am creating scheduler for task lists. They are supposed to be printed dynamically in specific time (or periodically). For example: at 5 o'clock I need to print 5 items of some list and every 3 hours I need to print 3 items of another list etc. - so it's quite dynamic with regard to component adding (No, I don't want to use some sort of ListView, I want interactive printing: one item on screen at a moment). I'll try to work your solution into my code.
    Edit: So either it's not possible to use this for the purpose of my app or it will be really cumbersome. Maybe it would be easier to draw some rectangles with mouse listeners...
    Edit: So I finally got around it. In the end, I won't use dynamic adding as intended. It's working and that's important.
    Edited by: 876949 on 14.8.2011 12:48
    Edited by: 876949 on 15.8.2011 5:21

  • Dynamically adding to PDF after applying Extended Reader Rights

    All,
         I've created a PDF with a digital signature in Acrobat X Pro and applied the extended Reader rights. What I am trying (and failing) to do now is add new pages to the PDF via a Java library (BFO) on a server. When a user eventually brings up the PDF in Reader, they receive a warning about how the extended rights have been revoked since the PDF has been modified. Is there any way to maintain the rights while building the PDFs? Or is the only way to dynamically build a PDF with a digital signature that can be user-signed in Reader through the LiveCycle/ADEP services?

    You have to prepare the PDF BEFORE you add the extended Rights.  Once it's been rights enabled, you can't modify it w/o breaking the rights.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Mon, 14 Nov 2011 14:32:38 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Dynamically adding to PDF after applying Extended Reader Rights
    Dynamically adding to PDF after applying Extended Reader Rights
    created by j.ross.e<http://forums.adobe.com/people/j.ross.e> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4025497#4025497

  • Passing values to form bean string array from dynamic added textboxes

    Hi,
    I am unable to pass values to form bean string array from a jsp in which I have incorporated dynamically adding of textboxes in javascript.
    I have given add/delete row option in the jsp. If there is single row, this is working fine. But after adding a row, I am not able to either do any validations on added textboxes or pass the values to the String array form bean variable.
    code snippet:
    var cell6 = row.insertCell(4);
    var element5 = document.createElement("input");
    element5.type = "text";
    element5.className = "formtext1";
    element5.size = "5";
    element5.value = "00.00";
    element5.name= "qty"; // this is a string array of the form bean.
    element5.onchange=function() {checkNumeric(this);};
    cell6.appendChild(element5);
    <html:text styleClass="formtext1" property="qty" value="" size="5" styleId="qty" onchange="checkNumeric(this)"/></td>
    form bean declaration
    private String[] qty; Please help.
    Edited by: j2eefresher on Jan 12, 2010 11:23 PM

    Shivanand,
    There's no need to post that much code when you could create a very short test case that demonstrates only the problem you are having.
    You're using &NAME. notation on something that isn't a page or application item. You can't reference PL/SQL variables that way (or any other way) outside the PL/SQL scope. For your situation, you could create a page item named P55_DOCID and assign it a value in the PL/SQL process (:P55_DOCID := DOCID;), then reference &P55_DOCID. in HTML areas like the success message.
    Scott

  • Add null rows in WDDOINIT  for fetching data from dynamically added rows..

    Hi,,
    I have to fetch data from a dynamically added rows of a table.
    I have followed / gone through many forums but they ddnot mention how to add null rows in the initialization method..
    I am using WD Abap..
    Can anyone help how to bind null rows in WDDOINIT method..?
    Thanks,
    Surya

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Dynamically adding more attributes to cube dimension in SSAS 2008 R2

    I need to dynamically add more attributes to cube dimension in SSAS 2008 R2 because the dimension table the cube is based on is updated using dynamic pivoting and there is need to update the cube dimension attributes as more columns are added to the dimension
    table without making the changes through BIDS. Is there a way to dynamically adding more attributes to cube dimension in SSAS 2008 R2?
    Thanks
    BI Developer

    Definitely. You can use AMO to add dimension attributes on the server. I have definitely done this a few times for different clients of mine. Here is a generic AMO sample:
    http://msftasprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_AMOAdventureWorks&referringTitle=Home
    Notice the parts which add attributes to a dimension.
    http://artisconsulting.com/Blogs/GregGalloway

  • Dynamically adding a column to a jtable - simple & urgent

    I am new to using JTables.
    I have read the tutorial and looked at several examples, but I am still confused as to how to add/remove columns and how to add rows to the table.
    I want to have a totally dynamic table which will allow me to add/remove columns and to add rows.
    The table gets the data to be displayed (and the column header values) from an outside object. I thought about writing my own table model.
    Here is the code for my simple table model:
    import javax.swing.table.*;
    import java.util.Vector;
    public class MyTableModel extends AbstractTableModel{
       private Vector columnHeaders;
       private Vector data;
       // simple constructor
       public MyTableModel() {
          columnHeaders = new Vector();
          data = new Vector();  // data is a vector of vectors
       public int getColumnCount() {
          return columnHeaders.size();
       public int getRowCount() {
          if (data.size() == 0) {
              return 0;
          Vector columnData = (Vector)data.elementAt(0);
          return columnData.size();
       public Object getValueAt(int row, int column) {
          Vector columnData = (Vector)data.elementAt(column);
          return columnData.elementAt(row);
       // the method I call for dynamically adding a new empty column
       public void addNewEmptyColumn(String value) {
           columnHeaders.add(value);
           fireTableStructureChanged();
    }Here is how I use the table model with my table
    import javax.swing.*;
    public class Demo extends JFrame{
        private JTable table;
        public Demo() {
            super("test");
            table = new JTable(new MyTableModel());
            getContentPane().add(table);
            pack();
            show();
        public void addColumn(String value) {
            MyTableModel model = (MyTableModel)table.getModel();
            model.addNewEmptyColumn(value);
        public static void main(String[] args) {
            Demo demo = new Demo();
            // here I am trying to add columns...
            demo.addColumn("one");
            demo.addColumn("two");
    }I try to add columns, but nothing happens!!!
    What am I doing wrong?
    I would appreciate if someone who take himself/herslef to be a JTable expert could give me his/her e-mail and this way I won't bother the rest of the world with my stupid JTable questions...
    Sincerely
    Nir

    I have another question.
    What if I want to render the table headers in a certain way.
    I would like to use:
    TableColumn's setHeaderRenderer(TableCellRenderer headerRenderer).
    But in order to do it, I need to get a TableColumn.
    How do I get it from the model?
    I thought about subclassing JTable and overriding:
    public void tableChanged(TableModelEvent e)that function is called everytime I invoke fireTableStructureChanged().
    In that function, I am assuming that a column has been added, however, when I query for JTable's getColumnCount(), I keep getting 0!

  • Achieve the tab order for dynamically added section

    Hi friends,
    I'm facing the issue with tab order.
    How to achieve the tab order for dynamically added sections?
    Could you Plaese suggest me in this.
    Thanks,
    Susila S

    Hi,
    Thanks for your reply.
    Ya. I'm adding rows in a table dynamically which is grouped in a subform which is flowable and the buttons are placed in the same subform. At the end of the row I'm having the hidden fields.
    So what I want is without focusing the tab on hidden field I want to traverse the first field of the next dynamic row. For that I have used the access property as protected on hidden field, but its not working properly.
    Please help me on this ASAP.

  • How to reference a dynamically added field

    I'm trying to set the value of a field that was dynamically added as part of a table section and I can't figure out how.
    The table section is added by clicking on a button and that works just fine. I can access any field value in the table section that has the instance '0'. But I can't seem to figure out how to access field values from any other instances of this table section.
    Here's the hierarchy of one of the fields:
    TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection.Row8.dteFormedD ateDevMem
    Where 'MemberSection' is the section of rows the button will add an instance of. Now, I can access the value of the date field for the first instance of 'MemberSection' with the following:
    DeveloperIdentityTbl.MemberSection.Row8.dteFormedDateDevMem.rawValue
    If I want to do the same thing say for the 3rd instance of the 'MemberSection', how would I do that?
    Thanks for the help!!
    Marc

    Hi,
    WhyIsThisMe is correct. You must reference the instance of the repeating 'MemberSection' by its index. Otherwise (as you have found) it defaults to the 1st instance.  Sounds easy, right? Well...
    Truth be told, this will depend on the scripting language you have chosen. The actual refernce syntax used for formCalc and javaScript is considerably different.
    WhyIsThisMe's reference:
         TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection[2].Row8.dteFor medDateDevMem
    should work for formCalc, but it won't for javaScript. For that you would need to use resolveNode()
    var indx = 2;  // you probably will be selecting a differnt row under different circumstances, right? So, assign the index value to a variable
    or instead
    var indx = 0;
    if(condition){indx= 2;}
    else if(condition){indx= 3;}  //you get the idea
    //then you would do the assigning the value using resolveNode() by building the string that goes inside the ():
    xfa.resolveNode("TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSectio n[" + indx + "].Row8.dteFormedDateDevMem").rawValue  
    //you're building a string in javaScript, so the + is used. There are 3 parts to the final string for the resolveNode().   finalString = "part1" + indx + "part3"
    ////////////////////////////////////////////  Still with me?  I usually opt for formCalc when referencing instances, since it is generally more forgiving
    // In formCalc, 1st assign an index value to variable.
    var indx = 0;
    if(condition)then
         indx= 2
    elseif(condition)then
         indx= 3   //you get the idea
    endif
    // then, use that variable to reference the instance of 'MemberSection'  //resolveNode() not needed in formCalc
    TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection[indx].Row8.dteF ormedDateDevMem
    Good luck!
    Stephen

  • Dynamically adding listeners

    Hi,
    I have a problem with defining some dynamic buttons in my Swing application. I could have posted it on the Swing forum, but it's actually an 'inner class' scoping problem, so I figured I'd best post it here:
    I want to do something like this:
    String[] buttons = getButtonNames(); // array of buttons
    for (int i=0; i<buttons.length; i++)
    JButton jButton = new JButton();
    // give each dynamically added button its own actionlistener
    jButton.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    performAction(buttons);
    jButton.setText(buttons[i]);
    buttonPanel.add(jButton, null);
    This won't work. ('must be declared final blabla'..)
    But I can't declare both buttons and i final, since i will be modified in the loop. So I guess using buttons[i] like this is not possible.
    How can I accomplish this?
    (If you think this should've been posted in the Swing forum, regardless of my reason for posting it here, please say so, and I'll repost it there.)
    Greetings,
    Ivo

    Well,
    it's actually a multitier application, and the client does not know anything about the buttons other than the name. It needs to call some function on the middle tier and pass what button was clicked. I'd rather not to it statically by predefining the listeners, since that would require a change and a rebuild of my client when I add a new buttontype to the middle tier.
    Anyone know how to do it dynamically?
    Greetings,
    Ivo

  • Setting dynamic widths for textfields in as3?

    I have 3 textfields. they're in a sprite container. 1. date 2. pipe_mc movieclip 3. title field. I need to set it so that the textfield/mc/textfield;s x property changes dynamically when a shorter or longer date gets added into the field, via XML.
    Here is the code:
    addChild(dateline);
    dateline.addChild(date_txt);
    dateline.addChild(title_txt);
    dateline.addChild(pipe_mc);
    date_txt.x = 3;
    var spacer:Number = 10;
    if (date_txt.textWidth >= 90) {
    pipe_mc.x = date_txt.x + date_txt.width + 18;
    title_txt.x = pipe_mc.x + pipe_mc.width + spacer;
    else if (date_txt.textWidth <= 90) {
    pipe_mc.x = date_txt.x + date_txt.width - 18;
    title_txt.x = pipe_mc.x + pipe_mc.width + spacer;
    pipe_mc.visible = true;
    Any help or suggestions are welcome
    Thanks

    Do you have the textfield set up to be autoSized?  Is there a reason for having three textfields separate rather than combining the text into one textfield with sufficient spacing between the entries?

  • Scrollbar doesn't show up on the panel while dynamically adding JTextFields

    I have a dynamic user iterface, where the JTextFields are added dynamically to a JPanel within the JFrame upon the click of a JButton. How do I use the JScrollPane so that the Vertical Scroll bar shows up for the JPanel as soon added TextFields go out of range? The Panel has a null layout coz I want the textfields at specific positions on the panel. The problem lies in showing the Vertical scroll bar once the text fields in the JPanel exceeds the Panel's size. The scrolls don't seem to show up. Please help!
    public Scenario() // Constructor
    textPanel = new JPanel();
    textPanel.setLayout(null);
    textPanel.setSize(508, 520);
    textPanel.setLocation(10,10);
    //..........lines of code
    public void addComponent(String text)
    j = j + 30;
    i = i+1;
    String lineno = Integer.toString(i) + ".";
    field = new JLabel(lineno);
    field.setBounds(90,j,20,24);
    textPanel.add(field);
    if (addline){
    content = new JTextField(text);
    content.setBounds(108,j,400,24);
    content.setBackground(new Color(255,255,255));
    textPanel.add(content);
    addline = false;
    invscenario = false;
    else if(invscenario) {
    content = new JTextField(text);
    content.setBounds(108,j,50,24);
    content.setEditable(false);
    textPanel.add(content);
    try{
    if (content.getText().length()!= 0)
    Statement statement1 = conn.createStatement();
    String query1 = "SELECT * FROM scenario " + "WHERE scenario_num LIKE '" + text + "'";
    rs = statement1.executeQuery(query1);
    rs.next();
    int recordNumber = rs.getInt(1);
    if(recordNumber != 0)
    labelcontent = new JLabel(rs.getString(3));
    labelcontent.setBounds(165,j,100,24);
    textPanel.add(labelcontent);
    }// end try
    catch(SQLException e)
    System.out.println(e);
    invscenario = false;
    addline = false;
    scrollPane = new JScrollPane(textPanel);
    scrollPane.add(textPanel);
    contentPane.add(scrollPane);
    contentPane.repaint();
    show();

    I guess since you don't have a layoutmanager you have to set the viewport dimensions of your JScrollPane manually.
    Try something like
    scrollPane.getViewport().reshape(....);
    zk

  • Design problem with dynamically added row in datatable

    Hello all,
    I have a dataTable and have developped a method that dynamically adds rows to the dataTable. Each row is made up of two form controls. The problem I have now is that I don't know how to retrieve the values from the mutiple rows. Ideally I would need the values to be stored into a list.
    Can anyone help?
    Thanks in advance,
    Julien.
    Here is my code:
    <h:dataTable var="line" binding="#{TradeClientsAndQuantitiesBean.clientsAndQuantities}"  value="#{TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="S�lectionnez un client"/>
                    </f:facet>
                    <h:selectOneMenu value="#{TradeClientsAndQuantitiesHelperBean.selectedClientTemp}">
                        <f:selectItems value="#{TradeClientsAndQuantitiesHelperBean.concatenatedLabelMap}"/>
                    </h:selectOneMenu>
                </h:column>   
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Renseignez une quantit�"/>
                    </f:facet>
                    <h:inputText value=""/>
                </h:column>   
            </h:dataTable>

    The values will just be put in the same row object you added to TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers.
    It might be worth to read this article: http://balusc.xs4all.nl/srv/dev-jep-dat.html

Maybe you are looking for