Number of visible text fields

Hi all,
Trying to upload document numbers from Excel into SAP via transaction F-03 using SAP GUI Scripting.
My approach is to enter values one by one and press Enter when the last visible text field is reached. Then enter another batch of values, press Enter and so on..
The problem is that I do not know how to get that event when the last visible field is reached.
I know the solution but for tables when you can count a number of visible rows (.visibleRowCount).
Thanks in advance.

Hi Dmitry,
in this case, I would proceed as follows:
1. before the position command the system error handling switch off with
on error resume next
2. behind the position command the test of error number with
if err.number < 0 or err.number > 0
For example:
on error resume next
err.clear
'position command from existing script
if err.number > 0 or err.number < 0  then
'processing . . .
end if
on error goto 0
Declaration on the solution: In a non-relevant line will it not work. This one can evaluate it.
Regards,
ScriptMan
Edited by: ScriptMan on Apr 19, 2010 7:36 PM

Similar Messages

  • Hidden/Visible text fields in saved PDF

    I got some very helpful advice yesterday about deleting content from hidden boxes (text fields). I have another related problem that somebody might have an answer for. I have text fields that are hidden or visible depending on selections made in drop-down lists. This is working fine but I've noticed something strange. When a user completes the form, saves it, closes it, and re-opens it--all of the text boxes are visible. Has anyone run across this? If so--is there some script I can add to fix this?
    //Clear out the StaticLocation DropDown list
    StaticLocation.rawValue = "";
    StaticLocation.clearItems();
    switch (this.rawValue)
         case "Top Center  ":
              StaticLocation.addItem("Lower Right");
              StaticLocation.addItem("None");
              break;
         case "Lower Right":
              StaticLocation.addItem("Top Center  ");
              StaticLocation.addItem("None");
              break;     
         case "Top Center":
              StaticLocation.addItem("Lower Left");
              StaticLocation.addItem("None");
              break;
         case "Lower Left":
              StaticLocation.addItem("Top Center");
              StaticLocation.addItem("None");
              break;
    //TextFields 1a-4a
    if (this.rawValue == "Top Center")
         TextField1a.presence = "visible";
    else
         TextField1a.presence = "hidden";
         TextField1a.rawValue = ""; 
    if (this.rawValue == "Lower Left")
         TextField2a.presence = "visible";
    else
         TextField2a.presence = "hidden";
         TextField2a.rawValue = ""; 
    if (this.rawValue == "Top Center  ")
         TextField3a.presence = "visible";
    else
         TextField3a.presence = "hidden";
         TextField3a.rawValue = ""; 
    if (this.rawValue == "Lower Right")
         TextField4a.presence = "visible";
    else
         TextField4a.presence = "hidden";
         TextField4a.rawValue = "";
    //TextFields 1b-4b
    if (this.rawValue == "Top Center")
         TextField1b.presence = "visible";
    else
         TextField1b.presence = "hidden";
         TextField1b.rawValue = "";
    if (this.rawValue == "Lower Left")
         TextField2b.presence = "visible";
    else
         TextField2b.presence = "hidden";
         TextField2b.rawValue = ""; 
    if (this.rawValue == "Top Center  ")
         TextField3b.presence = "visible";
    else
         TextField3b.presence = "hidden";
         TextField3b.rawValue = "";
    if (this.rawValue == "Lower Right")
         TextField4b.presence = "visible";
    else
         TextField4b.presence = "hidden";
         TextField4b.rawValue = ""; 
    //TextFields 1c-4c
    if (this.rawValue == "Top Center")
         TextField1c.presence = "visible";
    else
         TextField1c.presence = "hidden";
         TextField1c.rawValue = ""; 
    if (this.rawValue == "Lower Left")
         TextField2c.presence = "visible";
    else
         TextField2c.presence = "hidden";
         TextField2c.rawValue = "";
    if (this.rawValue == "Top Center  ")
         TextField3c.presence = "visible";
    else
         TextField3c.presence = "hidden";
         TextField3c.rawValue = "";
    if (this.rawValue == "Lower Right")
         TextField4c.presence = "visible";
    else
         TextField4c.presence = "hidden";
         TextField4c.rawValue = "";
    //TextFields 1d-4d
    if (this.rawValue == "Top Center")
         TextField1d.presence = "visible";
    else
         TextField1d.presence = "hidden";
         TextField1d.rawValue = "";
    if (this.rawValue == "Lower Left")
         TextField2d.presence = "visible";
    else
         TextField2d.presence = "hidden";
         TextField2d.rawValue = ""; 
    if (this.rawValue == "Top Center  ")
         TextField3d.presence = "visible";
    else
         TextField3d.presence = "hidden";
         TextField3d.rawValue = "";
    if (this.rawValue == "Lower Right")
         TextField4d.presence = "visible";
    else
         TextField4d.presence = "hidden";
         TextField4d.rawValue = "";
    //TextFields 1e-4e
    if (this.rawValue == "Top Center")
         TextField1e.presence = "visible";
    else
         TextField1e.presence = "hidden";
         TextField1e.rawValue = ""; 
    if (this.rawValue == "Lower Left")
         TextField2e.presence = "visible";
    else
         TextField2e.presence = "hidden";
         TextField2e.rawValue = "";
    if (this.rawValue == "Top Center  ")
         TextField3e.presence = "visible";
    else
         TextField3e.presence = "hidden";
         TextField3e.rawValue = ""; 
    if (this.rawValue == "Lower Right")
         TextField4e.presence = "visible";
    else
         TextField4e.presence = "hidden";
         TextField4e.rawValue = "";
    //TextFields 1f-4f
    if (this.rawValue == "Top Center")
         TextField1f.presence = "visible";
    else
         TextField1f.presence = "hidden";
         TextField1f.rawValue = ""; 
    if (this.rawValue == "Lower Left")
         TextField2f.presence = "visible";
    else
         TextField2f.presence = "hidden";
         TextField2f.rawValue = ""; 
    if (this.rawValue == "Top Center  ")
         TextField3f.presence = "visible";
    else
         TextField3f.presence = "hidden";
         TextField3f.rawValue = "";
    if (this.rawValue == "Lower Right")
         TextField4f.presence = "visible";
    else
         TextField4f.presence = "hidden";
         TextField4f.rawValue = ""; 
    //TextFields 1g-4g
    if (this.rawValue == "Top Center")
         TextField1g.presence = "visible";
    else
         TextField1g.presence = "hidden";
         TextField1g.rawValue = ""; 
    if (this.rawValue == "Lower Left")
         TextField2g.presence = "visible";
    else
         TextField2g.presence = "hidden";
         TextField2g.rawValue = ""; 
    if (this.rawValue == "Top Center  ")
         TextField3g.presence = "visible";
    else
         TextField3g.presence = "hidden";
         TextField3g.rawValue = ""; 
    if (this.rawValue == "Lower Right")
         TextField4g.presence = "visible";
    else
         TextField4g.presence = "hidden";
         TextField4g.rawValue = "";
    //TextFields 1h-4h
    if (this.rawValue == "Top Center")
         TextField1h.presence = "visible";
    else
         TextField1h.presence = "hidden";
         TextField1h.rawValue = ""; 
    if (this.rawValue == "Lower Left")
         TextField2h.presence = "visible";
    else
         TextField2h.presence = "hidden";
         TextField2h.rawValue = ""; 
    if (this.rawValue == "Top Center  ")
         TextField3h.presence = "visible";
    else
         TextField3h.presence = "hidden";
         TextField3h.rawValue = ""; 
    if (this.rawValue == "Lower Right")
         TextField4h.presence = "visible";
    else
         TextField4h.presence = "hidden";
         TextField4h.rawValue = ""; 
    //TextFields 1i-4i
    if (this.rawValue == "Top Center")
         TextField2i.presence = "visible";
    else
         TextField2i.presence = "hidden";
         TextField2i.rawValue = "";     
    if (this.rawValue == "Lower Left")
         TextField1i.presence = "visible"; 
    else
         TextField1i.presence = "hidden";
         TextField1i.rawValue = "";  
    if (this.rawValue == "Top Center  ")
         TextField4i.presence = "visible";
    else
         TextField4i.presence = "hidden";
         TextField4i.rawValue = ""; 
    if (this.rawValue == "Lower Right")
         TextField3i.presence = "visible";
    else
         TextField3i.presence = "hidden";
         TextField3i.rawValue = "";
    ----- form1.#subform[0].VariableLocation::ready:layout - (JavaScript, client) ----------------------
    if (TrimSize.rawValue == null) {VariableLocation.access = "readOnly";}
    else {VariableLocation.access = "open";}
    //1a-4a
    if (VariableLocation.rawValue == null)
         TextField1a.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2a.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3a.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4a.presence = "hidden";
    //1b-4b
    if (VariableLocation.rawValue == null)
         TextField1b.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2b.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3b.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4b.presence = "hidden";
    //1c-4c
    if (VariableLocation.rawValue == null)
         TextField1c.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2c.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3c.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4c.presence = "hidden";
    //1d-4d
    if (VariableLocation.rawValue == null)
         TextField1d.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2d.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3d.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4d.presence = "hidden";
    //1e-4e
    if (VariableLocation.rawValue == null)
         TextField1e.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2e.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3e.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4e.presence = "hidden";
    //1f-4f
    if (VariableLocation.rawValue == null)
         TextField1f.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2f.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3f.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4f.presence = "hidden";
    //1g-4g
    if (VariableLocation.rawValue == null)
         TextField1g.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2g.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3g.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4g.presence = "hidden";
    //1h-4h
    if (VariableLocation.rawValue == null)
         TextField1h.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2h.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3h.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4h.presence = "hidden";
    //1i-4i
    if (VariableLocation.rawValue == null)
         TextField1i.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField2i.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField3i.presence = "hidden";
    if (VariableLocation.rawValue == null)
         TextField4i.presence = "hidden";

    You are not saving the state of the form. You can do this programmatically but there is a facility in Designer that will do it for you. If you open the Form Properties under the File menu then click the Defaults tab, you will see a section called Scripting. In that section make sure that the "Preserve Scripting changes to for when saved" radio button is set to Automatically.
    Paul

  • Verifying if number in a text field will evaluate to a date format

    I have a field, FieldA, that contains 6 numbers, (although the field is a text field). I need to know if that field's numbers evaluate to a true date in the format of mmddyy. For example, if FieldA contains 060110, then that would evaluate to a true date of 6/1/10. However, if FieldA contains 130110, then this is not a valid date and the test will indicate accordingly. I was thinking of using a case statement, but unsure of how to test if the numbers evaluate to a valid date..
    Sort of:
    CASE WHEN FieldA = 'Valid Date' THEN FieldA TO_DATE(FieldA, 'mm-dd-yyyy')
    Any help is appreciated..
    Thanks..

    user12296489 wrote:
    I have a field, FieldA, that contains 6 numbers, (although the field is a text field). I need to know if that field's numbers evaluate to a true date in the format of mmddyy. For example, if FieldA contains 060110, then that would evaluate to a true date of 6/1/10. However, if FieldA contains 130110, then this is not a valid date and the test will indicate accordingly. I was thinking of using a case statement, but unsure of how to test if the numbers evaluate to a valid date..
    Sort of:
    CASE WHEN FieldA = 'Valid Date' THEN FieldA TO_DATE(FieldA, 'mm-dd-yyyy')If fielda contains '060110' (meaining June 1, 2010), then you want to use 'mmddrr' as the 2nd argument to TO_CHAR, not 'mm-dd-yyyy'.
    Any help is appreciated..The following thread has a couple of different solutions:
    Re: how to select valid dates only

  • When click on button - Number in a text field increase by 1

    Hello!
    I have no coding experience and want to create a game like Cookie Clicker. An idle clicker game.
    So I have my button and a text field which says "0$". How can I make it, that when I click on the button the "0$" turns to "1$" and so on... ?
    I use Actionscript 3 as a file type, I hope this is correct.
    I hope someone will help me.
    Greetings!

    I will mark your answer when it works. Now I get no error report, but when I start the game its like this:
    When I click on the button its like this:
    When I click again on the button, it is only the $ symbol again and it doesn't change after.
    Can I send you my file somehow, so you can check?
    Thanks for all your help so far!

  • Using variables to add and subtract a number in a text field?

    The adding bit works fine:
    // get this pconn count
    var this_p_conn:Number = Object(this).parent.p_conn;
    // get current pconn total
    var c_this_p_conn:Number = Object(root).part_count.p_conn_count.text    
    // add this pconn count to total pconn
    var v_this_p_conn:Number = Number(this_p_conn+c_this_p_conn);
    // Update total pconn with new value
    Object(root).part_count.p_conn_count.text = String(v_this_p_conn)
    Removing a value from the total is another story, this looks like it should work but it does not:
    // get this pconn count
    var count_p_conn:Number = Object(this).parent.p_conn;
    // get current pconn total
    var total_p_conn:Number = Object(root).part_count.p_conn_count.text;
    // subtract this pconn count from total pconn
    var new_p_conn:Number = Number(total_p_conn-count_p_conn);
    // Update total pconn with new value
    Object(root).part_count.p_conn_count.text = String(new_p_conn);
    Any ideas or suggestions? My eyes are a bit blurry from looking at code, maybe I missed something obvious. Thanks in advance!

    Never mind, I got it worked out now.
    I had the subtraction code firing AFTER my remove self code, so the player never got to fire the subtract code:
    var b:MovieClip = Object(this).parent;
    Object(this).parent.parent.removeChild(b);
    I placed the subtract code before the above code and now it works fine... I think I need powernap...
    The lesson here is that apparently code fires from the top to the bottom, mind the order of how your code is stacked.
    Sorry for the fuss! Carry on.

  • Incrementing a Number in a Text Field by Holding a Button

    Hi All,
    Just wondering... is there any way to increment a display number up or down my clicking / holding a button?
    im making a project to select a fuel tank capacity and want the default to be 0.0 gallons and have the user increase the number or decrease the number by clicking and up or down arrow button... If they hold the same button that function would ideally increment faster, perhaps by multiples of ten until it reached a max / min number.
    Thank you for any help... i have no idea where to begin.
    Pat

    if tf is your textfield and you use movieclip buttons:
    btn1.change = .1;
    btn1.onPress=function(){
    this.onEnterFrame=editTF;
    btn1.onRelease=function(){
    delete this.onEnterFrame;
    btn2.change = -.1;
    btn2.onPress=function(){
    this.onEnterFrame=editTF;
    btn2.onRelease=functino(){
    delete this.onEnterFrame;
    function editTF(){
    tf.text = this.change+Number(tf.text);

  • Extracting and Sorting a Number in a Text field

    Hi everybody,
    I have a column in LOAN_DTL Table as LOAN_DESC which contains data like this:
       CUSTOMER LOAN A/C : CAR  10.00%
       CUSTOMER LOAN A/C : CAR 11
       CUSTOMER LOAN A/C - HOUSE 15.5%
       CUSTOMER LOAN ACCOUNT - CAR 5.50%
       CUSTOMER LOAN A/C - CAR 9%
       CUSTOMER LOAN ACCOUNT : HOUSE 10%
       CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
       CUSTOMER LOAN ACCOUNT : HOUSE 7.75
       CUSTOMER LOAN A/C : HOUSE 6.00
    From the above data, I need to extract the Group i.e. CAR, HOUSE etc. and sort the Group on Rate of Interest order as below :
              CUSTOMER LOAN ACCOUNT - CAR 5.50%
              CUSTOMER LOAN A/C - CAR 9%
              CUSTOMER LOAN A/C : CAR  10.00%
              CUSTOMER LOAN A/C : CAR 11
              CUSTOMER LOAN A/C : HOUSE 6.00
              CUSTOMER LOAN ACCOUNT : HOUSE 7.75
              CUSTOMER LOAN ACCOUNT : HOUSE 10%
              CUSTOMER LOAN A/C - HOUSE 15.5%
              CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
    How to go about the above ?

    Like this?
    SELECT loan_desc,REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+%?') extract_string
    FROM loan_dtl
    ORDER BY 1,
             DECODE(loan_desc,
                    loan_desc,
                    TO_NUMBER(REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+')));
    Message was edited by: 000000

  • Text Field on top of a Button

    I'm using buttons to display an image dependent on a dropdown and need to include a text form on top of the images. When I put another drop down on top of the button it is still accessable but when I put a text field on top of the button the text field disapears and can't be selected to put type in. Is there a way to move it on top of the button?
    (function () {
    if (!event.willCommit) {
    var v = event.changeEx;
    this.getField("FlangePic").display = (v=="Flange") ? display.visible : display.hidden;
    this.getField("Dropdown4").display = (v=="Flange") ? display.visible : display.hidden;
    this.getField("PinionPic").display = (v=="Pinion") ? display.visible : display.hidden;
    //I would like to display "Number of Splines" text field on top of the picture of the spline
    this.getField("SplinePic").display = (v=="Spline") ? display.visible : display.hidden;
    Thanks

    TSN has a point, but since forms were introduced the tab order is also the z-order of fields. But if they are not read-only, they can recieve the focus, and a field that has the focus will appear to be on top. So if you set the button to read-only and set the tab order so the button is before the text field, it should work OK.
    Another option is to take advantage of the button label, which can have a number of placements. When the button is clicked it could prompt the user (e.g., app.response) to enter some text and then update the button label. You'd use the field.buttonSetCaption JavaScript method for this: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.738.html

  • Text field datatype

    I am trying to capture a number from a text field and then
    perform a calculation on it. It is for navigation so a person can
    type in what screen they want to go to. However, it always looks at
    the value as a string and I need it to be a number to do the
    calculation. Can I change the datatype of the textfield or a
    variable?

    Yes, this is known as "casting" and can be done because of
    the close relationship between this format: "123" and 123. This
    does not affect the text field as it does not convert the origional
    value, it only looks at the value in the string as if it were a
    number, or in this case an integer. As you know only a positive
    integer should be entered by the user, it would be better to use:
    jumpVar = 10 * uint(jump_txt.text);
    as this would change "-123" to simply 123.

  • Grabbing Text Field Contents

    Is there a simple way to get a number that has been typed into a TextField and assign it to a double? Of course, this assumes that there is only one number in the Text Field, but that's fine for the program I'm writing. Thanks!

    Declare;-
    double myDouble = 0.0d;
    Get the stuff;-
    try{
    myDouble = Double.parseDouble(myTextfield.getText() );
    catch(NumberFormatException nfe){
    myLabel.setText("Please enter number values only");

  • Adding user-defined number of text fields.

    Okay I am having problems, obviously. I am developing a program where the user will enter X and Y values and the program will calculate the relational data. However, I can't even get a start.
    First of all, the user defines the number of pairs of points they want to define. For example, they have 20 points, each with its own X and Y, so they click on 20 and then okay in the first window.
    The next window will then take their answer and display X and Y text fields for as many points as they defined. However, I can't figure out any way to do this.
    Feel free to run the program, the problem lies in the method setTextFields(). Help please!
    import javax.swing.*;               //FOR SWING COMPONENT CLASSES
    import java.awt.*;                  //FOR CONTAINER CLASS
    import java.awt.event.*;            //FOR EVENT HANDLING
    public class RegressInput extends JFrame
        private JComboBox listJComboBox;        //COMBO BOX TO HOLD HOW MANY PAIRS OF DATA POINTS THE USER HAS TO ENTER
        private JButton answerButton;           //BUTTON TO CLICK AFTER SELECTING PAIRS OF DATA POINTS
        private JPanel textFieldTopPanel;       //TEXT FIELD TOP PANEL
        private JPanel textFieldBottomPanel;    //TEXT FIELD BOTTOM PANEL
        private JPanel textFieldPanel;           //TEXT FIELD PANEL   
        private CardLayout cardSelector;        //DECLARE CARD LAYOUT OBJECT   
        private JPanel cardDeck;                //DECLARE CARD PANEL OBJECT
        public RegressInput(String title)
            super(title);               //CALL SUPERCLASS CONSTRUCTOR
            //CREATE A CONTAINER
            Container container = getContentPane();
            //INSTANTIATE CARD LAYOUT OBJECT
            cardSelector = new CardLayout();
            //INSTANTIATE PANEL OBJECT
            cardDeck = new JPanel();
            //SET LAYOUT OF CARD DECK PANEL TO CARD LAYOUT
            cardDeck.setLayout(cardSelector);
            //DEFINE LABEL FOR FIRST CARD
            Label question = new Label("How many PAIRS of data would you like to enter?");
            //BUTTON TO SUBMIT NUMBER OF POINTS TO PLOT
            answerButton = new JButton("OK");
            listJComboBox = new JComboBox( getArray() );//USE getArray() METHOD TO SET ITEM LIST OF THE COMBO BOX
            listJComboBox.setMaximumRowCount(10);       //SETS THE VISIBLE NUMBER OF ITEMS TO THE USER
            Label xValues = new Label("X Values");      //LABEL FOR X values
            Label yValues = new Label("Y Values");      //LABEL FOR Y values
            //BUILD CARD DECK
            JPanel comboBoxCard = new JPanel();     //CREATE FIRST CARD
            comboBoxCard.add(question);             //ADD question LABEL TO FIRST CARD
            comboBoxCard.add(listJComboBox);        //ADD listJComboBox TO FIRST CARD
            comboBoxCard.add(answerButton);         //ADD answerButton TO FIRST CARD
            textFieldTopPanel = new JPanel();       //CREATE TOP PANEL OF SECOND CARD
            textFieldTopPanel.add(xValues);         //ADD xValues Label TO SECOND CARD
            textFieldTopPanel.add(yValues);         //ADD yValues Label TO SECOND CARD
            textFieldBottomPanel = new JPanel();    //CREATE BOTTOM PANEL OF SECOND CARD
            textFieldBottomPanel.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));    //SET LAYOUT FOR BOTTOM PANEL
            textFieldPanel = new JPanel();          //CREATE PANEL FOR SECOND CARD
            textFieldPanel.setLayout(new BorderLayout(10, 10)); //SET LAYOUT FOR SECOND CARD
            textFieldPanel.add(textFieldTopPanel, "North"); //ADD textFieldTopPanel TO NORTH
            textFieldPanel.add(textFieldBottomPanel, "South");  //ADD textFieldBottomPanel TO SOUTH
            cardDeck.add(comboBoxCard, "Step 1");       //ADD FIRST CARD TO DECK
            cardDeck.add(textFieldPanel, "Step 2");     //ADD SECOND CARD TO DECK
            container.add(cardDeck);                    //ADD CARD DECK TO CONTAINER
            //DEFINE BUTTON HANDLER OBJECT
            ButtonHandler buttonHandler = new ButtonHandler();
            //ADD ACTION LISTENER FOR BUTTONS
            answerButton.addActionListener(new ButtonHandler());
        }//END RegressInput() CONSTRUCTOR
        //METHOD TO CREATE AND RETURN AN ARRAY OF VALUES FOR JComboBox
        private String[] getArray()
            //CREATE ARRAY TO HOLD 30 VALUES
            int numbers[] = new int[29];
            //CREATE int IN ORDER TO START THE ARRAY AT 2 INSTEAD OF 1
            int number = 2;
            //ASSIGN VALUES FROM 2 TO 30 TO numbers[] ARRAY
            for(int count=0; count < 29; ++count)
                numbers[count] = number;        //SETS EACH INDEX TO number
                number++;                       //INCREMENTS number
            }//END for LOOP
            //CREATE pairs[] ARRAY TO HOLD 30 STRINGS
            String pairs[] = new String[29];
            //ASSIGN VALUES 1 TO 30 IN STRING ARRAY FOR COMBO BOX
            for(int count = 0; count < 29; ++count)
                pairs[count] = "" + numbers[count];
            }//END for LOOP
            return pairs;//RETURNS pairs[] ARRAY FOR THE LIST ITEMS IN listJComboBox
        }//END getArray() METHOD8
        //RETURNS THE ITEM SELECTED BY THE USER FROM THE JComboBox
        private int getValue()
            //ASSIGNS STRING VALUE OF THE JComboBox TO A WRAPPER
            Integer v = new Integer((String) listJComboBox.getSelectedItem());
            //ASSIGNS WRAPPER VALUE TO int
            int value = v.intValue();
            //RETURN VALUE OF SELECTED ITEM
            return value;
        }//END getValue()
        private void setTextFields()
        {//HERE LIES THE PROBLEM! WHAT GOES IN THIS METHOD????
            for(int count = 0; count < (2 * getValue()); ++count)
        }//END setTextFields()
        //BUTTON EVENT HANDLER CLASS
        private class ButtonHandler implements ActionListener
         //PROCESS EVENT
            public void actionPerformed(ActionEvent e)
                //WHICH BUTTON CAUSED THE EVENT?
                if(e.getSource() == answerButton)
                    cardSelector.last(cardDeck);
                    cardDeck.setSize(600,600);
                }//END if STATEMENT
            }//END actionPerformed()
        }//END ButtonHandler CLASS
    }//END RegressInput CLASSHere is main:
    import javax.swing.JFrame;
    public class TestSharpStats
         public static void main(String[] args)
            //DEFINE FRAME OBJECT
            RegressInput window = new RegressInput("Hi");     //SETS TITLE BAR
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);      //CLOSES WINDOW
            window.setSize(400, 600);    //SET FRAME SIZE
            window.setResizable(true);  //PREVENTS USER FROM RESIZING WINDOW
            window.setVisible(true);     //SETS window TO VISIBLE
        }//END main()
    }//END TestSharpStats CLASS

    muit-post: http://forum.java.sun.com/thread.jspa?messageID=4442652

  • Set the number of lines allowed in multi-line text field

    Hi,
    I am designing a form where I have some multi-line text fields where I only want the user to be able to enter a maximum of say 5 lines. I know I could do this by enabling the "Limit Length to Visible Area" option, however, this option is ignored by Reader 7 and the field scrolls, hiding any text that spills beyond the visible area from printouts. It works great in 8 though. To avoid this bug/feature in Reader 7, is there some script that I can use to limit the number of lines allowed in a text field?
    Thanks

    I ran into similar issues switching between Acrobat/Reader. Here is the prominent code that works for me when I use this in "Enter" event of the textField.
    var aSOM=this.somExpression.substr(15,this.somExpression.length - 1);
    var acroField = event.target.getField(aSOM);
    acroField.doNotScroll = true;
    I chose Allow Multiple Lines alone and noting else.
    Good Luck,
    SekharN

  • How to find the number of occurance of a string in text field of Infopath form?

    Hi All,
    In Infopath text field, How to find the number of occurrence of a particular string in that field?
    Thanks in advance!

    You can check to see if it contains a string once by using the contains function, but there isn't a very clean way to do what you want. If you wanted to guess at the maximum number of occurrences, then you could:
    Box A has your initial. Set Box B to do a concat of string-before and string-after of Box A where it copies Box A minus the string we're looking for. Then we have Box C that does the same thing to Box B. Repeat as many times as you see necessary.
    Example:
    String: "1"
    Box A - "123451234512345"
    Box B - "23451234512345"
    Box C - "2345234512345"
    Box D - "234523452345"
    etc.
    We then have a field that has nested ifs looking backwards from Z -> A looking for a non-blank. Based on that, we return the number of occurrences. Again, this isn't clean, but it will work if you think there's a predefinable maximum.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • My calculation "Total" box adds sum of all text fields whether they are visible or not, do I change

    I have check boxes that show and hide text fields. (Thanks to Gilads Java script). In options I have a default value for each text field.
    My "Total" Field field adds all fields even if they are not checked and visible. Need to have it only include them if they are checked and visible.

    You can't attach forms by email, or any other means, so it didn't come through.
    Since your fields have default values and aren't calculated based on the state of the corresponding check box, you will have to use a custom calculation script for the Total field that can check to see if any of the fields are hidden, and if so, don't include their values in the sum. For example:
    // Custom calculation script
    (function () {
        // Set up an array of field names to include in the total
        var aFields = ["text1", "text2", "text3", text4"];
        // Initialize variables
        var i, f, sum = 0;
        // Loop through the fields an calculate the sum
        for (i = 0; i < aFields.length; i += 1) {
            // Get the current field
            f = getField(aFields[i]);
            // Add the value of the current field to the sum if the field is visible
            if (f.display == display.visible) {
                sum += +f.value;
        // Set this field value to the sum
        event.value = sum;
    You can send me a PM if you want help offline.

  • Professional 8 - Can't Get Rid of Tab Number In Text Field

    Hello,
      I hope someone can help me with this issue - when I create a text field on a PDF document and type text in the field, a "1" appears in the upper left hand corner (it's enclosed in a little black bordered box).  If it was only in the PDF file itself I could deal with it, but unfortunately it shows when I print the document too.  I've got some advice that it's the Tab function in Professional 8, but when I look for a way of turning it off or at least preventing it from showing up in the print, I can't find anything that works.  Adobe support has been no help, there still "looking into it".  I was hoping that perhaps someone has had a similar situation and could shed some light?.....
    Thanks!,

    Hello Bernd,
      I've attached an example of what's happening though I don't know if you'll be able to view the "1" in the upper left hand corner of the Text Field unless you have similar settings in Professional 8 (just a guessbecause Tech Support at Adobe couldn't see it so I sent a screen shot as well), so I've also attached a screen shot of the bottom of the document where the Text Field is showing the "1" in the corner.
    Things I've tried from suggestions made:
    1)  You have a tab order in your form turned ON. This is a standard feature of Adobe Acrobat. This is the only way Acrobat will display little numbers in the left-hand corner of the text field. However, tab order should not be visible during printing or entering data. These numbers are only displayed while editing form fields using "Form > Edit Fields in Acrobat...."  - (Which I didn't use to create the Text Field, I used "Tools", "Forms", "Text Field Tool")
    2)  "Print" dialog.  Select "Document" under "Comments and Forms" pull-down menu to avoid printing any markup or comments.
    I suspect that tab order might get printed for some reason you select anything else besides "Document".  - (I've tried everything is this menu)
    3)  1. Open your PDF form. 

Maybe you are looking for

  • My Macbook Air has suddenly become extremely slow and is always crashing?

    Hi, I would really appriciate some help right now. I have had my Macbook Air for a little more than 2 years. It has always worked pretty well. However, recently I went on vacation for 1 week without my laptop. When I returned home and went to turn on

  • How to make a layer not selectable in CC?

    After recent update (CC) the feature which was allowing the invisible layers (turned off by "eye" icon) to be not selectable by Move Tool is gone. So when one have a web page design with 300 layers and 3 states in groups and you decide to deactive so

  • Acrobat 9.1  Mac How do you change from Radio buttons to Check boxes?

    I have a DMV Form I Downloaded and had to convert to PS then back to PDF (written originally on PC Acrobat was in XML format). So on new form, I am able to add fields. I used the the Forms manager to automatically create the fields. Fields that were

  • Running Applescript Gives Adobe Error

    Hello. Not sure where to post this but here goes. When I try to run an .sh file that calls an applescript script i get the following error: Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(....)

  • Applicatio​n Updates when updating Desktop Mgr

    Hi All, In updating DM from 4.6 to 4.7 on a new 8310, the software asks if I want to update the phone's applications.  It provides a list of what will be updated and says it will delete a number of installed apps.  There doesn't seem to be an option