WiX/MSI: show error-dependent FatalError dialog - user-interface

While installation is executed (server-side) I looked for a way to pass the result back to the client side. Especially the FatalError dialog should show a text depending on the reason of the failure. Since it seams not possible to pass the result via properties I stored it in a file.
Furthermore I replaced the FatalError dialog with my own dialog to display an error text depending on the error type.
My problem is, that I need to call a custom action before the dialog is displayed, that reads the result from the file.
Possible ways could be:
1) I register the custom action for the OnExit="error" event.
Question: I need to display the dialog afterwards. Maybe the custom action (C++) can show the dialog after it loaded the result from the file. But how?
2) My own FatalError dialog is registered for the OnExit="error" event (as usual).
Question: How can I call the custom action before the dialog is shown?
3) My own FatalError dialog is registered for the OnExit="error" event (as usual). It shows only a common error text. When the user clicks Next the custom action is executed and another specific error dialog is displayd.
Problem: That bothers the user with pointless dialogues.
4) Any other idea ...?
Thanxs in advance.

By means of 1) I could finally solve the problem. A custom action can display a dialog using MsiDoAction. Example:
MsiDoActionW(
hInstall, //MSIHANDLE hInstall,
L"MyFatalErrorDlg" //LPCWSTR szAction
);

Related

VSTO: How do I cast a mailitem as a form?

If I have an Outlook.MailItem how can I get the Location, Width and Height of this?
Also I need to "disable" the entire Outlook.MailItem form - how do I do this?
I want to show a centered "modal" dialog (just a Windows.Forms.Form) over this MailItem without it actually being modal.
Thanks
Update (more explaining)...
When a user clicks "Send" on a mail, I want to check it for large files before sending and if the file size are too big, then I want to show a "Files are too big, do you want to zip them" dialog. The dialog must be centered to the mail form and disable the mail form (like a dialog would) without freezing outlook.
There is no need to disable the default form in Outlook.
For example, the Open event of the MailItem class which is fired when an instance of the parent object is being opened in an Inspector. The Cancel parameter passed to the event handler allows to abort the default action. If the event procedure sets this argument to True, the open operation is not completed and the inspector is not displayed.
When this event occurs, the Inspector object is initialized but not yet displayed. The Open event differs from the Read event in that Read occurs whenever the user selects the item in a view that supports in-cell editing as well as when the item is being opened in an inspector.
Also you may consider using Outlook form region. The Replacement-all layout allows to override the whole inspector window. See Creating Outlook Form Regions for more information.
Why do you need to do anything with the form? Process the Application.ItemSend event, display the prompt if necessary, and cancel the submission process if you need to.

Get value from autocomplete text field in ApEx

