In my CustomUI I am trying to validate the logon service account by entering the username and password. The Test button will validate the credentials. If it is an invalid account, it will show a spawndialog with an error, and on clicking will return to the same CustomUI. While returning back the username and password textbox value should be empty. What is the best way to clear out the textbox values? I tried by setting the property of the textbox value to empty, but the installer get failed.
On the close button control of your modal dialog you can put a set property control event that sets those properties back to empty. ( {} means empty in MSI ) Be sure to get the controlevent order correct so that the properties get set before the dialog is closed.
But, I'm not sure this will work. I'm not positive that the original dialog will refresh that data correctly. There are certain limitations of MSI UI and this might be one of those cases. (I'd have to mock it up to confirm. )
If you do his this limitation, the workaround is to do a NewDialog instead of a SpawnDialog and on that dialog tell the user there is a problem and only offer them a back button to the previous dialog.
Related
I want to check that if some fields in the form view has been checked or not. If they have been checked then show a confirmation message and if not then a error message saying that those fields must be checked. For this functionality I have created a button which calls a specific function in the model. The button has also attribute confirm which enables the confirmation pop up box. But all the time it first opens the confirmation message and then the checking for the fields. I want to have the other way around how to achieve this. Please help.
I have a subform where the user can create rows. A new row is created by clicking a button on the main form, after which the user can set the other values. Two fields are required, and the user must not be allowed to leave them empty, even by closing the form. Instead, a MessageBox should alert the user and he should stay on the offending row, allowing him to set the required values.
This must work even if the user has not made any change to the fields.
I'm trying different events with message boxes to see if any of them fire, but none of them fire when I try to leave the fields empty, for example by changing row or closing the main form. I'm looking for some equivalent to "OnBlur" in Javascript.
I've tried BeforeUpdate and On Dirty, but both of them require a change. I've solved the one for when closing the form, using On Unload with the Cancel parameter.
If I understood it correctly you are trying to validate user's entry before inserting a new row. Did you try the event 'Before Insert' of the subform? Use Cancel = -1 to disallow inserting. That should work even if the user tries to close the main form.
I have the following situation where I have multiple controls on a form. The user can select an Edit mode which allows them to modify the contents of the controls (textboxes, checkboxes, comboboxes, etc.) After editing has been made, the user can either select the Save or Cancel button.
Obviously clicking on save will save all changes to the database, however, if the user clicks on cancel, I want to 'somehow' revert all controls back to their previous state.
Currently, when the user clicks on cancel, the form turns off edit mode, but the controls remain with all the changes made until they reload the form.
Is there an easy way around this, or do I need to reload the entire form content from the database each time the user clicks on cancel?
Thanks in advance.
I'm just going to outline a possible solution here.
You could have a dictionary in your form in which you store the content of your controls whenever a user first modifies them, indexing them by the control name.
When the user starts modifying a control, you check if the control already exists in the dictionary. If it doesn't you add a new entry to the dictionary with the current value of teh control.
If the user cancels the editing process, you can loop through the dictionary, find each control in your form by its name (Form.Controls(ControlName) or something like that I think), set its value back to what it was and remove the entry from the dictionary.
It's not the most elegant solution as it will involve linking up all your controls to the TextChanged event or equivalent to capture their value when they are modified...
To avoid that, you could fill the dictionary right at the start when you load your form, after populating the values from the DB and then only set those controls' value back which have a different value when the user cancels.
I'm building an installer where a given page is asking for a directory. Unfortunately I'm not allowed (by the customer) to force an initial value into the entry (it must be blank), so using PathEdit is out--I have to use a raw Edit control. I've added a Browse button that invokes the BrowseDlg, but the question is: how to show the value entered in the browse dialog?
I've seen recommendations of duplicating the original page, since I can't update the original textbox on the initial page. While that seems workable, how can I get to the 2nd copy of the page? The button to open the Browse dialog invokes SpawnDialog. Doing it as a NewDialog looks really cheesy, and doesn't match the use of Browse dialog for the installation location, where it just pops up. But when the SpawnDialog returns, it just stays on the same page. There's no condition I could come up with that would allow me to add a NewDialog to go to the 2nd page, or to any other page for that matter.
Any ideas on how to proceed, so I can show the entered Browse value?
I suggest using a custom action and an edit box similar to this post. You can use a FolderBrowserDialog instead of the OpenFileDialog. It works for me, but upon a second install the field will be populated with the previous value.
http://community.saasgrid.com/developers/b/team/archive/2011/02/17/wix-managed-custom-actions-openfiledialog-example.aspx
I'm running with an 8.5.3 UP1 server and I have a need to have many dialog boxes (for confirmation purposes) for a whole bunch of "action buttons" on an xpage. The code for these dialog boxes is almost exactly the same with the exception of the confirmation message being different and the client-side JS function they are calling if the Yes button is selected.
Since I really hate repeating code over and over, I was wondering if it is at all possible to put a xe:dialog control within a repeat control and specify the message and function call from an array of values? I know I can't compute the ID of the dialog control and without that I'm not sure how I would reference the dialog to open and close it.
Any ideas? Thanks
Yes, this is possible.
Make sure that you specify that the dialog box's property for keepComponents is set to False. You don;t have to do anything special for opening or closing the dialog box, just use whatever ID you give the dialog box in you client-side action to open the dialog box in the repeat such as XSP.openDialog('#{id:myDialog}')
The XPages renderer will automatically calculate the correct ID names for you.