Unmask a PasswordTextBox? - gwt

Is it somehow possible to unmask a PasswordTextBox? I would like to have a textbox to enter a password and a checkbox, which says Show Password. If the user clicks the checkbox, the content of the Passwordcheckbox becomes unmasked. I could build a custom component using TextBox but it somehow seems the wrong path.

This is how you can do it, on selecting the checkbox do -
passwordBox.getElement().setAttribute("type", "text");
Set it back to password when u want to undo it.

Try this:
passwdTextBox.getElement().setAttribute("type", "text");
This changes the type of input element from "password" to "text".

Related

CTRL+N Not invoking new on a DetailsFormTransactions Page

I need CTRL+N to invoke the default behavior, that is to create a new record without invoking my NewButton.
NewRecordAction property is not filled out, the shortcut does nothing, seems to be disabled.
The DataSource on the form allows create, I can create through my NewButton MenuItemButton.
I seem to have lost it's default behavior somehow, what could cause that?
Ctrl-N does not do anything, because the NewRecordAction is not filled out and because there is not a command button with New in the Command property.
I assume you have used "Create form from template" or have copied from the SysBPStyle_TransactionDetails form (same thing). This form contains a botton NewButton which is ment to call a creation form, like the SalesCreateOrder form.
You have two options:
Fill out the NewRecordAction with the control name of your create menu item. This should be mandatory in list pages.
Delete the NewButton, then create a new command button with New in the Command property. Also remember to assign a value to the DataSource property on the control or a containing node.
I personally prefer the second option (maybe combined with a setFocus call) because a create form is then not needed and there is only one form for you to maintain and the user to learn.

install4j: Configurable form change visibility from drop-down list

I have a Configurable Form and i want to change the visibility of another field based on the value of a Drop-down list.
For example I have a Drop-Down list with entries A,B and the variable name for it is testDD.
I have a Text field smtpMailServer that I want to display only if testDD's value is A.
I have tried the following approaches in smtpMailServer's visibility without success:
return ((String) context.getVariable("testDD")).equals("A");
return (context.getVariable("testDD")).equals("A");
and I've also tried to add a script to testDD Change Selection Script with The following code
context.setVariable("ThisFormConfiguration", selectedItem);
And use the code above with ThisFormConfiguration instead of testDD. But it's not working.
Could you please help me?
Thanks!
I have tried the following approaches in smtpMailServer's visibility without success
The visibility script of a form component is only evaluated when the form is shown. You should keep it, but it only handles the initial condition.
and I've also tried to add a script to testDD Change Selection Script with
The following code context.setVariable("ThisFormConfiguration", selectedItem); A
Using the "Selection change script" property is the right idea, but your script has no effect. There is no live binding from the variables to the form components, the variable is read when the form is shown and updated when the user clicks "Next".
You have to use the following selection script:
formEnvironment.getFormComponentById("123").setVisible(selectedItem.equals("A"));
where "123" has to be replaced by the ID of the text field.

Easiest way to select or type over text in a text box in protractor?

In a protractor test I have an <input type="text"/> that is pre-filled with a value, and I'd like to erase that value and type a new one. Ideally I'd be able to just say something like
// Some way to select all the text in the text box so `
// sendKeys` will type over it.
element(by.css("input.myInput")).selectAll();
element(by.css("input.myInput")).sendKeys("my new value");
But selectAll doesn't exist and I can't find anything helpful in the API docs.
Any ideas?
I use clear to do this in one of my tests, works like a charm ;)
element(by.css("input.myInput")).clear();
Found it:
var ctrlA = protractor.Key.chord(protractor.Key.CONTROL, "a");
element(by.css("input.myInput")).sendKeys(ctrlA);
Sends Ctrl+A, the keyboard shortcut for "select all".
Double click on input and click on BackSpace
browser.actions().doubleClick(input).sendKeys(Key.BACK_SPACE).perform();
Or double click on the input and set a new value, and it will replace previous value
browser.actions().doubleClick(input).sendKeys('9999').perform();
Similar to glepretre, my solution is given the input formcontrol is named 'Name' but this worked for me
newValue = getNewValue();
element(by.css('input[formControlName=Name]')).clear();
element(by.css('input[formControlName=Name]')).sendKeys(newValue)
.then(function () {....});

Dynamically add fields to input dialog

Is it possible to somehow add input fields to an input dialog (inputdlg()) in MATLAB when a specific event occurs, e.g. the user types in a certain value in one of the existing fields...?
Or is there any other 'hacky' way to achieve this so that the user doesn't have to click "OK" and I have to code to reopen another input dialog which contains more input fields..
Thanks!
inputdlg is not a built in function, so you might as well copy it, call it by another name and change its functionality.

Make a radio button in an infopath form "read only"?

I'm making an InfoPath form which is tied to an Access database. I have a set of radio buttons where the user selects the software name corresponding to the form, but I store this in my database as a number (1, 2, or 3). In another view, I want them to be able to see the previously entered software name, but not be able to change this. Here are the two options I've thought of:
Create some rule that does prevents the user from changing this data
This seems like the natural approach for what I want to do.
Add a text field with a function mapping each number to the corresponding software
As the form is tied to the database, InfoPath wants all fields to be tied to a database value, which would require creating another database entry. I'm also having trouble finding an InfoPath function I can use to handle this mapping.
Change the radio box's variable to text values and make a text box in the new view, which can be made read-only.
I'd really prefer not to do this, as it will make things messier for other programs using this database value and seems wasteful, but if nothing else works, this seems do-able.
Is there some sort of rule/method I could use to make this radio button control read-only?
You can use conditional formatting to disable any control (including radio buttons).
To set your control to always be disabled do the following:
Right click on your control and select Conditional Formatting...
Click Add...
In the leftmost dropdown select The expression
type true() in the text field (this tells InfoPath to always apply this formatting)
Check the Disable this control checkbox.
Click OK and OK.
Note: You will need to do this for each of your radio buttons.
Also, for future reference: If you simply want to display the result of a function (such as in your second solution) you don't need to use a text box. You can use an expression box. An expression box is not necessarily linked to a field in the datasorce, so you won't need an additional column in your database for it.