Centralizing standard Confirmations Dialog in external Component

Hello Community,
i'm developing on an application consisting of several different development-components, each containing again different wd-components. the component design of wd is a great advantage for reuse components.
but i still have a problem to achive better reuseability.
so i have one development-component which contains a component which at the moment contains methods (in the component-controller of that component) for outputing standard-messages. no view controllers or windows are defined.
But i also have some Stanard-Confirmation Dialogs which i want to reuse.
So i declared a new method in that central component-controller which i also declared in the interface controller of the component:
  //@@begin javadoc:dialogWarningNotYetSaved()
   * Method declared by application.
  //@@end
  public void dialogWarningNotYetSaved( com.sap.tc.webdynpro.progmodel.api.IWDAction contUnsavedEvent, com.sap.tc.webdynpro.progmodel.api.IWDAction contSavedEvent, com.sap.tc.webdynpro.progmodel.api.IWDAction abortEvent )  {
    //@@begin dialogWarningNotYetSaved()
       IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
       msgMgr.reportMessage(IMessageMessages.NOT_YET_SAVED, null);
       String dialogText = wdComponentAPI.getTextAccessor().getText(IMessageMessages.NOT_YET_SAVED, null);
       IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText, contUnsavedEvent, "Continue Unsaved");
       dialog.addChoice(contSavedEvent, "Save and Continue");
       dialog.addChoice(abortEvent, "Abort");
       dialog.show();
    //@@end
The main problem is, that the dialog does not return a value but instead does fires an action or event, attached to a choice.
But it seems, that such an event has to be one declared in the component. But i want to call the method containing the Confirmation-Dialog from another component and so, in my opinion, it has to trigger the event or action in the calling component. to reach this, i put the actions into parameters of the central method in the external component and put this action-parameters in the dialog.addChoise Method.
But doing so, WD-Runtime throws an exception, that the actions are not known in the repository of the component???
does anybody has an idea what i have to do to make it work correctly?
regards and thanx in advance
Matthias

Hi,
Create one event "SaveAndContinueEvent" with some parameters in your Common Component's Component Controller.
SaveAndContinueEvent(String param1, String param2).
And create one more method as "saveAndContinue(String param1, String param2)" in the same Component Controller with same parameters and
fire the event "SaveAndContinueEvent" in that method as below.
wdThis.wdFireSaveAndContinueEvent(param1, param2);
Now in the "contSavedEvent" event handler of the View invoke the method saveAndContinue() of Component Controller as below.
wdThis.wdGetCommonCompController().saveAndContinue(param1, param2);
Now in the Other Components, from where you are invoking this Common Component to open the dialog box, in the corresponding Views create the eventHandler as
"SaveAndContinueEventHandler" and while creating this eventHandler select "SaveAndContinueEvent" of Common Component as a source event to that eventHandler.
Now when ever user clicks on SaveAndContinue button the "SaveAndContinueEvent" event of Common Component will be fired and that even will be handled by "SaveAndContinueEventHandler" of the main view.
Regards,
Charan

