Centering an Alert box.

I have a flex web application in which the flex components are embedded inside portal jsps. When the user clicks on a datagrid (clicks on item renderer inside the datagrid), the Alert box has to notify the user. However the alert box centers itself wrt the flex application and it goes out of the user's view. Because the user can view only a portion of the large datagrid at a particular time (scrollbars for the page are present, not for the datagrid).
I have tried assigning absolute and relative values, but nothing seems to work.
Any suggestions woudl be greatly appreaciated.
Thanks in advance.

I've run into a similar situation and here is what I did to resolve it without using the move method...
Say you have an application that has a layout container which contains a custom component in it somewhere
Application
       |--->HGroup
                    |---> CustomComponent (the one that calls the alert box)
if your alert box code looks like this:
Alert.show(
"Your Alert Message Here!","Your Alert Title Here...",0x4,this,null,null);
Your alert box will appear centered over the custom component which called it.
Add an id to the container you want the alert box centered on:
Application
       |--->HGroup id="myContainer"
                    |---> CustomComponent (the one that calls the alert box)
Change your alert box code to look like this:
Alert.show(
"Your Alert Message Here!","Your Alert Title Here...",0x4,this.parentApplication.myContainer,null,null);
This will center the alert box over the HGroup layout container that has its id property set to myContainer.
The example above sets the parent property of of the Alert class show method:
public static function show(text:String = "", title:String = "", flags:uint = 0x4, parent:Sprite = null, closeHandler:Function = null, iconClass:Class = null, defaultButtonFlag:uint = 0x4):Alert
So if I'm understanding your issue correctly... regardless of the size of your viewport you'll maybe want a dynamic method to determine the id porperty of the layout container currently being displayed within the viewport, and then center your alert box over that container via the method above.
I hope this helps.

