How to customize URL in modal dialog script?

Hi All,
I am using JSLink to open Modal dialog, want to customize the url by adding '&DefaultView=Email' to URL in script. How to do this in below script:
(function () {
// Create object that have the context information about the field that we want to change it output render
var pictureFiledContext = {};
pictureFiledContext.Templates = {};
pictureFiledContext.Templates.Fields = {
//"Picture" is the column name.
"Picture": { "View": pictureFiledTemplate }
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(pictureFiledContext);
function pictureFiledTemplate(ctx) {
var url= ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
var itemID=ctx.CurrentItem.ID;
var itemTitle=ctx.CurrentItem.Title;
return "<img alt='"+url+"' src='"+url+"' complete='complete' onclick=\"openModalDialog('EditForm.aspx?ID="+itemID+"','"+itemTitle+"')\" />";
function openModalDialog(url,title)
var options = {
title: "Item-"+title,
width: 600,
height: 600,
url: url
SP.UI.ModalDialog.showModalDialog(options);
return false;
Thanks in advance!

You should be able to do it like this:
function openModalDialog(url,title)
var options = {
title: "Item-"+title,
width: 600,
height: 600,
url: url + "&DefaultView=Email"
Brandon Atkinson
Blog: http://brandonatkinson.blogspot.com

Similar Messages

  • How does EventQueue work with modal dialogs?

    Can anybody point me to some documentation/article/book etc. which thoroughly explains how exactly the EventQueue and EventThread work when a modal dialog is being opened? I assume dispatchEvent() for the event that opens a modal dialog does not return until the modal dialog is closed. If so, how are events handled while a modal dialog is open?
    I can't seem to find any book that goes into detail of these Swing/AWT internals.
    Thanks,
    -Martin Roth
    [email protected]

    The short answer is that a second event pump is created while the modal dialog is visible. The original event pump (which is different than an event thread) is indeed blocked until the dialog is closed. The code creating the new pump is in the java.awt.Dialog::show () method.
    The event pump is part of the java.awt.EventDispatchThread class.

  • How to customize the Save as dialog Box for saving Web Query???

    Hello,
       we are usnging SAP NW Portal and BI 7.0 (SP14).
       We have published BI web queries in the Portal and it works just fine, now when the User select the Button "Save As" in the Context Menu of any web query, this will open a new Dialog Box name "Save As Dialog Box", so from this dialog box the user can select where to save the query, he/she have 3 options* to save qureies: My Favorites, Bex Portfolio and MyPortfolio, this also works fine.
      My Quetsion is: How can i customize the View of this "Save As" dialog box, so at the end the User can only select 2 Options:  My Favorites + MyPortfolio. So how to hide the Tab:  Bex Portfolio in the Dialog Box.
    Points for any good answer.
    Many Thanks and Regards,
    Nazih
    Edited by: Nazih Kayyali on Feb 3, 2009 4:04 AM

    In what you have posted, there is no reason it shouldn't work the same way in Acrobat 9. I would recommend that you submit your complete application to developer support.

  • How to post URL link in sap script

    How to give link in sap script..
    For example if someone select [sap|www.sdn.sap.com]. it will direct to www.sdn.sap.com
    Regards
    Sas
    PS: Insert Test --> Hypertext option tried but not working properly...
    Hey no replies....any one any idea?

    I don't think sapscripts does  have the  option for  entering  hyperlinks.
    SAP has provided  smartforms/advance forms:
    Link: [hyperlink - smartform;
    Link: [https://help.sap.com/saphelp_47x200/helpdata/en/9b/e3b0e0c2a711d3b558006094192fe3/
    frameset.htm]
    Link: [Hyperlink in smartform]
    Link: [How to create a hyperlink in smartform]

  • How to pop up a Modal dialog on the top.

    Hi ALL,
    I want to pop up a dialog from background thread, and make it on the top level, any suggestion please.
    First: JFrame.show(), and then start a background thread to monitor some event.
    when the event happen, it will start to pop up a warning message, the user has to response to it.
    otherwise user can not do anything, however the background is still running.
    I want to use JOptionPanel, but it seem does not work good.
       _timer = new Timer(30*1000, new ClockListener());
      class ClockListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                    if(event)
                      popUpDialog();
    .........Thanks in advanced!

    Use a SwingWorker. Do the backgrround monitoring in a while(true) loop (with a Thread.sleep) in doInBackground. Invoke process when your event is detected and show the dialog from publish.
    db

  • How to set width for this modal dialog box?

    Hi All,
    How to set width to this modal dialog box:
    <input id="btnVote" onclick="javascript:SP.UI.ModalDialog.showModalDialog({ url: &#39;../Lists/Sports%20Activities%20Voting/NewForm.aspx&#39;, title: &#39;User Survey&#39;}); return false;" type="button" value="Vote"/>
    Thanks in advance!

    set as bellow:
    <input id="btnVote" onclick="javascript:SP.UI.ModalDialog.showModalDialog({ url: &#39;../Lists/Sports%20Activities%20Voting/NewForm.aspx&#39;, title: &#39;User Survey&#39;,width:700,height:350}); return false;" type="button" value="Vote"/>
    yaşamak bir eylemdir

  • How to call jquery function when i close modal dialog box ?

    Hello,
    I need to call one jquery function when I click on close button of modal dialog box.Can anyone please let me know how can I implement it ?
    Thanks,
    Dipti Chhatrapati

    Hi Dipti,
    If my understanding is correct, you are using SP Modal Dialog and want to track the close event of this dialog. Then you may use
    dialogReturnValueCallback parameter of Options variable. Follow is the code sample:
    function ShowModal() {
        ExecuteOrDelayUntilScriptLoaded(function () {
            var options = {
                url: 'page1.aspx',
                tite: 'Add Title',
                width: 800,
                height: 450,
                allowMaximize: true,
                showClose: true,
                dialogReturnValueCallback: scallback
            SP.UI.ModalDialog.showModalDialog(options);
        }, 'sp.js');
     function scallback(dialogResult, returnValue) {
          if (dialogResult == SP.UI.DialogResult.OK) {
               // call your Jquery method here...
    Thanks, Ram

  • How to finish several modal dialogs by  "OK"-labeled Buttons ?

    Hello community !
    In my Applet I use some modal dialogs . Each of them should be finished by pressing the "OK"-labeled Button . In my ActionListener class there would be statements like that:
    if(labeltest.equals("OK"))
    dialog1.dispose();
    if(labeltest.equals("OK"))
    dialog2.dispose();
    if(labeltest.equals("OK"))
    dialog3.dispose();
    But how to distinguish them ? Is this possible or not ?

    Your description of JOptionPane.ShowXxxDialog-Methods is interesting . I haven't known before . My question was how to finish ...I think , I did show it to abstract , why I want to solve the problem this way , but it works . Here are the code sequences for those 3 "OK"-Buttons:
         Button okbutton = new Button();
         Button ok2button = new Button();
         Button ok3button = new Button();
    // --------------- create Info-Window (Dialog) -------------------------
    // *use okbutton*
         dialog.setSize(600,600);
         dialog.addWindowListener(
                new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                    dialog.setVisible(false);
         dialog.setVisible(false);
         JPanel p = new JPanel();
         p.setLayout(new BoxLayout(p,BoxLayout.Y_AXIS));
         Label lprodukt = new Label("Product :  ...");
         Label lversion = new Label("Version : ...");
         Label lautor = new Label("Author     :  ...");
         Label llabor = new Label("Department: ...");
         Label lcopyright = new Label("Copyright (c) ...");
         lprodukt.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
         lversion.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
         lautor.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
         llabor.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
         lcopyright.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
    //     Button okbutton = new Button();
         okbutton.setFont(new Font("Arial", Font.PLAIN, 20));
         okbutton.setLabel("OK");
         okbutton.addActionListener(new CMeinActionLauscher());
         p.add(lprodukt);
         p.add(lversion);
         p.add(lautor);
         p.add(llabor);
         p.add(lcopyright);
         Panel panel2 = new Panel();
         panel2.setLayout(new FlowLayout());
         panel2.add(okbutton);
         dialog.setLayout(new BorderLayout());
         dialog.add(p,BorderLayout.CENTER);
         dialog.add(panel2,BorderLayout.SOUTH);
         dialog.pack();
         // -------------------- Info-Window End ---------------------------------
    // --------------- create Error-Window1 (Dialog) -------------------------
    // *use ok2button*
         derror.setSize(400,600);
         derror.addWindowListener(
                new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                    derror.setVisible(false);
         derror.setVisible(false);
         JPanel ep = new JPanel();
         ep.setLayout(new BoxLayout(ep,BoxLayout.Y_AXIS));
         Label text1 = new Label("       Filetyp has to be  \".ATT\"  !!!");
         text1.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
    //     Button ok2button = new Button();
         ok2button.setFont(new Font("Arial", Font.PLAIN, 20));
         ok2button.setLabel("OK");
         ok2button.addActionListener(new CMeinActionLauscher());
         ep.add(text1);
         Panel epanel2 = new Panel();
         epanel2.setLayout(new FlowLayout());
         epanel2.add(ok2button);
         derror.setLayout(new BorderLayout());
         derror.add(ep,BorderLayout.CENTER);
         derror.add(epanel2,BorderLayout.SOUTH);
         derror.pack();
         // -------------------- Error-Window1 End --------------------------------
      // --------------- create Error-Window2 (Dialog) -------------------------
    // *use ok3button*
       doperr.setSize(400,600);
         doperr.addWindowListener(
                new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                    doperr.setVisible(false);
         doperr.setVisible(false);
         JPanel op = new JPanel();
         op.setLayout(new BoxLayout(op,BoxLayout.Y_AXIS));
         JLabel optext1 = new JLabel("Operanderror occured !!!");
         optext1.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
         System.out.println("operror: "+operror.getText());
         operror.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
         JLabel optext2 = new JLabel("Korrektur vom Entwickler anfordern !!!");
         optext2.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
    //     Button ok3button = new Button();
         ok3button.setFont(new Font("Arial", Font.PLAIN, 20));
         ok3button.setLabel("OK");
         ok3button.addActionListener(new CMeinActionLauscher());
         op.add(optext1);
         op.add(operror);
         op.add(optext2);
         Panel opanel2 = new Panel();
         opanel2.setLayout(new FlowLayout());
         opanel2.add(ok3button);
         doperr.setLayout(new BorderLayout());
         doperr.add(op,BorderLayout.CENTER);
         doperr.add(opanel2,BorderLayout.SOUTH);
         doperr.pack();
      // -------------------- Error-Window2 End --------------------------------
      class CMeinActionLauscher implements ActionListener
        public void actionPerformed(ActionEvent e)
          String label;
          boolean result = false;
          Object source = e.getSource();
          label = e.getActionCommand();
          System.out.println("label: "+label);
          if(label.equals("Programm beenden"))
             System.exit(0);
          if(label.equals("Öffnen"))
             DateiLaden();
          if(label.equals("Info"))
              dialog.setBounds(450,400,400,260);
              dialog.setVisible(true);
              dialog.pack();
          if(label.equals("Beschreibung Software-Id-Verwaltung"))
    //          doku.setBounds(550,350,950,600);
              doku.setBounds(400,350,950,600);
              try
                  System.out.println("url: "+url);
                  JEditorPane htmlPane = new JEditorPane( url );
                  htmlPane.setEditable( false );
                  htmlPane.setContentType("text/html");
                  htmlPane.putClientProperty(JEditorPane.W3C_LENGTH_UNITS, Boolean.TRUE);
                  htmlPane.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 18));
                  htmlPane.validate();
                  htmlPane.repaint();
                  doku.add( new JScrollPane(htmlPane) );
                  System.out.println("url: "+url);
              } catch( IOException eio )
                    System.err.println( "Error displaying " + url );
              doku.setVisible(true);
    //          doku.pack();
          if(label.equals("SYSCON-Kdo erzeugen"))
             KdoErzeugen();
            if (source == ok2button)
                derror.setVisible(false);
                derror.dispose();
            if (source == ok3button)
                doperr.setVisible(false);
                doperr.dispose();
            if (source == okbutton)
                dialog.setVisible(false);
                dialog.dispose();
      }For the ok2button I could use JOptionPane.showMessageDialog but how to do it for th otherones ?

  • How do I set (or auto populate) the value of a modal dialog field using javascript?

    I have a Modal Dialog on my SharePoint 2010 page the following fields: Your Name, Subject, Priority, Message. 
    It links to a list I have on the site. The second field, Subject, I want to auto populate it when the window opens, so the user can leave it as is or modify the subject. I want to set the field value using javascript. 
    I've tried setting the field with this code:
    document.getElementById('Subject').value = "Test";
    and also, this:
    setFieldValue('Subject','My custom value');
    Neither work. 
    How do I set the value of the subject field when the user first opens the dialog using javascript?
    Please help.

    I am sure, you are looking at default field value of a list column(single line) in a modal window, if so please try below code
    <script src="https://code.jquery.com/jquery-2.1.0.min.js" type="text/javascript" abp="397"></script><script type="text/javascript" abp="398">
    $(document).ready(function(){
    $('input[name*="Subject"]').val("Test");
    </script>​​​​​​
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • How to remove the default icons from the toolbar of modal dialog box screen

    Hello Friends,
    Iam calling a screen from function module using CALL SCREEN statement.
    The screen is of type Modal Dialog Box. I created some input fields and buttons in the screen. When the screen is displayed, I can see the tool bar at the bottom along with the input fields and buttons in the screen.
    These icons are Continue(Enter), Check, Cancel. How can I supress this??
    I mean in my screeen I want only my input fields and buttons but not the default toolbar. How to do that?
    Regards,
    Raju

    Hi Raju,
    Try this...
    First try to capture the F-codes of ur button apppearing on the dialog box and then exclude it from the PF-status by passing it to itab.
    types: begin of tab_type,
            fcode like rsmpe-func,
           end of tab_type.
    data: tab type standard table of tab_type with
                   non-unique default key initial size 10,
          wa_tab type tab_type.
    clear tab.
    move 'DELE' to wa_tab-fcode.
    append wa_tab to tab.
    move 'PRIN' to wa_tab-fcode.
    append wa_tab to tab.
    set pf-status 'STA3' excluding tab.
    Cheers,
    Simha.
    Reward all the helpful answers..

  • How can I control modal dialogs in Applescript without a mouse?

    I am trying to use a Griffin PowerMate button to select between two options in an Applescript modal dialog and cannot seem to figure out how to do this. I can set a default button, but I want the user to select between two options (shifting the highlighted button) via the PowerMate. Does anyone have a suggestion?
    I can program the PowerMate to send/emulate a particular keystroke, but I do not know how to make the standard Applescript dialog respond to a keystroke, only a mouse action. I'm trying to create a mouseless interface.
    In short, I want the dialog respond to "Twist to the left and press the button to select A, Twist to the right and press the button to select B." Thoughts?
    Thank you.

    Your System Preferences > Keyboard Shortcuts > Full Keyboard Access preference will need to be set to "all controls", but it also depends on where the particular button is located in the dialog.  The tab key will highlight the buttons from left to right, shift-tab will highlight the buttons from right to left, and the spacebar will "press" the currently highlighted button.  In addition, the escape key will choose the Cancel button (if there is one), and the return key will choose the default button (if a default has been set the button itself will be lit).

  • How to make a dalog process custom events when blocked by modal dialog

    Hi,
    I would like to understand the way modal dialogs block other dialogs so that I can properly solve an issue I'm having with two modal dialogs, one blocking the other.
    I have an application, netbeans platform based, that opens a JDialog, NewDiskDlg, with it's modal property set to true. This dialog is responsible for starting a thread that will process a given number of files, from time to time, depending on some conditions, this thread will send events to the NewDiskDlg.
    When this thread is started, the NewDiskDlg creates a new JDialog, also with the modal property set to true. Both dialogs have the same parent, the main window. And this works as I expected, the second dialog, ActiveScanningDlg, opens on top of the NewDiskDlg and, until the thread stops, the dialog stays visible.
    When the thread stops an event is sent to this two dialogs signaling that the job has been completed, and here is my problem. The second dialog, the one that is visible when the event arrives, receives the event and executes the dispose() method, releasing control to the NewDiskDlg in the back, but the NewDiskDlg does not receive the event and does not process it correctly.
    I understand the no input can be sent to a blocked window, but does that include calling upon the window's methods?
    I've been looking for some help on this but my search terms are not good enough to provide me with any useful information. I've also read the topic on the focus system that is present in the Java Tutorial but I feel that that is not what I should be looking at.
    The following code is a snippet of the important parts that I described:
    NewDiskDlg has the following methods to process the events
        public void readingStarted(ReadingEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    scanningDlg.showCentered();
        public void readingFile(ReadingEvent evt) {
            //DO NOTHING
        public void readingStopped(ReadingEvent evt) {
            Lookup.getDefault().lookup(MediaReader.class).removeListener(this);
            if (!showAgain) {
                dispose();
        public void readingAborted(ReadingEvent evt) {
            JOptionPane.showMessageDialog(this, "", "", JOptionPane.ERROR_MESSAGE);//TODO: i18n on the error messagens
            Lookup.getDefault().lookup(MediaReader.class).removeListener(this);
        }ActiveScanningDlg processes the events like this:
        public void readingStarted(ReadingEvent evt) {
            //DO NOTHING
        public void readingFile(ReadingEvent evt) {
            jpbReadingProgress.setString(evt.getCurrentFileName());
        public void readingStopped(ReadingEvent evt) {
            Lookup.getDefault().lookup(MediaReader.class).removeListener(this);
            dispose();
        public void readingAborted(ReadingEvent evt) {
            readingStopped(evt);
        }This is an example on how the events are sent:
        private void fireReadingFile(ReadingEvent evt) {
            for (ReadingListener l : listeners) {
                l.readingFile(evt);
        }

    Hi,
    You have to check the Tolerance limits set for the following tolerance keys. In case if any where the limit is breached the systems blocks the Invoice as 'R - Invoice verification'. Please check the limits set for all these keys.
    AP - item amount variance (if you have activated the item check)
    DQ and DW - for Quantity variance
    PP - price variance with the order price
    ST - date variance
    VP - Moving average price variance
    Regards,
    Kathir

  • How to get the customize url of an portlet using PLSQL

    How to get the customize url of an portlet using PLSQL.

    Are you trying to call the portlet Customization form directly from the browser?

  • How do you pass a column link value into modal dialog

    Hi everyone,
    I've got quite a tricky problem...To spell it out:
    1. I have a calendar with column links.
    2. I have a (popup) report on a separate page that shows detailed information about the record selected in 1.
    3. To eliminate the extra page, I've moved the report region to the calendar page, and created a modal dialog to display the report.
    Here's my dilemma, how do I 'get' the value of the column link (when clicked) so that I can use it when calling the modal report?
    (APEX 4.0)
    Thanks!

    True Andy.
    Combining the two examples then:
    function openModal(pVal1,pVal2)
    var l_Return = null;
    var get = new htmldb_Get(null, $x('pFlowId').value, 'APPLICATION_PROCESS=DUMMY', 14);
    get.add('P14_REPORT_FILTER1', pVal1); // set up page items to receive value
    get.add('P14_REPORT_FILTER2',pval2);
    gReturn = get.get(''); // Calls dummy process to set session state
    var tab = $('#REGION_STATIC_ID'); // grabs the region static id
    var report_id_str=$("div[id^=report_]", tab).attr("id"); // finds the 'report_'
    var report_id=report_id_str.match(/\d+/)[0]; // gets just the numeric id
    $a_report(report_id, '1', '15', '15'); // refreshes the report
    // Call to show modal here
    } You'll need to sub REGION_STATIC_ID for your region_static ID and make sure that it exists in the template.
    You could also just sub out the three lines between gReturn and $a_report with the hardcoded value of the region ID like:
    var report_id='R6974536412746853317'.substring(1);
    but if you and your region numbers change (if you import your app into a different app_id) then you'd have to go back and fix these.
    HTH, Thanks Andy for making me READ (not SCAN) the actual post :)

  • How to display non modal dialog box in a Dll call from TestStand implemented in visual c

    Dear Jason F.
    Applications Engineer
    National Instruments
    Hello
    I did the same way you told me
    the non modal dialog appeared and
    system hangs and
    giving the error message
    ""SeqEdit.exe-Application Error
    The instruction at �0x047fc5b0� referenced memory at �0x047fc5b0�. The memory could not be �read� ""
    please solve my problem
    and thanks for yours early response
    you can email me at
    [email protected]

    Hi Mkehret,
    Does your dialog have ActiveX controls on it? If your DLL dialog uses ActiveX controls and is not programmed in a certain manner it can hang because of a conflict in the threading model used by the TestStand Engine that is calling into your DLL and the model that is required by the MFC ActiveX Container. If you are using ActiveX controls in your dialog, you need to make special considerations for the threading model MFC dialogs that use ActiveX controls need in order to work properly. The example under \Examples\MFCActiveXContainerDlg illustrates how to appropriately handle this situation as well as explaining why it is necessary.
    Note: The above example displays the dialog as modal, but this is irrelevant to the problem I am describing.
    Again for information on properly creating a dialog class object and displaying it as non-modal refer to the information on MSDN that I referred you to in this post:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000E98A0000&USEARCHCONTEXT_CATEGORY_0=_8_&USEARCHCONTEXT_CATEGORY_S=0&UCATEGORY_0=_8_&UCATEGORY_S=0
    If your dialog does not use ActiveX controls or after trying the programming method illustrated in the "MFCActiveXContainerDlg" example TestStand still hangs when calling your DLL, try calling your DLL from another environment just to make sure whether the DLL works at all. If the DLL works properly when called by another environment (e.g. VB, VC++, LabVIEW, or CVI), please submit a MINIMAL and REPRODUCEABLE example source project for your DLL for us to look at (please exclude all unnecessary code not required to reproduce the specific problem of displaying the dialog, and include all files necessary to build your dll with any
    specific instructions needed to do so).
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

Maybe you are looking for

  • Inbound idoc for updating delivery date of purchase order

    Hi All, Our vendor sends a delivery file consisting of delivery date and quantity(could be partial) for line items of a purchase order. I need to update the Purchase order line item with the delivery date and quantity sent from the Vendor. It should

  • VpnClient in Windows 8.1 Pro Issue

    Good Day, I have installed VPNCLIENT in windows 8.1 Pro and it was working fine but user have uninstalled it. I re installed again and its connected but can't access to Local network.  When i install in new Win 8 or 8.1 its working fine but  i am una

  • PDF documents open as a blank page.

    I have downloaded Adobe Acrobat X onto my new computer running Windows 7 but cannot open documents like pdf online credit card statements online.  All I get is a blank page.  Also, I cannot download a pdf from an email as a pdf.  The option I get to

  • How to SHOW/HIDE a dreamweaver layer from a flash button?

    I have almost 2 weeks tying to find a solution for this. Please help... -How can you SHOW/HIDE an thml-dreamweaver layer from a flash movie button. My html layer name is LAYER1, and my FlashMC botton name is FLBOT1 Now, what is the actionscript that

  • My ipod doesn't display what is playing?

    I have a 60GB video ipod and it doesn't display the song that is playing on it anymore in the now playing option. If it is playing a song I downloaded from the music store the picture comes up and takes up the whole screen but it no longer lists what