NSIS - InstallOptions - Skip validation on back button - installation

I am developing an NSIS package for one the products. I have a custom page for gathering SQL Server login credentials. On this page, clicking next must validate the given inputs (whether it connects to the server with given credentials). This works fine.
Problem:
If I press back button on this page, it is still validating the input; which I do not want. I could not find any way out to skip the validation on clicking back button.
Any suggestions in this regard is appreciated.

Found the answer!
We can specify two function names while calling the page custom command. One to show the page and one for validating which is called as leave page.
Page custom ShowDatabasePage LeaveDatabasePage
In the leave function, we can do all the validation. If the validation fails just call abort and the work is done. Leave function is called only when the next button is clicked.

Related

Button Click events with Dynamic actions in Oracle Apex

I have created an Edit button with associated Dynamic Action. In the dynamic action, set it to the Click event of the Edit button. I've created the actual action by reference to a JavaScript executing code. And then an update of the area.
In JavaScript code I wanted to enable items that are read only by pressing the edit button.
APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('ADMIN')
This was the check I made in the JavaScript code.
In this way I enabled edit mode for the region where I am applying.
ADMIN is a role.
How can I make the button click so that the items associated with the region that are just as read only, when clicking appear in an editable way?
In my opinion, you're reinventing the wheel.
OK, there's the ADMIN role (perhaps some other roles as well). If you know which user (identified by :APP_USER) has which role, then use
server-side condition (to decide whether to render (or process) certain page component (items, buttons, ...)
read only property (to decide whether user will be able to modify the value or not)
authorization scheme (under "Security")
So, there's no need for the EDIT button you currently have. Everything can be done declaratively by setting certain properties within Apex.
this function
APEX_UTIL.PUBLIC_CHECK_AUTHORIZATION('ADMIN')
is a plsql function, did you use it in your javascript code or as a server side condition?
you can make an ajax request to get the user role using that function and after getting the role in your javascript code you can disable/enable the items using the javascript api.
apex.item( "P1_ITEM" ).enable() ;

How do I get the Router navigate extra "replaceUrl" to work correctly?

I have a contact addition form that can be navigated to from multiple screens in our application.
Once the form is submitted, I then take the user to a screen to view the contact that was added.
When the user then makes use of the back button it should take them back to the screen that they originated from.
This might be the Android back button or one that calls the RouterExtensions back function.
I have made use of the navigate extra replaceUrl when navigating away from the form to the view page.
I have also tried using the skipLocationChange extra when navigating to the form but this creates more issues.
I have created a simple playground page flow that creates not quite the same issue but does throw an error that I don't know what to do with either:
https://play.nativescript.org/?template=play-ng&id=BfVcGZ&v=2
In our app, by making use of the replaceUrl extra, the back button does take the user to the correct page.
However, there is a brief moment where they see the form again. This isn't an ideal user experience.
In the linked Playground I do get an error:
Cannot reattach ActivatedRouteSnapshot created from a different route.
This seems to tell me that replaceUrl is indeed removing the page from the route table.
However, the page isn't destroyed yet and so the app is trying to show a page that it shouldn't.
replaceUrl is not yet supported by Page Router Outlet, there is an open feature request, you might want to register your vote on the feature and follow up there for further updates.

MVC3 - How to remote validate on checkbox click?

I am using the Remote Validation attribute on my domain model, to call an Action that returns Json. This validation occurs on a checkbox and it only kicks in when the form is submitted. I'd like it to act the same way that text boxes remote validation works. As soon as it looses focus, remote validation kick in. Or perhaps on click.
These are screen shots from a test project. The actual project is too busy, that's why I created this sample one.
I'd love to see some suggestions that do not involve using JQUERY in the view. But if that's the only way then be it.
Thank you.
MODEL:
Both properties have the same Remote validation, because I wanted to test if the loosing of focus would trigger the text box to validate, and indeed, it worked. I assumed that the same would happen for the check box, perhaps on click, or loosing focus, but no. Only when I click create the IsNameDuplicate() is called.
CONTROLLER:
VIEW:

Lotus Web Form Scroll and Popup issue

I am trying to create a web form in Lotus Notes that is web enabled. So far this has all worked fine, however there are 2 issues.
When Creating a Java Script Alert in the OnLoad Event, it Pops up everytime a user selects a radio button or dropdown option since this reloads the page. Is there any way to make this only for the initial opening of the form?
When a user selects an option, the form reloads and puts that form field on the top which is proving to be very disorrienting for users. Is there a way to have it not scroll on reload?
Thanks in advance!
The best advice would be: use XPages for web development that is "state of the art". If you can't, you have to code a lot of JavaScript to make the form not behave like "havoc".
First of all: the field property "refresh fields on keyword change" is the reason for the jumping / reload.
What does domino do?
All events / formulas that occur when you normally press F9 or use the Option above (that can be field values, input translations, hide whens, etc.) are not "converted" to HTML and javascript but are executed by the server. Therefor each change in a field with the option set submits the form and adds an &Seq=x to the url to keep track of the state. X increments on every reload. Of course this reload causes all events to be triggered again.
For you this means:
Option
disable the option to reload the form after keyword change.
Unfortunately you have to recode every dependency / calculation / hide when with javascript. Using a framework like jquery or dojo this is possible, but a lot of work.
If there IS no dependency then just disable the option...
Option
Live with the "jumping" and let your onload event check for the existance of an URL- parameter called seq... And only if it does not exist, then it is a "real" OnLoad...
Both options are not quite nice and not very easy to code...
That's one reason why IBM started XPages... There all this stuff is already handled by default...

JQuery Mobile 1.0 - Self-posting pages causing duplicate dialogs or history entries

If you go to http://jsbin.com/ibozun/2, hit "Add Item," and then hit "Save," you will see that a second dialog is opened on top of the first one. The form in the dialog is posting to itself (no action defined) - this is by design. Because the dialog has duplicated itself, now you have to hit "Cancel" 2 times to get it to close.
The use-case for this setup is a MS MVC3 page with unobtrusive JQuery validation on it. The default scripts (in other words, I have no custom validators - the scripts are straight from MS) cause an ajax call to the server, and JQM treats that the same as a self-posting form - so you wind up with a duplicate dialog if validation fails.
A similar thing happens if the second page as a page, rather than a dialog - the form posting to itself results in a second history entry in the browser, so to get back to page 1, you have to hit back 2 times.
I believed this be a bug in JQM, but after submitting a bug on GitHub, I was told that this is the expected behavior. So, assuming this behavior that will not be changing in the framework, how do I prevent this from happening for my instance (preferring NOT to edit the framework JS)? Do I have to write my own ajax calls for validation so that I can prevent JQM from knowing that anything has happened? That seems unfortunate...
One idea I had was to detect that the nextPage and current page are the same on "pageHide", and manipulate the dialog/history myself, but have had no luck.
Thanks in advance!
First, there is no dialog duplication in the example. Second, my response and an explanation as to why solving the history issues with posting back to the same page for users of the library is hard can be found here. This example is particularly thorny because it's also in a dialog which we don't support linking to, so disabling ajax for the form (ie forcing it to reload), which would work if it were embedded in a page, won't serve.
The quick solution here is to switch the dialog to a page and add the data-ajax=false data attribute to the form. Mind you this causes a page flash/reload and requires that the form document be fully formed with a head including javascript,css, etc.

Resources