FileUploader in SAP UI5 - file-upload

I am using File Uploader to upload data, but I need to show popup message before it opens up the file browser popup.
The requirement is, if user has already edited the data on the given page but has not saved it and if he presses Upload button we need to popup the message saying "whether you want to continue without saving the current data".

Answer depends on wether you have event "uploadOnChange" set to true or false
If true > use event updoadStart
If false > use event change
In both you can turn off default behaviour and prevent the upload from actually starting.

Related

How to hide or cover a MS Access ActiveX Web Browser control?

I have a database in which users enter a value into Textbox1 on a form; the form also has an ActiveX Web Browser control (acxWebBrowser1), plus another blank Textbox2, and finally a command button. After the user enters text into Textbox1 and clicks the command button, the VBA code will navigate to a specific web page in acxWebBrowser1, enter the Textbox1 value into the web page form, and then obtain a result in the web page in acxWebBrowser1. The result is then grabbed by the VBA code and entered into Textbox2 on the database form.
What I need to be able to do is hide the ActiveX Web Browser control to (a) prevent the user from messing with the web page, and (b) to prevent the clutter and distraction of the ActiveX Web Browser since the VBA code does all the necessary interactions with the web page behind the scenes.
Problem is, I cannot get the acxWebBrowser1 to stay hidden behind a rectangle box control on the form because the browser automatically moves itself to the top of the stack of controls. If I reduce the size of the acxWebBrowser1 control to be very tiny, the web page does not function properly. If I make the web browser control not visible, then the code cannot grab the needed values. I cannot use a POST approach to avoid using the web browser. (I might be wrong about not being able to use POST--maybe someone can point me to how to do that if that is the way to go.)
How can I hide or put something on top of the web browser control?
Three hours later, it dawned on me how to accomplish hiding the ActiveX Web Browser but still get it to be accessible to the VBA code. Simple: Don't update the screen when running the code to access the ActiveX Web Browser and use the .Visible property to "show" the Browser Control when VBA needs to access it (but it won't be visible to the user if screen updating is off) and then hide the Browser Control when VBA is done accessing it.
Here's the code I used to accomplish that:
Application.Echo False 'turn off screen updating
Me.acxWebBrowser1.Visible = True 'make web browser control "visible" to VBA code
{do stuff, like: process web page}
Me.btnClickMe.SetFocus 'set focus on the button so we can hide the web browser control
Me.acxWebBrowser1.Visible = False 'make web browser invisible so user is not distracted
Application.Echo True 'turn screen updating back on
Me.Refresh 'refresh the screen; this is probably not necessary
Just be
absolutely sure to turn screen updating (echo) back on
You should send any error handling to code that sets Application.Echo True otherwise you will not be able to see or do anything if the code crashes after setting echo to False.

VBA: Before Save Event - Suspend Running Until User Confirms Save As

I only want my code to run if the workbook is going to be saved. At present, if Save As is selected, the code will run as soon as the user attempts to browse for a file/location. The problem is they can still cancel the save.
Alternatively, I want to be able to run some other code if the user decides to cancel the save. (I don't think the Cancel Boolean in the Before Save event can be used because once the user selects browse, it is assumed the file is being saved)
Maybe the Before Save event cannot be used in this instance but I want to avoid disabling/replacing the Save As functionality if possible.
I was able to handle this using the After Save event - I didn't realise that this could be used if the file wasn't actually saved.

Add cancel header to the HyperlinkTheme.xml file

Is there is any way to add a cancel event header to the theme file, so that i can configure the user cancellation event and display an appropriate message. so far i am getting a setup failed message even if the user cancelled the installation or any other failure occurred.
You can control the text on the confirmation message box displayed when the user clicks the cancel button. To do so, provide a custom .wxl file and change the ConfirmCancelMessage string. The default is:
<String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
(See the src\ext\BalExtension\wixstdba\Resources\*.wxl files for examples).
However, in wixstdba, when the user clicks the cancel button during Apply(), wixstdba will always go to the failure page. That or the success page are the only two options today. There has been some discussion about extending the failure page to be more customizable but no work has been done on that idea.

VB.NET - Log into website with out website open

I want to create a program to fetch information from a website (that's fine). However, you need to be logged in to get this information.
I just want two simple textbox controls that I would type my username and password into and hit submit and the information would be returned to me so I can use it. (I don't want to use a webbrowser control)
Sorry if I wasn't clear
And also
(this really isn't important, but its up to you if you want to answer, it's probably hard)
How would I go about checking if I am still logged into a website or not (as in TRUE or FALSE)
you can pass credentials into a HttpWebRequest object.
You could use a webbrowser control since it is easy, and just set its display to not visible - the user would never see anything. You could still interact with the page just like normal. You could use the same control to log yourself out by clicking on the logout button. You would set everything up and test it with visible=true, and when it all works, set visible to false.

gwt-ext file upload

I am trying to do a file upload from gwt-ext without bringing up the dialog box. To do this, I created a FormPanel and added the appropriate fields to it. Then did a form.submit(). This doesn't seem to work. Any idea why? The code is shown below.
final FormPanel uploadForm = new FormPanel();
uploadForm.setVisible(false);
uploadForm.setFileUpload(true);
final TextField sourceFile = new TextField("File", "sourceFile");
sourceFile.setVisible(false);
sourceFile.setInputType("file");
sourceFile.setValue("/tmp/test.txt");
final TextField targetFile = new TextField("Upload As", "targetFile");
targetFile.setVisible(false);
targetFile.setValue("different.txt");
uploadForm.add(sourceFile);
uploadForm.add(targetFile);
final String url = GWT.getModuleBaseURL() + "/uploadFile";
uploadForm.getForm().submit(url, null, Connection.POST, null, false);
I tested the servlet on the server side with a simple html form and it works correctly. Only the GWT-EXT version doesn't seem to work.
I found out why the above piece of code is not working. The primary issue here is that file uploads are blocked by the browser due to security reasons if the upload form has not been rendered and/or if the form has been modified after the user clicks the submit button. If the browser did allow such things, then any file on the system can be easily uploaded without the user's knowledge.
Solution to to the above problem is to bring up the dialog box, do the upload in the event handler for the submit button and in the onActionComplete method of the form listener, do any other processing.
The whole idea of uploading without dialog box looks like a security breach to me. I can imagine an application that steals passwords file whenever opened, if only the above would be possible.