SharePoint Modal Dialog Resizing

Hi,
   I need set a functionality of modal resizing dialog in SharePoint UI. So if user get such dialog it should be possible to resize this one in runtime in right bottom corner. Is it possible in SharePoint modal dialog?
Example of modal dialog in Sharepoint
here
Thanx for any info.

Hi CaMeL023,
According to your description, my understanding is that you want to resize SharePoint Modal Dialog.
Per my knowledge, using JQuery seems to be the only available method to resize SharePoint Modal Dialog.
Here are some similar posts for you to take a look at:
http://blog.collabware.com/2013/03/22/tips-tricks-sharepoint-2013-modal-dialogs/
http://chadschroeder.blogspot.jp/2012/10/sharepoint-2010-easy-dynamic-resize-of.html
http://technical-experts.blogspot.jp/2013/01/resize-sharepoint-modal-dialog-using.html
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support

Similar Messages

  • Problem closing a modal dialog in SharePoint 2013

    I have an application page which is opened in a modal dialog in SharePoint. In this dialog I open a document with: createNewDocumentWithProgID 
    and afterwards when I want to close the dialog there is a problem using the call: 
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.commonModalDialogClose', 1, 'Selected');
    The call itself works in some contexts when I use it with "SP.SOD.execute", but it always causes other javascript errors to be thrown, and these errors sometimes causes problems with the application page. Below are the error messages and code, but
    my question essentially is: What is causing javascript errors in SharePoint after the close modal javascript function is called?
    The errors that occur in javascipts after commonModalDialogClose has been called are: 
    Unhandled exception at line 4118, column 17 in http://sp2013server/_layouts/15/init.debug.js?rev=hd6vYIlQjxmYnM/9RloMJA==
    0x800a138f - JavaScript runtime error: Object expected
    The javascript code snippet which throws the error (in init.debug.js ?):
    for (i = 0; i < am; i++) {
                    sodDep = mll[i];
                    if (!IsSodLoaded(sodDep) && (bSync || sodDep.state != Sods.loading)) {
                        LoadSodInternal(sodDep, bSync);
    And this error: 
    Unhandled exception at line 1270, column 5 in http://sp2013server/_layouts/15/init.debug.js?rev=hd6vYIlQjxmYnM/9RloMJA==
    0x800a138f - JavaScript runtime error: Unable to get property 'caller' of undefined or null reference
    The javascript code snippet which throws the error (in init.debug.js ?):
    function ULSOnError(msg, url, line) {
        return ULSSendExceptionImpl(msg, url, line, ULSOnError.caller);
    The problem which sometimes occurs in the application page because of these javascript errors is that something in the page becomes null after the errors occur. And then a null reference exception is thrown and the dialog will not close, instead an error message
    is shown. The null reference exception is like this (could be that the web request has become null?): 
    "Server Error in '/' Application. 
    Object reference not set to an instance of an object. 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below."
    Stacktrace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
       Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostLogRequestHandler(Object oSender, EventArgs ea) +120
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +79
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164
    olha

    Hi,
    Based on your description, when you use JavaScript close dialogue function in SharePoint, it occurs error.
    In SharePoint 2013, I suggest you can use the JavaScript like below:
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', closeModalDialog);
    Here is a detailed article for your reference:
    https://msdn.microsoft.com/en-us/library/jj245759.aspx
    Thanks
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jerry Guo
    TechNet Community Support

  • Open Hyperlink column in sharepoint list in Modal dialog box without redirecting to any page.

    Please help me to achieve:
    open Hyperlink column in SharePoint list in Modal dialog box without redirecting to any page.

    You can use the JSLink to achieve it:
    link
    [custom.development]

  • Item not being saved when item is in a jquery modal  dialog

    Hi all,
    I followed instructions found here :
    http://shijesh.wordpress.com/2010/04/10/jquery-modal-form-in-apex-4/
    to create a jquery modal dialog, this is the code I added in html header :
    <link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/
    redmond/jquery-ui.css" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
    <script type="text/javascript">
    $( function() {
       $('#ModalForm').dialog(
            modal : true ,
            autoOpen : false ,
            width : 425,
            closeText : 'Close',
            stack : false,
            resizable : false,
            buttons  : {
                Cancel : function() {
                         closeForm();
                Save : function() {
                    updateMEMOVELD();
    function openForm()
        $('#ModalForm').dialog('open');
    function closeForm()
        //$('#ModalForm input[type="textarea"]').val('');
        $('#ModalForm').dialog('close');
    function updateMEMOVELD ()
       var get = new htmldb_Get(null, &APP_ID.,   
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD')); 
      $('#ModalForm').dialog('close');
    </script>my situation is a little different, my modal does not have to perform an sql update, just change a field
    the user will then save in the main form
    for some reason the field never gets updated in the db
    I even created a on demand application process called f_memo :
    BEGIN
      APEX_UTIL.SET_SESSION_STATE('P9_MEMOVELD',:P9_MEMOVELD);
      htp.p(:P9_MEMOVELD);
    END;why is my field not send to the db ?
    it works when I delete this from the region header :
    < d i v id="ModalForm" title="Add Person" style=" d isplay:n one  "   >but then of course I no longer have a modal dialog
    what's wrong ?
    I put the code online at apex.oracle.com
    workspace XONIXRS
    login/password demo/demorun the application
    click on lijst facturen (invoices) (in the right sidebar region)
    then click on the zoeken (search) button
    a report appears, click on edit on the first line (200900017)
    now a form appears, click on the outright button memo
    now the modal shows up, change the field and click on save
    click on ok (for the alert) and then click on Save invoice
    you will remain on the same page
    now click on annuleren
    and then click on edit on the first line (200900017) again
    then click on memo again, you will see the memo has not been changed
    how comes ?
    Kr
    Martin

    The issue is that creating a modal of a region lifts that region from the HTML. Just have a look at the DOM when you run your page and not the source html, because that does not reflect changes to the dom made on page load. This means that your memo-field is removed from the FORM-tags, and effectively won't submit to session state. The item is not processed when you submit the page! You can track that through debugging your page. Memo is not saved and not processed.
    Trying to save the value to session state is not enough, it doesn't really matter in this case. The moment you submit the page, the session state will get overwritten by the submitted values of the items.
    So what i did:
    <ul>
    <li>move P9_MEMOVELD to region FACTUUR, together with all the other db fields</li>
    <li>change the type to hidden</li>
    <li>set value protected to NO</li>
    <li>in the modal region create a new page item P9_MEMOVELD_POP, type textfield</li>
    <li>set the source to always use a page item as source, with source P9_MEMOVELD</li>
    <li>changed function updatememoveld:
    function updateMEMOVELD ()
       var get = new htmldb_Get(null, &APP_ID.,   
                        'APPLICATION_PROCESS=f_memo', 0);
       get.add('P9_MEMOVELD',$v('P9_MEMOVELD'));
       var gReturn= get.get();
       //alert(gReturn);
       //alert($v('P9_DATUM'));
      $s('P9_MEMOVELD',gReturn);
      alert($v('P9_MEMOVELD'));
      $s('P9_MEMOVELD_COPY',$v('P9_MEMOVELD')); 
      $s('P9_MEMOVELD',$v('P9_MEMOVELD_POP'));
      $('#ModalForm').dialog('close');
    }Whether you want or need the session state set is up to you, it depends on if you use this somewhere else dynamically on the page and thus would influence results there, but i don't think it will (it's a memo field...)</li>
    </ul>
    Extra remarks:
    <ul>
    <li>be careful with including jquery libraries! The standard libraries are included, yet you add previous versions too! (1.4.2) This might lead to issues...</li>
    <li>use your templates better. Why would you wrap a region in div tags? Change or add a region template to be div tags. You can then easily assign a static id to this region, and target it. This will save you from wrapping wrapped wrappers (cause that is what the generated code looks like in the end).</li>
    </ul>

  • Passing values to a modal dialog window...

    Hi All,
    Is there a way to pass massive amount of data into a pop-up
    modal dialog window? I have this following code that keeps giving
    me a JavaScript error whenever I have like 2000 characters in the
    documen.myForm.Product_Details textarea field. Any suggestions or
    advice is greatly appreciated, and thank you very much in advance!
    function Modal_NewWin() {
    var width = 750;
    var depth = 200;
    var productDetails = document.myForm.Product_Details.value;
    var url =
    "PreviewProducts.cfm?ProductID=#GetProductInfo.ProductID#&ProductDetails="
    + productDetails;
    var sfeatures = "dialogHeight: " + depth + "px; dialogWidth:
    " + width + "px; dialogTop: px; dialogLeft: px; center: Yes; help:
    No; resizable: No; status: No;";
    return window.showModalDialog(url,'',sfeatures);

    can you use JSStringFormat() without first submitting the
    form??? (so CF can see the value in the form field jsstringformat
    is applied to..)
    submitting a form to the preview page will solve the problem
    for sure, but then you will somehow have to have 2 different action
    target for the form, so that clicking 'preview' button submits the
    form to the modal window, and clicking a 'save' button will submit
    the form to another action page that inserts values into a db...
    you can do that, again with some more javascript...
    as html-escaping javascripts are readily available on various
    script sites, i think it will be easier to employ one of them...
    (please note that i am assuming quiet a lot about how the
    AppDeveloper's form works and what it does, since he never
    explained it himself...)

  • Open Modal Dialog on Page Load of MOSS 2010

    Hi All
    We are trying to open modal dialog when home page opens on Sharepoint portal 2010
    We followed these steps:
    1. Created Page
    2. Created HTML Form Editor web part
    3. Added following code to its source
    <script type="text/javascript" language="javascript">
    Alert('Shahab');
    _spBodyOnLoadFunctionNames.push("HideNewIcons");
    function HideNewIcons(){
      var options=SP.UI.$create_DialogOptions();
    options.url='http://servername/sites/itd/SitePages/Test.aspx?IsDlg=1';
    options.height = 400;void(SP.UI.ModalDialog.showModalDialog(options))
    _spBodyOnLoadFunctionNames.push("HideNewIcons");
    </script>
    4. Neither ALERT nor MODAL DIALOG appear.
    We are on MOSS 2012. I checked the net and found there might be some issues in 2010. However, it works best on 2007
    Is there any other solution?
    Regards
    SSA

    Hi ,
    I understand that you want to open a modal dialog on page load in SharePoint 2010. The code Ashish provided works great. But you need to put the code on the page directly by editing the page in SharePoint designer(When putting the code in Content Editor
    Web Part ,the modal dialog doesn’t pop up correctly).
    Edit the page in SharePoint designer in Advanced Mode.
    Browse to the bottom of the code view .
    Add the code before the </asp:Content> tab.
    <script language="javascript" type="text/javascript">
            ExecuteOrDelayUntilScriptLoaded(yourFunction, 'SP.js');
            function yourFunction() {
                var options = { url:
    '/_layouts/viewlsts.aspx', title: 'Title, Description, and Icon', width: 640, height: 400 };
                 SP.UI.ModalDialog.showModalDialog(options);
             _spBodyOnLoadFunctionNames.push("yourFunction()");
    </script>
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

  • [Forum FAQ]Open Calendar Overlay item In a Modal Dialog

    Introduction:
    In SharePoint Calendar, there is a feature called Calendar Overlay, it would display multiple Calendars items in one Calendar. However, when we click the items in Calendar Overlay, it would redirect to a new tab.
    In this article, I would make a simple demo about how to use the JQuery to make the Calendar Overlay item open in the same window, as known as, open in a modal dialog.
    Solution:
    We can add the following code in Calendar view page using SharePoint Designer or paste the code within a Content Edit Web Part.
    <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    setInterval(function () {
    $("a[href*='DispForm.aspx']").each(function () {
    $(this).attr("onclick", "openDialog('" + $(this).text() + "','" + $(this).attr("href") + "')");
    $(this).attr("href", "javascript:void(0)");
    $(this).removeAttr("target");
    }, 900);
    function openDialog(title, url) {
    var options = {
    title: "Calendar - " + title,
    autoSize:true,
    url: url
    SP.UI.ModalDialog.showModalDialog(options);
    </script>
    Result:
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    How about "launch as dialog: yes" from advance settings. If I click on blue<any> color but not hyperlink, it will open in modal.
    [email protected]

  • How to use Sharepoint Modal Popup loader in Sharepoint-Hosted Apps

    Hi,
    I have a requirement to use a modal popup as loader in SharePoint-Hosted Apps. I have used this like following-
    SP.UI.ModalDialog.showWaitScreenWithNoClose(
    'Please Wait',
    'while we retrieve...',
    '400',
    '600');
    But it does not work if we have "SP.Js" and "SP.runtime.js" included in the page. If we remove the mentioned script, then only modal works, but other functionality related to "Sp.Js" does not work.
    Please let me know if there is any solution for the problem.
    Thanks in Advance.

    Hi,
    Chk out this link also
    http://stackoverflow.com/questions/4015159/using-jquery-to-display-a-modal-please-wait-dialog-box-message
    http://bernado-nguyen-hoan.com/2012/04/23/how-to-close-sharepoint-modal-wait-screen-after-postback-when-page-is-in-dialog-mode/
    http://sharepoint.stackexchange.com/questions/24391/how-do-i-show-a-loading-div-when-opening-a-modal-dialog-from-a-customaction
    http://blog.collabware.com/2012/10/30/tips-tricks-sharepoint-2010-modal-dialogs/
    Thanks
    Jaison A
    http://infomoss.blogspot.in

  • SharePoint Modal Popup

      Hi..
     How to create a SharePoint Modal Popup window and when we select some value in modal popup that value should be redirected to parent form..
    Ravindranath

    In the option dialogReturnValueCallback you can define a function that will be executed after the dialog was closed. By now you create a delegate pointing to CloseCallback3 but this is not defined in your code.
    If you call SP.UI.ModalDialog.RefreshPage in this callback method the page gets refreshed after the dialog was closed with OK.
    function OpenCustomDialog(dialogUrl, dialogWidth, dialogHeight, dialogTitle, dialogAllowMaximize, dialogShowClose) {
    var options =
    url: dialogUrl,
    allowMaximize: dialogAllowMaximize,
    showClose: dialogShowClose,
    width: dialogWidth,
    height: dialogHeight,
    title: dialogTitle,
    dialogReturnValueCallback: function(dialogResult)
    SP.UI.ModalDialog.RefreshPage(dialogResult)
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

  • Help with building the JQuery UI Modal Dialog

    Version 4.1.1.00.23
    Hello,
    I have requirement to create validation on a manually created tabbed form to display a message to the user that they haven't entered values on 12 fields on the row.
    The message is to ask if they really want to save the record or not. If they want to save the record call apex.submit('SUBMIT') and if not call apex.submit('CANCEL2').
    I've have no experience with JQuery and my javascript isn't too strong either.
    I'm hoping someone can help me to get this working.
    The message I want to display, but I don't know how to add that to the dialog box is:
    "You have no time assigned to your Forecast. Do you want to save this Forecast without time entered?<br /><br />"Yes" to save the Forecast.<br /><br />"No" to return with no changes."
    My code so far is:
    [code]
    function confirmNoTimeSaved()
        if (html_GetElement('P11_CONFIRMNOTIMESAVED').value == '1')
            $(function()
                $( "#dialog-confirm" ).dialog({
                                                    resizable: false,
                                                    positon: {my: "center", at: "center", of: window},
                                                    title: "Confirm Saving With No Time",
                                                    height:140,
                                                    width:500,
                                                    modal: true,
                                                    autoOpen: false,
                                                    buttons: {"Yes": function(){apex.submit("SUBMIT");},"No": function(){apex.submit("CANCEL2");}};
        else
            apex.submit('SUBMIT');   
        $x_Value('P11_CONFIRMNOTIMESAVED',NULL);
    [/code]
    Please let me know if I need to explain something.
    Thanks,
    Joe

    pkpanda,
    Thanks for replying. Yeah I looked at the plugins and the problem with the one you referenced is that it's for 4.2 and we're on 4.1.
    Is there someone that can help me with this?
    Thanks,
    Joe

  • Opening images in SharePoint modal dialogue box

    Hello Friends,
    I have a world map and upon clicking each continent should open its respective continent information which is a stored in wiki pages.
    I am using the SharePoint designer to create hot spots and then open the wiki pages of respective continents in same tab or another tab or another window. But my requirement is to open them in SharePoint dialog box.
    Is it possible to do that and how?

    Hi,
    According to your post, my understanding is that you wanted to open the respective continent information in dialogue box.
    To open images in SharePoint modal dialogue box, you can refer to:
    Opening Images and Pages in a Dialog / Lightbox
    To open wiki pages in SharePoint modal dialogue box, you can refer to:
    SharePoint 2010 Dialog box using JavaScript
    How to open a page in SharePoint 2010 Dialog Framework?
    SharePoint 2010 Pop-Up Dialogs / Kyle Schaeffer
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Remove "Page" Link in SharePoint Modal Popup

     Hi,.
     How to remove "Page" Link in SharePoint Modal Popup as shown below
    Ravindranath

    Hi Ravindranath,
    I could see you are loading a custom webpart inside modal dialog, try adding the below code in your webpart design file(.ascx)
    <style type="text/css">
    body {
    overflow: auto !important;
    #s4-leftpanel {
    display: none;
    .s4-ca {
    margin-left: 0px !important;
    #s4-ribbonrow {
    height: auto !important;
    min-height: 0px !important;
    #s4-ribboncont {
    display: none;
    #s4-titlerow {
    display: none;
    .s4-ba {
    width: 100%;
    min-height: 0px !important;
    #s4-workspace {
    float: left;
    width: 100%;
    overflow: auto !important;
    body #MSO_ContentTable {
    min-height: 0px !important;
    </style>
    Please remember to click 'Mark as Answer' on the answer if it helps you
    Regards,
    subhash reddy

  • Open Modal Dialog in Photoshop (Mac)

    I can't seem to open a modal dialog in Photoshop on the Mac with the CS SDK. The code works fine in InDesign. In Photoshop, the modality is there (the application responds to mouse clicks with a bell) but the window is not visible. Here is my mx:WindowedApplication:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
              <![CDATA[
                   import com.adobe.csxs.types.CSXSWindowType;
                   import mx.core.Window;
                   protected function onClick(event:MouseEvent):void
                        var w:Window = new TestDialog();
                        if (w) {
                             w.type = CSXSWindowType.MODAL_DIALOG;
                             w.resizable = false;
                             w.open();
              ]]>
         </mx:Script>
         <mx:Button x="10" y="10" label="Open Popup" click="onClick(event)"/>
    </mx:WindowedApplication>
    The Window itself is more or less copied from the "MakeSideHeads" sample project:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Window xmlns:mx="http://www.adobe.com/2006/mxml"
                 title="Test"
                 titleAlignment="center"
                 layout="absolute"
                 width="300"
                 height="100"
                 showStatusBar="false">
         <mx:Script>
              <![CDATA[
                   private function myCloseWindow():void{
                        this.close();
              ]]>
         </mx:Script>
         <mx:Canvas width="100%" height="100%" id="TestPanel" backgroundColor="#D2D2D2">
              <mx:VBox verticalAlign="middle" horizontalAlign="center" height="100%" width="100%">
                   <mx:HBox height ="90%" width="100%">
                        <mx:Text width="100%" height="100%" text="Some Text"/>
                   </mx:HBox>
                   <mx:HBox  height = "10%" horizontalAlign="center">
                        <mx:Button id="CloseButton" label="Close" click="myCloseWindow()" />
                   </mx:HBox>
              </mx:VBox>
         </mx:Canvas>
    </mx:Window>
    This seems like quite a significant bug. Or am I missing something?

    Hello,
    I've tested this one and it works.
    main.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <csxs:CSXSWindowedApplication xmlns:csxs="com.adobe.csxs.core.*"
         xmlns:mx="http://www.adobe.com/2006/mxml"
         historyManagementEnabled="false">
         <mx:Script>
              <![CDATA[
                   import com.adobe.csxs.types.CSXSWindowType;
                   import mx.core.Window;
                   import ModalDialog;
                   public function showModal():void
                        var window:Window = new ModalDialog;
                        window.type = CSXSWindowType.MODAL_DIALOG;
                        window.resizable = false;
                        window.open();
              ]]>
         </mx:Script>     
              <mx:Button label="Display Modal Dialog" click="showModal()"/>          
    </csxs:CSXSWindowedApplication>
    The following is the ModalDialog.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Window
         xmlns:mx="http://www.adobe.com/2006/mxml"
         layout="absolute"
         width="300"
         height="200"
         creationComplete="onCreationComplete()"
         title="Modal Dialog"
         >
         <mx:Script>
              <![CDATA[
                   private function onCreationComplete():void
                        //Center the window on the screen
                        var screenBounds:Rectangle = Screen.mainScreen.bounds;
                        nativeWindow.x = (screenBounds.width - nativeWindow.width) / 2;
                        nativeWindow.y = (screenBounds.height - nativeWindow.height) / 2;
              ]]>
         </mx:Script>
         <mx:VBox verticalAlign="middle" textAlign="center" horizontalAlign="center">
              <mx:HBox horizontalAlign="center">
                   <mx:Label text = "This is an example of a modal dialog box."/>
              </mx:HBox>
              <mx:HBox horizontalAlign="center">
                   <mx:Button label = "Close" click="close()"/>
              </mx:HBox>
         </mx:VBox>
    </mx:Window>

  • Modal Dialog

    Hi..
    On sample Page load we are showing modal popup dialog using SP.UI.ModalDialog.showModalDialog. But in modal popup page we are having  2 btns agree and disagree. when we click any one we need to redirect to another page but its redirecting
    with  modal dialog screen, so how to remove modal dialog screen (i.,e full page when we redirect from btn click)
    Tagore

    Please refer - Redirection to another page from SP.UI.ModalDialog
    Problem
    Redirecting to another page from the SP.UI.ModalDialog Modal window without closing the window will not work and it always opens a new modeless window where the page will be displayed. The dialog framework supports the Source=url querystring variable like the
    rest of SharePoint. But this has to be part of the Dialog Options to redirect to another page. However, if you have a requirement to dynamically get the page which needs to be redirected from the dialog then this may create a problem...
    Solution
    The solution for the problem would be to create an intermediate html page. This would have a <frameset> html element with a single frame and set the src attribute with the page which you actually need to load inside the Modal Dialog. So now if the user
    clicks the link which navigates to another page, it will be opened within the same dialog window instead of a new window. Here's how it works...
    more links- http://sharepoint.stackexchange.com/questions/93386/sharepoint-2010-modal-box-with-multiple-button-redirects
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Help with modal dialog returning a value to the calling page

    Greetings,
    Apex Version: 4.1.0.0.32
    What I am trying to do is to create a modal dialog that is called from a form page. The dialog will present the user with an IR report that will allow the him to select a row and return a value from that row to a field on the calling page. I have it working in Firefox, but I get an error using IE 8. I hope someone can show me why it is not working in IE.
    Here is how I am doing it:
    From the calling page:
    Created a button
         Action: Redirect to URL
         URL Target: javascript:var rc = window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
    On the called page:
    The called page is an IR report where the query returns this as one of the columns:
    *(Note: I had to put a dot '.' in front of the onclick to get it to show in this thread. It is not there in my real code.)*
    select
    <a href="#" name="z" style="color:blue; text-decoration:underline;" .onclick="javascript:passBack(''' || LOT_NO ||''');">Select</a>' SelectThis
    , column1
    , column2
    from sometablename;This resolves the anchor to:
    <a .onclick="javascript:passBack('232158');"  href="#">Select</a>Here is the Javascript function that is called from the anchor onclick:
    function passBack(passVal1)
      opener.document.getElementById("P75_ITEM1").value = passVal1;
      close();
    }When I run this in Firefox, it works as expected. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and it returns the correct value back to the calling page and closes the modal dialog.
    When I run it in IE8, it fails. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and I get this error: “opener.document is null or not an object”.
    I hope that is clear and that someone can help.
    Thanks
    Larry

    A quick google search determines that window.opener doesn't exists when using window.showModalDialog
    Suggestions range from using window.open instead of window.showModalDialog to using dialogArguments instead of window.opener
    Try the following:
    In the parent page define a getPopupValue() function:
    function getPopupValue(){
       var dr =  window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
        if ( (dr != undefined) && (dr != '') && (dr != false) ){
         $x("P75_ITEM1").value = dr;
    }Change the button url to call the function:
    javascript:getPopupValue(); On the popup page change the passback function to:
    function passBack(passVal1)
      returnValue = passVal1;
      close();
    }

Maybe you are looking for

  • How can I delete a video from an album on my iPhone 5?

    How can I delete a video from my iPhone 5? I created an album and accidentally placed a video in the album and want to delete it. Is it possible to delete a video or picture from an album? Thanks!

  • Problems with Automator in Lion's text to audio action

    So, I'm trying to become more productive by turning stuff I don't have time to read into something I can listen to in the car. I created the following Automator script, but every time I run it, it crashes. Here's the first part of the problem reporte

  • Software Distribution Flow between SCCM (2013) and BMC (8.1), using Orchestrator

    Hi, I see same question has been asked in the past with older versions of SCCM, BMC and Opalis...but would like to know if there are any specific benefits or advancements or even higher feasibility of implementing below, using Orchestrator 1) Data l

  • Inserting custom customer record/case fields into email marketing

    Question: Here is what we want to achieve: we want to allow our customers to store three words we want to incorporate each of theses works into an email sent on a anniversary Is it not possible to achieve what we want? Answer: You are correct. It's c

  • Sky+ box conection to ipad

    My sky+ box loses conection with my iPad on an almost daily basis. If I turn off  the box from the mains then reconnect my sky+ box then works fine. But this only lasts 36 hours at the most. Is there an easy rectification? I think this only started f