Trying to create a multi-line dialog box

I worked on a study PDF guide. At the end of each chapter is a self test, and I have some javascript which marks the review when a user clicks a button. Currently, I use a window app.alert to notify the user what responses it is correct and display explanations on incorrect answers. Unfortunately, some of the explanations may be a little long, so I had some tests auto split in several alerts. I have a snippet of code (below) for example to a dialog box, but have been unable to find examples of a multi-line dialog box. A thread has responses as "it is not easy", but no solid examples. Someone at - it an example of a simple dialog box, a line that I could adjust to my needs?

var oDlg = { 
    description: { name: "Test Dialog", elements: [ { name: "Hello World", type: "static_text", }, { type: "ok", }, ] } 
}; 
// Dialog Activation 
app.execDialog(oDlg);

I tried to do something like that, but it barfs on the first carriage return:

var sText = "Question 5: Incorrect! The correct answer is B\r\rA, C, and D are incorrect. && and || are both short-circuit operators. With &&, when the left side evaluates to false the right side is never evaluated. And with ||, when the left side evaluates to true, the right side is never evaluated.\r\rIn the first statement, i1 does not equal 99 when it is evaluated, so the second expression is printed. However, it is decremented BEFORE the print statement, so the combined value of i and j is 299.\r\rIn the second statement, the left side of the equation evaluates to false, so the right side is never evaluated. Thus the second expression is printed out.\r\rIn the third statement, i3 equates to 100, so the first expression is printed out.\r\rFor the last statement, the left side of the expression is evaluated to true, so the right is never evaluated. The first expression is printed out.\r\rThe final result is 'Value2: 299, Value2: 300, Value1: 299, Value1: 300'";

var oDlg = { 
description: { name: "Test Dialog", elements: [ { name: SText, type: "static_text", }, { type: "ok", }, ] } 
}; 
// Dialog Activation 
app.execDialog(oDlg);

Any help would be appreciated.

Here is a basic sample:

Dialog1 var = {}

DoDialog: function() {}

Return app.execDialog (this);

},

initialize: function {(dialogue)

var dlgInit = {}

"not1": this.strnot1

};

Dialog.Load (dlgInit);

},

Description: {}

name: "dlg1."

elements:

[

{

type: "display."

elements:

[

{

type: "cluster."

item_id: "cls1."

name: "Notes."

elements:

[

{

type: 'static_text. "

Multiline: 'true ',.

item_id: "not1."

Width: 300,

height: 300,.

}

]

}

]

},

{

type: "ok."

}

]

} / / description

};

var sText = "Question 5: Incorrect! The correct answer is B\r\rA, C, and D are incorrect. & and | are only two short circuit operators. With &, when the left is set to false, the right side is never evaluated. And with |, when the left evaluates to true, the right side is never evaluated.\r\rIn the first statement, i1 is not equal 99 when it is evaluated, so the second expression is printed. However, it is decremented BEFORE the print statement, so the combined value of i and j is 299.\r\rIn that the second statement, the left side of the equation is set to false, then the right-hand side is never evaluated. The second expression is so printed out.\r\rIn the third statement, i3 is equivalent to 100, so the first expression is printed out.\r\rFor the last statement, the left side of the expression evaluates to true, then the right is never evaluated. The first expression is printed out.\r\rThe end result is ' value2: 299, value2: 300, value1: 299, value1: 300 ft;

Dialog1.strnot1 = sText;

Dialog1. DoDialog();

Tags: Acrobat