Similar Messages

  • Displaying Multiple Sentences in Confirmation Dialog Box

    Hi Experts,
    Can anybody please tell me how to display three or multiple separate sentences in a Confirmation
    Dialog box. I am able to diaplay two sentences in a single line but the dialog box is getting stretched a
    lot. So i want to diaply them in separate sentences onr below the other.
    Thanks a lot.

    Hi shrini...
                   you want to number of line display in one dialog box ..
                  you have to declare one Strinh like thiss as below..
    have to create one event method as OK...which is visible in eventhandler code as
    findInEventHandlers("OK");
    create one method in component aas showBox....
    public void showBox( )
        //@@begin showBox()
         String   dialogText="welocme to""\n""India""\n".........................
          IWDEventHandlerInfo info=wdControllerAPI.getControllerInfo().findInEventHandlers("OK");
         IWDConfirmationDialog win=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,info,"OKK");
      win.open();();
    thanks
    jati

  • Wrapping the text on the confirmation dialog

    Can any one pls tell me how to wrap the text on a confirmation dialog?
    thanks in advance.
    regards
    Lakshminarayanan.V

    Hi,
    Currently this is simply not possible. Probably later TextView UI element will be enhanced to support this (at least, this feature is at "Whish List", search this forum for word POLL), and confirmation dialogs will inherit desired behavior automatically.
    For now you have to create your own component and use it pop-over window as confirmation dialog. In your component you may either use TextArea for multi-line display (quick and ugly) or split string into several context attributes and display them using several TextView UI elements (either dynamically created or pre-created till some reasonable maximum, say, 5 lines <-> 5 controls)
    VS

  • Best approach to implement reusable confirmation dialog ?

    Hi,
    What's the best approach to implement reusable confirmation dialogs with ADF 11g?
    e.g.: "Do you realy want to delete this client record (yes/no)?" should be used on several pages but with different message text.
    Also I have to know in the calling page which button (yes, no, ...) the user has pressed in the af:dialog.
    If it's af:popup is it possible to place af:dialog within page template to avoid placing af:popup within each page?
    regards
    Peter

    Hi,
    What's the best approach to implement reusable confirmation dialogs with ADF 11g?
    e.g.: "Do you realy want to delete this client record (yes/no)?" should be used on several pages but with different message text.
    Build a declarative component
    Also I have to know in the calling page which button (yes, no, ...) the user has pressed in the af:dialog.
    You can do this through a method reference in a declarative component. Its a method on the calling page's managed bean that is invoked from the declarative component
    If it's af:popup is it possible to place af:dialog within page template to avoid placing af:popup within each page?
    May not make sense but should be possible
    Frank

  • Confirm Dialog (JavaScript)

    Hi,
    I'm using the JavaScript confirm dialog attached to a button (return confirm('xxxxxxxxxxxxxxx').
    It works fine but I need two things:
    1. How can I change the window title?
    2. How can I change the titles of the two buttons? (I need them in Spanish).
    Thanks a lot for your help

    Hi!
    As far as I know, there is no possibility to change title of standard dialogs like alert, confirm etc. You can use window JavaScript object and set title in it's parameter name.
    And since JavaScript is realized in browser, it seems that change of your locale should change button's title to language of locale.
    Thanks,
    Roman.

  • Display confirmation dialog when opening PDF

    I've been asked to add a confirmation dialog box to a PDF file that includes a legal disclaimer. The dialogue box would display when opening the pdf document and include yes and no buttons to confirm that the user understands and accepts the disclaimer before reading the document. Selecting "Yes" would allow them to proceed, while selecting "No" would close the file. Is it possible to create something like this in Acrobat? I'm running Acrobat Standard 8.
    Thanks,
    Eric

    Hi Eric,
    Yes, you can do that but it's not an easy task.  You need to code the dialog in JavaScript and then use OCGs (layers) for a cover sheet that will remain "on" until the user selects the Yes button in the dialog.  Coding the dialog is a major task to do by hand and I'm not sure if Acrobat 8 Standard has the OCG capability.
    Check out our tool AcroDialogs(http://www.windjack.com/products/acrodialogs.html) for making dialog creation about 100 times faster and easier, and there is an example of a license dialog agreement just like what you are asking for on that page- scroll down to the Document License Dialog Example. But again, that solution was developed with Acrobat Professional and I'm not sure if Standard handles OCGs or not- you'll have to check on that.
    Also keep in mind this is by no means a foolproof security methodology.  However, it does provide a way to ensure the user agreed to the dialog before viewing the rest of the content.
    Hope this helps,
    Dimitri
    WindJack Solutions
    www.windjack.com
    www.pdfscripting.com

  • Code of confirmation dialog window

    Hi all,
          I have a component in which, I need to display confirmation dialog window when am trying to close a  window  with three buttons like YES,NO and CANCEL ...Its not like an pop-up window..can anybody provide source code for this..Thanks in advance

    Use Work Protect mode if you are running in Portal environment.
    SAP Online Help : http://help.sap.com/saphelp_nw70/helpdata/en/45/b76f4169e25858e10000000a1550b0/content.htm
    Thread which discuss the same :
    Re: Save Changes before leaving a web dynpro application

  • Confirmation Dialog setTitle

    Hello,
    Is it possible to set the title of an IWDConfirmationDialog? I want to replace the standard title "Confirmation Dialog" by my own title.
    Thanks,
    Thomas Morandell

    Hallo,
    although I have pity with your situation I insist on the following rule and not to hijack IWindow in your case:
    <u><b>Never Ever Hijack Internal Web Dynpro Classes and Interfaces</b></u>, described in https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1222. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Regards, Bertram

  • Confirmation dialog-native window

    Hi,
    how can i create native yes/no confirmation dialog with air
    window component like titlewindow with popup manager?
    Thanks

    Hi,
    how can i create native yes/no confirmation dialog with air
    window component like titlewindow with popup manager?
    Thanks

  • Confirm Dialog?

    As a flex newbie with a pretty good understanding of
    Javascript, I was thrilled to find the Alert.show() function
    available to replace the alert() function I often used in
    Javascript. That got me wondering... is there a corresponding
    function for the confirm() function as well? I tried
    Confirm.show(), but with no luck, as that shows up as an undefined
    property.
    I was hoping there's a simple way to activate modal
    confirmation dialogs, as I'd hate to have to build an entire
    component just for that.
    Thanks,
    Josh

    Well, there is an relative simply solution for this:
    Make a button with calls a function when clicking:
    <mx:Button label="Click Me"
    click="clickHandler(event);"/>
    Use the following implementation of the eventhandler:
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.CloseEvent;
    // Event handler function uses a static method to show
    // a pop-up window with the title, message, and requested
    buttons.
    private function clickHandler(event:Event):void {
    Alert.show("Do you want to save your changes?", "Save
    Changes", 3, this, alertClickHandler);
    // Event handler function for displaying the selected Alert
    button.
    private function alertClickHandler(event:CloseEvent):void {
    if (event.detail==Alert.YES)
    status.text="You answered Yes";
    else
    status.text="You answered No";
    ]]>
    </mx:Script>

  • Confirm Dialog on Closing Web Application with unsaved data?

    Hi all,
    I am searching for best-practices or official solutions for implementing the following functionalty:
    User is trying to close the browser window or tab (Mozilla Firefox) by hitting the "X". We need to ask him if he is sure cause there might be unsaved data.
    The only solution we now see is the following:
    - event "onbeforeunlad":
    window.onbeforeunload = function (oEvent) {
      oEvent.returnValue = 'Sure? Unchanged data might be lost'
    Problem is that this event also runs, when youre navigating in the analysis item, e.g. expanding a hierarchy. You have to switch it of for every single Item with onmouseover and switch it on again later.
    And further on: It still has to be bound to the data... if data hasn't changed, it shouldnt pop up.
    Question: Are there any official suggestions from SAP? Seems to be a standard requirement. If not, do you know any better solutions for implementing this functionality?
    Thanks in advance for your help,
    Michael

    try capturing the onBeforeUnload event and display a modal confirmation dialog asking the user if he really wants to navigate away from the page; and warning him that if he does so, all the changes he made hitherto will be gone.
    However, you need to handle this intelligently since you need to identify if any fields in the form have changed and only then warn the user to confirm his decision to go away from this page.
    You can do this by having a flag which is initialized to false but when onBeforeUnload event is fired, you would check if any of the form fields in the page have changed by iterating over each and every form field,and then setting the flag to true if some thing changed
    the onBeforeUnload Handler will always return this flag, if it is true, you will get this confirmation popup, else the page will go away. To show a customized confirmation dialog, perhaps you would have to invoke the custom dialog call from with in the onBeforeUnload handler. When the user says yes, return false;else true.

  • TestStand API External Component Modified Since Last VI Save

    I'm using TestStand 3.5 with LabVIEW, and deploying my code across multiple stations.  The code is managed by Perforce (source code control).  I'm keeping the stations identical by installing NI software from the same CDs (which I'll refer to as an "Original Station"), but it seems that over time the TestStand API will somehow be externally modified ("Modified Station"), which causes LabVIEW to recompile the VI.  The Explain Changes dialog box states "VI recompiled.  External component modified since last VI Save."  If I save the recompiled changes on a Modified Station and submit the changes, an Original Station opening the VI will then recompile VI, stating that an external component has been modified since the last VI save.  If I resave the VI on an Original Station, then the next time I open it on a Modified Station the recompile will occur.
    This is problematic, because there will be a performance hit if LabVIEW has to recompile when opening VIs.  In addition, it makes debugging difficult, because LabVIEW will prompt to save changes on all the VIs if they were saved on a different station state.  Not to mention the unnecessary copies made in the source code control to maintain the history of the recompiling.
    My current solution is to reinstall TestStand on all the Modified Stations.  I set any TestStand strict typedefs that I use to non-strict typdefs, mass compile the TestStand addon folder in vi.lib, and then the station becomes an Original Station again.  Overtime, it will modify itself and turn into a Modified Station.  Since these stations are at multiple sites, it is very inconvenient to manage.
    My questions are the following:
    1. What is causing this external modification?  Is there anyway to prevent it, so that the installation and code will not get modified so that all will remain Original Stations?
    2. If it is not preventable, how can I force all stations to become a Modified Station, so at least they are all the same?
    I've attached LabVIEW 8.5 VIs that demonstrate the VI differences.  I've observed this behavior in LabVIEW 7.1 and 8.2 previously.  If anyone also experience this behavior or has a work around, please post to this thread.  If NI has insight on what is causing this behavior and how to prevent it, it will help me out greatly.
    Thanks!
    Attachments:
    test_recompile_original_lv85.vi ‏7 KB
    test_recompile_modified_lv85.vi ‏7 KB

     Wilbur,
    Do you have more than one version of TestStand or LabVIEW on the stations?   Switching the active version of TestStand changes the registered version of the TestStand API which I believe is the external change that forces a recompile.  If version switching is the cause of the problem you could prevent these changes by not sharing any TestStand VIs between different versions of TestStand.  If each version of TestStand has its own VIs then a VI is compiled against one and only one engine version.
    -Rick Francis

  • Code could not be generated because an external component or driver is missing

    Greetings All,
         I've using Labview for a little over a year and I have an interesting situation with regards to Labview that I came across today.  When I left off yesterday (01/11/12) my TestStand sequence was compiling fine.  Today for some reason the compiler told me that one of the VI was broken or missing a sub vi.  When I made my way through all the sub vi's in the vi that seemed to be a problem I came across "Code could not be generated because an external component or driver is missing".
         The problem started on the computer (NI PXI-8101 with WinXP and Labview 2010) located in a PXI-1044 that is in my Test Stand.  I have a complete backup on my laptop and my desktop computer which both compiling successfully with no errors.  I tried installing the directory on another PXI-8101 and got a different set of results.  The first PXI-8101 gave 100+ errors in TestStand pointing to one of my vi's and the other PXI-8101 reported only one (1) error.  The vi is basically using DAQmx vi's to create a "write to one line" action.  I'm kind of stumped as to why it works on the laptop/desktop and not the PXI computers.  All four computer are WinXP professional and Labview 2010.  I saw somethings through google search engine but nothing conclusive.  I'm hoping that someone can give me an explaination as to what is causing the error as described.  Even if I copy over the directory it doesn't fix the problem.  Thank you in advance for an information you provide with this rather interesting problem that I've encountered.  If you require addition information let me know.
    Regards,
    Scott
    Solved!
    Go to Solution.

    Greetings Beau,
         Thank you for the reply.
         I loaded the offending VI into Labview (2010) with TestStand inactive.  Of course this was after I completely shutdown the computer and re-booted to ensure that nothing was resident in memory.  I've included a couple of the error list boxes in this post. 
         It comes down to a subvi that is two (2) subvi's deep.  All these vi's are doing is commanding a write or read to and from the PXI-6509.  When I check the VI at the level that has no broken run arrows (named below), nothing in the block diagram looks out of place as it should since these were installed by Labview installation.  The vi that uses these vi's looks total normal and its block diagram doesn't have anything out of the ordinary yet the run arrow is broken.  The odd part of this is that the top of the window that states the filename of the vi has an astrex at the end of the filename, even though nothing has changed in that vi.  
    Here is a list of the deepest level that has no broken run arrow:
    DAQmx Create Channel (DI-Digital Input).vi
    DAQmx Start Task.vi
    DAQMX Read (Digital Bool 1Line 1Point).vi
    DAQmx Clear Task.vi
    DAQmx Create Channel (DO-Digital Output).vi
    DAQmx Write (Digital U8 1Chan 1Samp).vi
         I guess the real question is what is the error message ("External component or driver missing") really telling me if all of the vi's look right.  I appreciate any information you can send my way that will give me a better understanding of where this error is coming from.  The program I developed had been running without a hitch for a month an all of sudden crash.
    Thank you for your time in this matter.
    Scott
    Attachments:
    Write to one port broken VI error list.JPG ‏47 KB
    Readfrom one line broken VI error list.JPG ‏46 KB
    Broken_VI_Error_Screen.JPG ‏56 KB

  • File download element in confirmation dialog box

    Hi,
    Can I use File Download elements in Confirmation Dialog Box?Please raply me as early as possible.
    Regards
    Aniruddha

    Hi
    You can not use  File-Upload UI element inside confirmation dialog ,because there is no provision to add any UI ,except Button.
    Please avoid  my previous reply .
    Best Regards
    Satish Kumar
    Edited by: satish jhariya on Mar 3, 2009 11:29 AM

  • How to get  the choice clicked by the user on a Confirmation dialog?

    Hi,
    'm trying with Confirmation dialog which should return
    'yes', 'No', or 'Cancel'
    I wrote like:
    String Message="Do u want  to update ??";
         IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
         IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow( Message, controllerInfo.findInEventHandlers("Yes"), "Yes");
         dialog.addChoice(controllerInfo.findInEventHandlers("No"),"No");
         dialog.addChoice(controllerInfo.findInEventHandlers("Cancel"),"Cancel");
         dialog.open();
    It works as a normal dialog window
    But how can I get the choice that is clicked by the user.
    ie . either 'Yes', 'No', or 'Cancel'.
    can any body help me
    thanks
    Smitha

    Smitha,
    In addition to your code, create 3 event handlers in your controller, name them Yes, No, Cancel. In every event handler you know what event was fired, i.e. what button is pressed.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

Maybe you are looking for

  • Can I install Windows 7 from an SD card on my 2011 Macbook Air 13"?

    This morning I purchased a digital copy of Windows 7 from Microsoft, and created a bootable SD card for installing the operating system.  My problem is that Boot Camp Assistant will not allow me to partition the drive without the install media presen

  • SO_DOCUMENT_SEND_API1 : issue in alignment

    I am developing a program which generates email notifications. The email body has dynamic data in table format as follows: Date                    Day                to          from Feb 11, 2011      Monday      10:00am   1:00 pm Feb 11, 2011      M

  • Newbie Question- unable to view certain photos in iPhoto 6

    First time Mac user..just got my MBP. I created folders and albums under iPhoto. I then copied .JPGs from my shared Windows drive directly into the albums. They get imported correctly because I can see all the pictures in the "gallery" view. However,

  • Query abourt  'REPLACE' statement in SAP 4.7

    hello,       I have developed one program in SAP 4.7 version.Now i have copied it to 4.6C in SAP.When i tried to run this program it gives me error in   REPLACE ALL OCCURRENCES OF ':' IN l_col_time WITH ' '. this statement.this statement is working i

  • Problem user

    I have a user with constant outlook issues. ie freezing and messages getting stuck in the outbox. We don't use roaming profiles, and this is the case on several freshly built devices. I've created a new mailbox - which hasn't made a difference so I'm