Similar Messages

  • Adding a carriage return in an alert box

    Hello
    I have a user request to display this alert box in the format below:
    Attention: The owner name has changed on this vessel.
    Current Name: xxxxxxx:
    New Name : yyyyyyy
    Please confirm or deny that this is an owner change.
    Confirm and Deny are the two buttons.
    How can I insert a c arriage return at the end of each text line so the text looks this way in the alert box? I can get it to wrap but it doesn't look right
    can the 'Confirm' and 'Deny' buttons be set to different colors?
    Thanks!

    Use chr(10).
    For example:
    v_alert := 'Attention: The owner name has changed on this vessel.' || chr(10) || 'Current Name: ' || etc....

  • Alert box:No more free items available, please create new one

    Hi,
    We are running a SAP ERP Ecommerce, we get a strange alert box message "no more free items available, please create a new one". This alert window pops up only when you have created one order in a session and you are trying to create another order. Has anyone come across this issue?
    Steps to recreated this issue
    1. Create an order with any product - quantity is rounded to next possible value.
    2. Order created, close the order.
    3. Trying to create new order. (Product field is not a text box anymore)
    4. Try to transfer product from catalog by hitting shopping basket icon.
    5. Error message -> "No more free items available, please create new one".
    Thanks,
    -Tarun

    Hi,
    We are running a SAP ERP Ecommerce, we get a strange alert box message "no more free items available, please create a new one". This alert window pops up only when you have created one order in a session and you are trying to create another order. Has anyone come across this issue?
    Steps to recreated this issue
    1. Create an order with any product - quantity is rounded to next possible value.
    2. Order created, close the order.
    3. Trying to create new order. (Product field is not a text box anymore)
    4. Try to transfer product from catalog by hitting shopping basket icon.
    5. Error message -> "No more free items available, please create new one".
    Thanks,
    -Tarun

  • Javascript alert boxes are wrapped in Windows 7 with IE 8

    I can't count the number of JavaScript alert boxes I have throughout my systems and they have always made the transition between IE browsers from 6 to 8 without a hitch.  Without a hitch until I setup my first Windows 7 machine.  It is a 64 system that has both 32 & 64 bit IE browsers.
    It doesn't matter which of the two versions I use, the JavaScript messages that I have so carefully crafted with just the proper layout are now wrapped.  The resultant text in the new W7 popups is almost unintelligible because it is so badly scrambled/wrapped on the new white background.
    Since an alert box is simplicty itself, there is no way that I can think of to change the inherent size of the box.
    Has anyone else notice this phenomena???   If so, do you have a way around it short of redoing all of the text in the effected boxes???
    Len
    XP machine's JavaScript Alert popup in IE 8
    W7 machine's JavaScript Alert popup in IE 8 with wrapped text

    HMM I have the same problem. My researches suggest that the Zone.Identifier ADS is still being used for the internet zone, but not the Intranet zone. I too can get an intranet location out of IE, but not by querying Zone.Identifier eg using Powershell. This
    issue is present in XP as well as Win 7. It appears to extend to trusted zone ids.
    One hypothesis is that this is being stored in hidden form to prevent zone ids that decrease security being applied by malware.
    I had thought that maybe the intranet zone id was only present during download - but your experiment suggests otherwise.

  • Need an Alert box

    Is it possible to get an alert message whenever closing the file in the Indesign? The problem is, I will forget some checkpoints before sending the files. Making scripts, will need to run, specially, which cannot be in mind in rush times. But if an alert message shoots whenever we close a file, it will always be helpful. I just need to create a alert box to display some message, whenever I say, close or exit the file.
    Is this possible in CS2?
    Thanks in advance and help appreciated!
    Prasant

    CS2 you need a plug-in called InEventScript
    CS3 you need to create an event "beforeClose" with a script run as targetengine "session".
    Looks also in the Javascript samples provided w/ CS3 about events
    ==============================================
    #target indesign
    #targetengine "session"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    main();
    function main()
    //** Number 0
    app.addEventListener( "beforeClose", EventClose, true);
    alert ("Event(s) added...");
    //******************** END Main ********************
    //******************** EVENTS ********************
    function EventClose (itsEvent)
    alert ("Don't forget your checklist!!!);
    ==================================================

  • An alert box with a yellow triangle keeps randomly popping up

    An alert box with a yellow triangle keeps randomly popping up on my screen. But I don't have time to read what it says because it disappears in 1 sec. What is it? What can I do to get rid of it?

    Window keeps popping and closes before...: Apple Support Communities

  • Polish , turkish text not decoding in the alert boxes in JSP file

    Hi All,
    Currently I am working on application in the J2ee development perspective in NWDI  and this contains many Jsp pages.As per the business requirement we need to make this application support Polish and turkish languages , for this we have maintained properties files .
    I have encoded the polish and turkish text using the u201CHTML Unicode format encodingu201D hence when checked the url in the IE with Polish and turkish locale all the characters are getting decoded properly ,but i have a proplem with the text in the alert boxes i.e. the special characters in the text displayed in the alert boxes is not getting  decoded at all eg:"Wprowadź numer konta BP" whereas it has to display as "Wprowadź numer konta BP:
    Also i have used java encode also to achieve the same and for this "?" is getting displayed i.e. it is not getting properly decoded.
    I have also used native2ascii method in this also it is getting decoded but not correctly i.e. "?" is displayed
    Please note that the alert boxes are written in the script tag in the JSP page.
    Request you to kindly help me in resolving the issue at the earliest as this is a very critical issue in my project now.
    Thanks and Regards,
    Nishita Salver

    Hi nishita,
    We had a similar problem in one of my projects, but what i remember is we have kept the ascii value for that character directly in the properties files and tried to encode it, this way i resolved my problem.
    Try this way and let me know the result.
    Regards,
    Saleem Mohammad.

  • Message missing from alert box & Can you disable everything until user selects an answer?

    Question 1 - My alert box window is working, and the title and buttons function as they should, but does anyone know why my message is not showing up?
    Question 2 - How do you program the alert box window so that no other buttons on your application work until the user selects one of your alert window buttons? I can do this manually by setting everything to enabled = false, but I know this happens automatically every other time I've used the alert window component, but it's not working for me now.
    Question 3 - How can I prevent multiple alert windows from popping up? My alert comes up when a user clicks a button called 'Delete'. Would be solved if I had the answer to question 2.
    var myMess:String = '';
    var myTitle:String = '';
    function confirmDelete(){
        selectedAlt = list_dg.selectedItem.ALT_CODE;
        myMess = "Are you sure you want to delete this ALT code: "+selectedAlt+"?";
        myTitle = "Confirm Delete ALT Code Function                                                    ";
        var alertBox:Object = Alert.show(myMess,myTitle,Alert.YES|Alert.NO,this,deleteConfirmHandler);
        alertBox.setSize(450, 125);
    // HANDLER FOR CONFIRM DELETE ALT ALERT WINDOW
    deleteConfirmHandler = function(evt_obj:Object):Void {   
        var myAnswer = evt_obj.detail;
        // returns 1 if yes, 2 if no.
        if (myAnswer == 1){
                deleteAlt();
        else {   
            altDetail.moveAssign_btn.enabled       = false;
            altDetail.moveAvail_btn.enabled        = false;
            altDetail.avail_list.selectedIndex     = null;
            altDetail.assigned_list.selectedIndex  = null;

    I think you were on the right track, it did have something to do with the parent fla file. Once I complied it's parent file (and imported the window and alert classes into the parent), my message appeared in the alert box.
    It doesn't make any sense, because the component is not in the parent file, it's in the sub-parent fla file, but I guess you just have to compile all the files in the hierarchy for it to work... It also doesn't make sense why everything else worked before (the title, the yes and no buttons) except for the message.
    Thanks for the suggestion (to look at the depths, etc), however, I'm still unable to understand why the alert is not modal as it should be. If anyone has any suggestions on how to fix the buttons to make them modal, please let me know. Thanks.

  • After upgrade why do I have Old English style font on alert boxes and text on some sites?

    The browser is picking up fonts from my font list to use in browser alert boxes, pull down menus, and sometimes in whole web sites.
    Unfortunately it chose a Old English font that is virtually impossible to read under 18pt. It also uses a second scrip font for Bold styles.
    For an example of where it is used, the pull down menu at the bottom of the Firefox Help page labeled "Other Languages" appears on my screen as an Old English font called "Westminster Gofisch"

    You can do a check for corrupted and duplicate fonts and other font issues:
    *http://www.thexlab.com/faqs/multipleappsquit.html - Font Book 2.0 Help: Checking for damaged fonts
    *http://www.creativetechs.com/iq/garbled_fonts_troubleshooting_guide.html
    You can do a font test to see if you can identify corrupted font(s).
    *http://browserspy.dk/fonts-flash.php?detail=1
    You can also try different default fonts.
    * Firefox > Preferences > Content : Fonts & Colors > Advanced
    *[ ] "Allow pages to choose their own fonts, instead of my selections above"

  • [CS5/JS/ScriptUI]: All contents is removed from tabbedpanel when showing alert box or other Window.

    When I open a new window (an alert box, another scriptUI window, or an old style InDesign dialog) from my non modal ScriptUI interface, the contents inside all tabs on the tabbedpanel of the window disappear completely, and the last tab is selected.
    Other controls, outside the tabbed panel (but in the same window) are left untouched.
    I suspect the error has to do with the tab control. I have been able to recreate the error in an extremely simple window, and I attach the code below.
    #targetengine 'test'
    var Window1 = new Window('palette','Test',undefined);
    buildWindow();
    Window1.show();
    function buildWindow(){
        Window1.tabMain = Window1.add('tabbedpanel',undefined,undefined);
        Window1.tabMain.minimumSize= [450,170];
        Window1.tabMain.Tab1 = Window1.tabMain.add('tab',undefined,"Tab 1");
        Window1.tabMain.Tab1.Static1 = Window1.tabMain.Tab1.add('staticText',undefined,"Text on tab 1");
        Window1.tabMain.Tab2 = Window1.tabMain.add('tab',undefined,"Tab 2");
        Window1.tabMain.Tab2.Static1 = Window1.tabMain.Tab2.add('staticText',undefined,"Text on tab 2");
        Window1.tabMain.Tab1.btnTest = Window1.tabMain.Tab1.add('button',undefined,"Test");
        Window1.tabMain.Tab1.btnTest.onClick = function(){alert('btnTest_onClick')};
        // Trying with calls to layout . (This button is not affected by the alert showing - only controls inside the tabbed panel)
        Window1.btnLayout = Window1.add('button', undefined, 'Window1.layout.layout()');
        Window1.btnLayout.onClick = function(){Window1.layout.layout()};
    The interface works well in CS4, and also if I make the window modal (by creating it as a "dialog").
    In CS5, the result is this:
    Calling layout.layout() or layout.resize() doesn't do anything.
    If someone else would like to try my code, do you get the same effect?
    Is the behaviour known?
    Is there a way to prevent this from happening for non modal ScriptUI windows?
    Best regards,
    Andreas Jansson

    Thanks Marijan, for testing and letting me know!
    I filed a bug report now. We would perhaps have to "force" a couple of our clients to an upgrade from CS5 to CS5.5 in order to beat this bug and get it working, unless Adobe acknowledges it quickly, which I don't count on.
    No good news then... I took for granted that the interface would work in CS5 if I made it in CS4.
    (The thing that I was mostly concerned about was a tree view which I tested in Mac/PC and on CS4/CS5. Not the "tabbed panel"...)
    Andreas
    Adding this answer I got from Adobe:
    Monday, November 21, 2011 2:21:03 AM PST
    Hello Andreas,
    I was able to replicate this problem with InDesign CS5. This bug seems
    to have already been fixed as a side effect of some code change within
    InDesign CS5.5.
    I have logged this under bug # 3050997. This will now be worked upon by
    InDesign engineering and should be fixed soon.
    I'll keep you informed about updates on this bug.
    Message was edited by: Andreas Jansson. Response from Adobe added.

  • How to get alert box in the middle of scriptlet?

    Hi,
    I got a problem.Please help to resolve that one
    In the following code the alert box is not coming even though the condition is true.
    Can anyone please resolve it
    <%
    Cookie axsCookie;
    axsCookie = new Cookie("user_id", "");
    response.addCookie(axsCookie);
    axsCookie = new Cookie("user_lang_code", "");
    response.addCookie(axsCookie);
    axsCookie = new Cookie("default_lang_code", "");
    response.addCookie(axsCookie);
    String logOut=request.getParameter("logOut");
    if(logOut!=null)
    %>
    <script type="text/javascript">
    var temp='<%=logOut%>';
    if(temp=="true")
    alert('Your password is successfully changed.Please relogin.');
    </script>
    <%
    session.invalidate();
    response.sendRedirect("/priv/logging.jsp");
    %>

    Hi,
    Please use 3 variables of Cookie class.
    <%
    Cookie axsCookie1,axsCookie2,axsCookie3;
    axsCookie1 = new Cookie("user_id", "");
    response.addCookie(axsCookie1);
    axsCookie2 = new Cookie("user_lang_code", "");
    response.addCookie(axsCookie2);
    axsCookie3 = new Cookie("default_lang_code", "");
    response.addCookie(axsCookie3);
    String logOut=request.getParameter("logOut");
    if(logOut!=null)
    %>
    <script type="text/javascript">
    var temp='<%=logOut%>';
    if(temp=="true")
    alert('Your password is successfully changed.Please relogin.');
    </script>
    <%
    session.invalidate();
    response.sendRedirect("/priv/logging.jsp");
    %>

  • Use alert box in javascript using xsl:message in Xalan

    There appears to be a xsl:message tag in XSLT. According to W3C, the implementation is dependent on the XSLT transformer.
    However, this tag output the message to my console.
    I would on the other hand like to output the message
    in a javascript alert box. I am using jaxp 1.1, the XSLT
    transformer is Xalan.
    Thanks in advance,
    taybw

    As you surely know, Xalan is running on the server. That's why the <xsl:message> appears there. As far as I know, the only options available to XSLT implementors are whether the message will appear or not, or possibly whether it will end the translation abnormally.
    Presumably you have Xalan producing HTML that will be rendered on the browser. If that's the case, then just replace the <xsl:message> element by some Javascript code that will pop up the alert box as soon as the browser loads the page you are writing.

  • Adobe Reader XI - javascript alert boxes appearing behind modal IE window

    Hi - I am experiencing the following issue:
    I am running Windows 7,  Internet Explorer 9 and Acrobat Reader XI. I am opening a pdf document in an IE modal dialog usiing the showModalDialog() function. My pdf document has a simple button which will display an app.alert box. The problem is that the alert box now appears in the back of the modal dialog, something it did not do before the upgrade to Reader version XI. This means that the user is forced to move the modal dialog out of the way to see and to click "OK" on the alert box.
    It doesn't seem like this is limited to app.alert boxes either. I tested on a new WIN7 machine and installed Reader XI. Making sure not to have opened Reader XI, I opened my pdf file in the modal window and it brought up the Reader XI EULA window and it was behind the modal dialog as well.
    Any help would be appreciated, I've tested on multiple machines and the problem seems to be with Reader XI & Internet Explorer 9, running on a Win7 OS. Thanks.

    Hello me_339,
    Yes, I'm also seeing the same behavior in Reader XI, and in Reader X, it works just fine. For the time being, uncheck 'Enable Protected Mode at startup' from 'Preferences > Security (Enhanced)' to avoid this situation.

  • I need help Centering a div box to a background image using dreamweaver cs5.5.

    I need help Centering a div box to a background image using dreamweaver cs5.5. Everything shift left when viewing on different size monitors?  See what I mean at
    www.woodlandhospice.com

    Have you looked at your page with images disabled?
    I urge you to re-think this approach to web design because images of text are not indexed by search engines, screen readers or translators.  Given the demographic group your site is targeting, you really need to ensure maximum web accessibility for all users.
    Navigation, headings and descriptions all need to be in real text -- not images of text.
    Ken is right.  Absolute positioning is pure poison for such a simple layout.  My advice is to start over with one of the pre-built Starter Pages in DW.  Go to File > New > Blank page > HTML.  Select a layout from the 3rd column and hit CREATE button.
    Nancy O.

  • Alert box in a servet

    Hi all,
    In my servlet , in doPost() method i will check some condition and forward to some page ie...
    Test Servlet
    doPost(){
    //Test some condition and save data.....
    response.sendRedirect("firstpage.do");
    now before redirecting to firtspage.jsp i want to display an alert box(may be javascript) saying "Your data has been saved" and then forward it to firstpage.jsp
    Is it possible to do that in servlet class ie two actions displaying an alert box and forwarding to a page......

    You could use a META-REFRESH to send a new GET request to your URL of choice after a period of time. The current response (with the refresh tag) could then display the information you want of use a javascript alert to do so.
    <html>
      <head>
        <meta http-equiv="refresh" content="2;url="http://domain/context/page.do">
        <title>Success</title>
      </head>
      <body>
        <h1>Success</h1>
        <p>Your data has been saved.</p>
        <p>If you are not automatically redirected in a few seconds,
           <a href="http://domain/context/page.do">click here</a>
        </p>
      </body>
    </html>

Maybe you are looking for