Similar Questions

  • Firefox 36.0.1 causes InfoPath 2010 multi-line text boxes do not work - how to fix?

    Since upgrading to Firefox 36.0.1, generated by InfoPath 2010/SharePoint 2010 multi-line text boxes is no longer move to the new lines when the text is entered. Like a lot of text is entered, the cursor remains on the first line.

    36 Firefox in March in favor of the white space in < textarea > style property controls for the first time. So, if the control has a white-space: pre rule, then Firefox will wrap is no longer text in version 36 +.

    Please see this thread for more information and potential code solution:

  • Values in a dialog box application answering the multi-line text box field

    Hello

    When the user clicks on a radio button in my form a response request dialog box is displayed for the user to enter data.

    The value of the response dialog box is then added to a multiline text box.

    The script is on the mouse to the top of the radio button action and works fine the first time you click on the radio button.

    If the radio button is checked once again, the value of the response dialog box replaces the existing value in the multiline text box.

    What I need to do, is to have the response values show on a new line in the text box whenever you click on the option button.

    Can any advise please how to revise my script to work?

    Target for the field multiline text box

    var t = this.getField ("ActionAgenda");

    Response from dialog when the user clicks on the radio button

    var cResponse = app.response({)

    cQuestion: "enter your Action Agenda Item."

    ({CTitre: 'Action program'});

    Alert if you cancel

    If (cResponse == null) {}

    App.Alert ("Action point not will be not entered");

    Place the data in the dialog box in the target domain

    } else {}

    t.Valeur = cResponse;

    }

    Any help will be greatly appreciated.

    Thank you

    Change this line:
    t.Valeur = cResponse;

    To do this:
    t.Valeur += "\n" + cResponse;

  • I can't transfer files flv to mobile to the computer, when I tried to transfer the file, a dialog box indicates that the file is opened in the Media Foundation Pipeline. Exe

    I can't transfer files flv to mobile star Samsung Galaxy of the computer, when I tried to transfer the file, showing a dialog box indicates that the file is opened in the Media Foundation Pipeline. Exe

    Discussions were merged.

    Deleted duplicate.

    Hello Arun,

    Thanks for posting back.

    If you have successfully transferred your files and they are stored in a location on the hard disk, that is, in a folder or drive on your computer, they will remain on your computer, regardless of any number of reboots.

    Hope this information is useful. If the problem persists, please post back for assistance.

  • Creating a pop-up dialog box graphics to a form

    Hello:

    I created a form that displays a pop-up JavaScript warning dialog box when the user clicks on a specific box.  I did it by creating an action "Execute a menu item" and "Run a JavaScript" on the mouse upwards.


    I would like to know if I can create a graph that will pop up after a user completes a specific field and the pop-up is triggered when they try to tab to the next field.

    The first example works well, but I need to create a ToolTip that is not the big red x. so I thought that I could create a graphic in Fireworks or if there is an easier way.

    Any help or a JavaScript code would be greatly appreciated!  The code I used for the first example is:

    App.Alert ({}

    CMSG: "ATTENTION!" Trades will be placed! «,

    CTitre: "ATTENTION!" Trades will be placed.

    });

    popup.png

    Thank you
    Jeff

    Where did you place the code/action that displays the button, exactly? I suspect that you used the mouse to the top (or the mouse down), so consider instead using the event on Focus.

  • How can I increase the attack in a multi-line text box?

    Is this possible?

    I found this ad a few years where someone has asked a similar question:

    http://forums.Adobe.com/thread/286972

    This feature has never been added? If this is not the case-how can I make the code work posted in response to that post?  Just hide the lines would be a good alternative, I think. I tried to add the code to my existing PDF, but seems not to do anything, the lines are still visible when you type in the field.

    No, leading to control has been added and it probably never will be.

    The code at this other thread is not complete because the functions that it calls are not displayed. They are not integrated. Here is a link to a document with a multi-line field that behaves in this way: https://workspaces.acrobat.com/?d=AG6oZ3bi3DYHokxDPeWN7A

    There are several small scripts in various events that control the behavior.

  • Buttons on the horizontal line dialog box

    Hello

    I would like to know if there is a way to display the buttons of a dialog box as in a HorizontalFieldManager.

    Like this:

    /--------------------\

    |    Message |

    |                    |

    | YES NO |

    \-------------------/

    You can actually use the dialog box that appears automatically this kind of output. like Ok and cancel.

    or you can implement a PopupScreen which will act as a screen of dialogue. With popupscreen you have more controls with it unlike the alert dialog box.

  • With scroll multi line text box

    Hello

    I need to set up a text box multi online where new channels are added and the box scrolls.  I found a previous post with a good example. However, in the example, there is a while loop using shift registers to concatenate the strings and so to add the new channel.  In my situation, I have a case statement and the new string is added to the base on an independent State.

    How to concatenate the new string with what is already in the text box?  The text box is an indicator, there is no way out for me a loop in a concantator. Is attached a picture to help describe what I'm trying to do.

    I apologize if this is a stupid question, I am very new to LabView.

    I'm using LabView 8.2

    Thank you.

    You can use a node of feedback in the middle where is your cut wire.

    You can use a shift register as well on your while loop (not shown) outside.  Simply thread through the case of false and perform the concatenation in the case of true.

  • How can I control the line spacing in multi-line text boxes?

    Hello

    The default value for the multiline text seems to be the only space. Is it possible to change this for each (or all) text boxes?

    TIA,

    Jeff.

    Hi, Jeff.

    You can set the line-height property in the extended text properties.  In the properties panel you have your selected text field, choose the expansion icon in the lower left corner.  Then you can choose the line-height property and set to get a custom spacing.

    Hope that helps!

    -Elaine

  • How to handle the error created by the file dialog box Cancel?



  • Apex 5.1 - new multi-line edit box Type

    Hello

    I just read the statement of direction for APEX 5 and 5.1.

    Was very curious about the "new ranks multiple changing the Type of region. Would be nice if someone from the Dev APEX team paid more details on how it will be different to present tabular. Thank you.

    XRC-xarg

    Check out enhanced-data-entry-form-in-apex-4-2-x-with-many-excel-features blog

    What gives an idea on actually how look like new several rows, changing the Type of region.

    Hope this helps...

  • Can I stop a certain program to create dialog boxes?

    Hello

    Can I prevent a certain program to create any kind of dialog boxes, including errors, warnings and so on?

    Thank you

    Yuri

    What programs are you wish not to receive alerts of?

    If security alerts, disable them in Windows Security Center.

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-off-Security-Center-alerts

    If an application such as Photoshop > go to application settings and look for turn off (ex: updates) alert messages.

  • Disorders of the multi line text area

    I work in CS3 on Mac.

    I created a text box in a dialog box with my resource editor.  Then, I used the ADMItemSuite to set the "point guy" to "kADMTextEditMultiLineType".

    When I hit the return key I eventually trigger the 'ok' button in the dialog box instead of going to the next line in the text box in that just, I was typing.  I can remedy this situation by creating a tracker for the element of text box manually adds a '\r' when the key 'kADMReturnKey' race is followed, but that substitutes the feature by clicking on / mouse of the multi-line text box selection.

    Any ideas how I can get back to go to the next line in the text box without writing my own tracker?

    Thank you

    Bill

    That I could find, the best way to do this is to create your own tracker. You don't have to manage it all just treat the return key and call Tracker by default if it is not coming back. It takes only a few lines of code.

    Why don't you create a tracker?

  • Need help with custom dialog box

    I created a custom help dialog box. The problem is that 5 buttons do not properly fit in my manager of horizontal field on some blackberry devices. How can I make own? I tried to use my own custom buttons that allow me to specify their width and height, but I'm unable to get the width of the dialog box, so I can't determine how wide should be buttons.

    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    
    public class HelpDialog extends Dialog
    {
        static int ButtonPressed;
        HorizontalFieldManager hfmChoices = new HorizontalFieldManager();
        ButtonField cmdFirst = new ButtonField("|<")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 0;
                close();
                return true;
            }
        };
        ButtonField cmdPrev = new ButtonField("<")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 1;
                close();
                return true;
            }
        };
        ButtonField cmdNext = new ButtonField(">")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 2;
                close();
                return true;
            }
        };
        ButtonField cmdLast = new ButtonField(">|")
        {
            protected boolean navigationClick(int status, int time)
            {
                ButtonPressed = 3;
                close();
                return true;
            }
        };
        ButtonField cmdClose = new ButtonField("Close")
        {
            protected boolean navigationClick(int status, int time)
            {
                close();
                return true;
            }
        };
    
        public HelpDialog(String message, int page, int maxPages)
        {
            super("Help (Page: " + page + " of " + maxPages + ")\n\n" + message + "\n", null, null, -1, null, 0);
            ButtonPressed = -1;
            if (page <= 1)
            {
                cmdFirst.setEnabled(false);
                cmdPrev.setEnabled(false);
            }
            if (page >= maxPages)
            {
                cmdNext.setEnabled(false);
                cmdLast.setEnabled(false);
            }
            hfmChoices.add(cmdFirst);
            hfmChoices.add(cmdPrev);
            hfmChoices.add(cmdNext);
            hfmChoices.add(cmdLast);
            hfmChoices.add(cmdClose);
            add(hfmChoices);
        }
    }
    

    Thank you

    Most people have no need a close button, they expect the ESC to do it for them.

    That said, I disagree with this statement:

    "I think that the only good way to use managers other than the AbsoluteFieldManager, is to use them at all."

    Designing a user experience that works well on multiple devices is difficult, and I don't think that has a size fits all approach work.  In addition, I don't have the time to create formats for specific screens for each device type, and although this will not happen now, I didn't have to rework screen designs every time that a new device came out.  I think that it is possible to create a common user interface experience given the size of the screen, and whether it is touch.  If you want to read my thoughts on this, have a look at the tutorial of the user interface you will find here:

    http://supportforums.BlackBerry.com/T5/Java-development/tutorials-for-new-developers-part-1/m-p/1621...

  • View dialog box on powerUp()

    Hello

    I am building an app that does not have a graphical user interface and runs in the background. The application uses PhoneListener to interrupt a call and create a new one in its place. Since I have no GUI I cannot send the keystrokes required to phone until after a dialog box is displayed (either a dialog box, asking permissions of the Application, or by changing the OptionsProvider). What I want to do, it's just pop up a dialog on startup so I can then inject my shots to end the call.

    Here is my code:

    public class GVIntercepter extends UiApplication implements SystemListener
    {
        public static void main(String[] args)
        {
            // register an options provider
            GVIntercepterOptionsProvider provider = new GVIntercepterOptionsProvider();
            OptionsManager.registerOptionsProvider(provider);
    
            // register a phone handler
            PhoneHandler phone_handler = new PhoneHandler();
            Phone.addPhoneListener(phone_handler);
    
            GVIntercepter instance = new GVIntercepter();
            // instance.enterEventDispatcher();
    
            if( ApplicationManager.getApplicationManager().inStartup() ) {
              // Add a system listener to detect when system is ready and available.
              instance.addSystemListener(instance);
            } else {
              // System is already ready and available so perform your start up work now.
              // Note that this work must be completed using invokeLater because the
              // application has not yet entered the event dispatcher.
              instance.doStartupWorkLater();
            }
            // Enter the event dispatcher.
            instance.enterEventDispatcher();
        }
    
        //Invoked when the user is putting the device into a power off state.
        public void powerOff()
        { }
    
        //Invoked when the device has left the power off state.
        public void powerUp()
        {
          Application.getApplication().removeSystemListener(this);
          doStartupWork();
        }
    
        //Invoked when the internal battery voltage falls below a critical level.
        public void batteryLow()
        { }
    
        //Invoked when the internal battery voltage has returned to normal.
        public void batteryGood()
        { }
    
        //Invoked when the internal battery state has changed.
        public void batteryStatusChange(int status)
        { }
    
        private void doStartupWork()
        {
          // Perform your start up activities here!
          Application.getApplication().invokeLater( new Runnable() {
            public void run() {
              Dialog.ask(Dialog.D_YES_NO, "Display?");
            }
          } );
        }
    
        private void doStartupWorkLater()
        {
          Application.getApplication().invokeLater( new Runnable() {
            public void run() {
              doStartupWork();
            }
          } );
        }
    
        public GVIntercepter()
        {    }
    }
    

    I tried almost everything to get the dialog box to display and I am at a loss here. Any ideas?

    Also, I'd be open to suggestions on power sending keystrokes to a background application in the phone app and use PhoneArguments to call without displaying any prompt at all.

    I never thought seriously about doing something like what you're trying to do, so I'm sorry this isn't a complete answer to your questions.  You may use these details to get a little further though.

    You say that your app is a bottom up, however you have extended UiApplication.  If your application is treated as it displays a screen of the user, but you never insert a screen, if your application never gets thrust in the foreground.  You will find that, once you started with your current code, your icon is available in the Task Switcher (ALT + ESC) and if you swap to your application, your dialog box is there to be seen (on a white background, as any UiApplication).  Try it and see.

    You can replace your code in doStartupWork() with something like the following, so that you can see actually started.  Try this and then see what happens when you select your application by using the Task Switcher after you answer your dialog box (note I use UiApplication rather than on request, simply because the code you call later should a UiApplication to run.  Your code works really because you have found your own application, which is currently spreading UiApplication.  If you change it to extend the Application instead, then you will get a UiApplication.

          UiApplication.getUiApplication().invokeLater( new Runnable() {
            public void run() {
                UiApplication.getUiApplication().requestForeground();
                Dialog.ask(Dialog.D_YES_NO, "Display?");
                UiApplication.getUiApplication().requestBackground();
            }
          } );
    

    I suspect that you really want to be a background application.  In this case, you extend Application rather than UiApplication.  Then, to bring something to the attention of the user, you can use UIEngine, as shown here:

    How - to alert a user to a background application
    Article number: DB-00407

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

    Alternatively, you can do what you do, stick your phone earpiece in place, then the UiApplication, the output is not in the Task Switcher.   Even if you have left your UiApplication, your hook is still in place and can still do something.

    I have a point more than related.

    You are actually setting up an earpiece of phone.  When this listener is controlled, it will run the app phone, not your Application.  This application has a GUI, then maybe you need not to use this dialog box "to access a graphical interface.

    Sorry, as stated, I never really looked seriously to do something like what you do, then I do not understand everything and maybe you have this covered.  Bit I hope this helps.

Maybe you are looking for