Mobile command button issue - mobile

In the iPhone ADF mobile app I have a textinput field and a "Save" commandbutton. In the properties for the commandbutton I have the disabled condition set (like if the textinput field is null). This works fine. In the beginning the save button is disabled and when I enter any text with a keyboard the button is automatically enabled and vice versa.
The only issue is my users can enter the text via voice too. If they use the voice to fill the text field - still the save button is not enabled. As soon as they change anything using key board it is enabled.
How do I set the command button properties to check this please?

In the InputText properties there is a property called Value Change Listener,
add a java method to it to check if the value is null or not then try one of the below:
Reset the InputText value as this will fire the propertyChangeListner and may activate your button.
Disable or Enable your button in code according to the value.
Hope this help.

Related

react-select don't focus input when opening options list

The Select component (https://react-select.com) always focuses the input when opening the dropdown. This is not wanted when on mobile because it causes the virtual keyboard to always open.
We want the user to be able to tap the dropdown indicator icon on the right on the Select component and see the options without focusing the input, but, if the user taps the area over the input then the focus is given to the input field.
*edit: github.com issue related - https://github.com/JedWatson/react-select/issues/3526
Have you tried using the isSearchable prop and setting it to false?
You can test this functionality on the first example of www.react-select.com
Click on Select, see keyboard
Now uncheck "Searchable", click select, and you should be focused without a keyboard.
I included images in the referenced react-select issue.

How to set focus on textbox and button simultaneously in WinForm

I want to set focus on a button while caret is present in textbox and user can still enter data to textbox. But when user presses enter key, button press will be simulated.
I am currently using a work around to solve this problem by handling onKeyDown event and checking for enter key. But problem is there is no clue for user to understand this as there is not blue border around the button that indicates focus on button.
Here is a example of what I want to implement (user can enter text in textbox while focus is on :
I have tried to search on google and StackOverflow but could not find any relevant result.
This is a fundamental Windows principle. It's not possible to have 2 controls (windows) focused at the same time.
So the focus should be inside the text box. But you can get the visual indication needed by setting the ok button as AcceptButton of the form (you might also want to set cancel button as CancelButton).
In the form constructor, load event or using designer:
this.AcceptButton = okButton;
There is no need to handle KeyDown event - as soon as the text box is not multiline, pressing Enter while the focus is inside it will generate ok button click. The same applies for the button set as CancelButton when you press ESC.

CodenameOne set indexing of fields for virtual keyboard

Using CodenameOne,
I have a Form that the user needs to fill in. All of the components, however, are actually Containers that represent custom functionality. As an example, I would have a TextField alongside a Button on a Container, and I would use that Container as a "Component". This allows me to create more advanced functionality by combining existing Components.
A good example of where this is necessary is that of a custom date entry field existing out of 3 TextFields or a combination of TextFields and ComboBoxes.
I have a "Field" that has functionality for that of a Contact Component.
This all serves as a single "Unit" in order to allow the user to choose a contact or fill in their own. Buttons open Dialog popups, etc.
My problems comes with when the user uses the Android keyboard. Should this Contact Object be the second "Field" and the user presses the 'Next' button on the Android keyboard, the App does not know what field to give focus.
Furthermore, If one of the fields are a ComboBox or a Button and the user presses next to reach that Component, the keyboard doesn't close, and instead removes the 'Next' button, replacing it with a return button or an emoticon selector.
Below is an example situation:
The user would press on the first field, the Keyboard shows up, and when the user presses next, the keyboard's Next button dissapears, as the immediate next field happens to be a Button or ComboBox.
Is there a way to change the focusing index, or omit certain fields form ever gaining focus in this way? I tried making the entire thing a Component but that doesnt allow me to combine other Components. Even if it is possible to make the parent Container a Component, how would I solve this particular issue?
The default behavior is to use the "next focus down" for this functionality so just use setNextFocusDown(nextTextField) on each one of the components. Notice that a ComboBox won't work as expected although you might want to change that to an AutoCompleteTextField which would.

how to set focus to an input element when page gets scroll in ios?

I am working on a project based on angular and ionic. I have a page consisting of sign up form. It has four fields namely email,mobile no, password and confirm password.The issue I am facing is that when I tap on confirm password field then keypad gets open and page gets scrolled. then confirm password field loses its focus. cursor is not get set to that field as well as whatever I typed on keyboard is not get shown in field unless I click outside.

Change view of form on click of button or checkbox

I have to make a form codename-one in which i have a check box. if check box is checked then bellow it i want to display 2 combo box and if check box is unchecked then i want to display 2 text field.
How can i do it.
I have tried setVisible(true/false) but in it space consumed by label or text field is never covered up.
Please help.
You need to remove/add the components and then invoke either revalidate() or animateLayout(int) to refresh the UI.

Resources