I want to create a dynamic action, that will set a value to an item on the page, when the value of another item (autocomplete text field) is set.
So the proccess goes like this:
Click on the autocomplete field
type some letters
choose one of the suggested values
I cannot find an event that will be executed when the selection of one of the suggested values happens. This way, I cannot see how I can read the value of the autocomplete field, once a suggested value is selected.
The change event doesn't fit my needs, it doesn't execute when one suggested value is selected.
I had the same problem, found this link: https://community.oracle.com/thread/2130716?tstart=0 and modified my dynamic action as follows to get the desired behaviour:
Event = Custom
Custom Event = result
From the link:
the problem seems to be the default behavior of the browser. When you
enter some text into the autocomplete and the list is displayed, the
focus is still in the text field. Also if you use the keyboard cursors
to pick an entry the focus will still be in the textfield. That's why
the change event of the textfield doesn't fire. It only fires if you
leave the field.
On the other side if you pick an entry with the mouse, the browser
will remove the focus from the text field for a moment (before the
JavaScript code puts the focus back), because you clicked outside of
the field. But that's enough so that the browser fires the change
event.
I had a look into documentation of the underlaying jQuery Autocomplete
widget
(http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/) and
there is actually an event called "result" which can be captures if an
entry is selected from the drop down list.
Try "Lose Focus" as event. It will trigger your dynamic action when you leave the autocomplete field, i.e. your curosr is moved to another field.
This probably depends on the APEX version you are using.
In case of 18.2, because the underlying component is based on Oracle JET's "inputSearch" component, you need to use following configure to capture the select change event for text with autocomplete:
event: Custom
custom event: ojupdate
Reference:
https://docs.oracle.com/cd/E87657_01/jet/reference-jet/oj.ojInputSearch.html#event:optionChange
I turned on the browser console, then turned ApEx Developer toolbar debug, and found that, on the contrary, the "Change" event does fire upon user clicking with the mouse on one of the selections. However if the user uses keyboard (type a few letters to narrow the list down, then use down arrow key to arrive at desired value, then press enter) then the Change event does not fire, just as you say.
Moreover: even when you do get the value sent back via mouse-click initiated Change event, the value isn't the autocomplete's complete and valid value, but instead the possibly partial and wrong-case value just as typed by the user. I.e., the the change event's submission of the value precedes the autocomplete's substitution.
The answer that #VincentDeelen gave is the best alternative that I can see, although it doesn't quite give that "instantantenous synchronicity" feel. You could maybe use the "Key Down" event, but be careful with that. You could get a really excessive amount of web and db traffic as each and every keystroke (including corrections) results in another firing of the dynamic action.
Testing environment: ApEx 4.2.3 with Chrome 33 as well as IE 9.
p.s. This might be worth a mention to the ApEx development team as well.
It's not really ideal, but you could use onfocus(). I'm looking for the same thing you are, I think, a custom event that fires when the selection of a suggested value happens. I haven't found it yet though and that is my work-around for now. It will run whatever function you've created for this initially with no value, but once the selection is made it will return focus and run the function again with the right value. Like I said, not ideal but it works.
Jeffrey Kemp is right. You can set it up through a dynamic action using the custom event, result. You can also register it on page load using document.getElementById("{id}").addEventListener("result", {function}); or $("#{id}").result( function( event, data, formatted ) { //something here });.
Oracle apex 19 now added a "component event" when you create a dynamic action called "Update [Text Field with autocomplete]" - this action is fired when you select a value from the list, but not when you leave the field (similar to adding the custom event "ojupdate").

How to access the cancel button event in jQGrid Edit dialog box

Is there an event associated with the cancel button of various jQGrid dialog boxes like ADD, Edit and Delete ? For my edit dialog box, I need to do some processing when the user clicks the cancel button.
please help
thanks
Probably it could be enough to use onClose callback for form editing (see the documentation here and here).
If you would fund out that the callback are called not allays (I don't tested it in the current version of jqGrid) then you can choose another way. If you really need to process all closing of all dialogs you can consider to overwrite or to subclass $.jgrid.closeModal or $.jgrid.hideModal functions. See the demo from the answer (compare the code with original one here).

Calling a child dialog and passing in input parameters

I've read a bunch of articles on how to call dialogs from javascript and integrate them into a ribbon button, but I am running into a problem where I need to do all that AND pass in a string as an input parameter (to a child dialog?).
Is this possible? Would I have to modify the calling url of the dialog?
I've read this one about calling dialogs with the SelectedControlAllItemsId, which is almost what I need.
Ideally I would open the form of the parent entity, click on one of the subgrids in the left hand navigation, then select some of the related/associated entities, click the ribbon button and wait for the dialog or workflow to chew through all of those Ids.
Is it possible to capture these selected items using SelectedControlAllItemsId, then pass that string to a child dialog so it can then call another workflow? Or should I capture that string, store it in the calling record via REST and then let a workflow run on a field-trigger?
The end result is that I must run a custom workflow and manipulate the parent record + the selected related records. I have already written the workflow, but I do not know how to trigger it the way I want.
Perhaps there is something I am overlooking? Is there a way to call a custom bit of code directly from javascript and let it work the rest of the way?
I'm not sure how an interactive dialog should deal with a collection of records. Surely that would require sequential iterations of the dialog, as the user processes each record? As you will see from the SDK (and discussed in your linked thread), it is only possible to run a dialog against a single record.
A workflow is a different matter.
- Custom ribbon button, using SelectedControlAllItemsId
- Supporting JScript handler should iterate SelectedControlAllItemsId
- Each iteration should issue an ExecuteWorkflowRequest using the current item id and based on code such as this (which issues an ExecuteWorkflowRequest from JScript
Remember that the workflow request is asynchronous so you can just send all the requests one after another rather than waiting for the outcome of each request.

Add ... to show users that a non modal dialog follows?

I have a simple question.
I have a lot of menuitems and buttons in my application. I try to remember to add ... in the caption to indicate that a modal dialog is followed.
But should I also add those dots for a non modal dialog. I try to search in Google but cannot find any clear answer. I use Win32 and Delphi.
Regards
The ... implies that some further input is required to complete the action of the menu item.
So, "Save" means that the menu item will cause the document to save, whereas "Save..." implies that the user will need to enter the name, or choose a file format or something before the file will be saved.
Typically the further input is entered in a popup modal dialog, but (a) not every modal dialog is a prompt for further information, and (b) hypothetically some other input mechanism could be used.
The '...' implies that the user will be given the opportunity to back-out of the operation.
This was in a user interface guideline book I read back in 1995, I can't seem to find a definitive confirmation online anymore.
I'd say that this depends strongly on your personal taste. I add ... whenever any new window is opened, be it modal or non-modal, to indicate to the user that he has to expect some other window to appear.
My guess is that there should be some Microsoft UI Guidelines document about that, but neither have I ever looked for something like that nor do I know of one.

Resources