AutoCompleteTextField completion strings display issue - codenameone

I've made a form in the GUI builder that has 5 auto complete text fields. All are made in exactly the same way with their completion arrays set before the form is shown, also in exactly the same way. The first two fields work as expected. The second two fields only show their completion options after some of the picker components are used on the form (they are in the same container), and the last one never shows completion options (or is showing them off screen?).

This looks related to Codename One - AutoComplete popup window location which in turn refers to two open bugs both of which are scheduled for this release cycle:
https://github.com/codenameone/CodenameOne/issues/1687
https://github.com/codenameone/CodenameOne/issues/1697

Related

MUI Autocomplete — display all filter options

I had implemented a dropdown select in my react/mui app using the Select component; however, there were often several thousand options to choose from and implementing react-window in Select turned out to be a nightmare. So I plumped instead to use Autocomplete.
However my client has complained that all of the options need to be available, even if an option has already been chosen — that is, if there is text in the input. Which is expected behaviour, of course, since it is an autocomplete.
So I have been wrestling for the last several hours to display all of the options, even if there is text in the input, trying lots of different things:
looking for some prop option to display all the options, not just those that match. Doesn't seem to exist
trying to clear the text input when it is focussed. Tried several methods of doing this, such as:
listening to open and clearing the text field itself
manually clicking the "clear" button on open. This is a problem because the open state of the dropdown changes and it really isn't very reliable to determine if it is open or not, and should be re-opened
Anyone had this problem?

How to get a callback from TextArea on each change?

in my app, when editing a record, I've added an ActionListener to save a temporary copy of the edited values for each field automatically, so that if the app is put in the background and then stopped, the edited values can be recovered when the app is started up again.
However, with the TextAreas it doesn't work since actionListeners don't get called unless the user takes some action (like leaving the field). I need to use the TextArea since there can be multiple lines of text, so using a DataChangedListener for a TextField as suggested in this thread does not seem a viable solution. And being able to save the TextAreas is important to achieve good UX since the user likely loses more work when text is dropped than if for example a value set in a Picker is lost.
Is there another way to achieve this result?
Thanks in advance
TextField allows multiple lines using setSingleLineTextArea(false). When invoked it will function similarly to TextArea.

Select control stops showing its drop down list with IE, AngularJS and some strangely-specific conditions

I have a weird problem whereby a <select> control stops showing its drop down list in IE11 using AngularJS after changing the value (twice).
Chrome (42) and FF (37) do not exhibit the issue.
Plunker: http://plnkr.co/edit/Ea0nMnPxXdqm8O59NyZS?p=preview
Fiddle: http://jsfiddle.net/xydvqo0q/
Steps:
Click the select to open its drop down list.
Select either of the two listed options. (It closes and a couple of other fields in the page update their values.)
Click to open again.
Select the other option. (It closes and the fields update again.)
Click to open the drop down list again. Will no longer open
Neither mouse click, nor Alt-downarrow will show the drop down once it gets into this state.
(Further, other selects on the same page also stop showing their drop down lists, and there appears to be a general control/windowing issue for the page - e.g. you can't select HTML text, and other controls won't show the focus or caret. Seems like IE loses the plot about which is the active "window" and it seems to be stuck inside the select. Pressing Tab a few times gets it out of this stuck state.)
Now, an IE control/windowing bug isn't unusual. But this is weird because of the specific set of requirements to reproduce. I've stripped back the example to what seems to be the minimum required to reproduce (yet you might think there's heaps of stuff in the page that should be irrelevant - afraid not).
The page needs the following for the issue to show:
The nested table (which lists "hello"s) must be there (and it must be nested - if it's not inside another table then the problem goes away). (I made it list hellos to eliminate it listing scope data to eliminate that as a cause.)
The table row which contains {{selecteditem.number}} must be there, and must be AFTER the nested table (moving it before removes the issue). I moved it to a separate table and the problem remains.
The selecteditem.number data must be different for the two items. If the "number" values are the same for the two items, it will not show the issue.
The number of "sub items" for each of the two items must be the SAME (meaning the nested table ends up with the same number of rows). If you add another sub-item to one of the items, the problem is fixed. If you add a sub-item to both (so they both have two) then the problem returns.
(Are you thinking I'm crazy yet? I thought I was. But wait there's more...)
The nested table must have the CSS property border-collapse: collapse. Without this property, or with a different value for this property, the issue doesn't occur. Note: the table can inherit this property from the parent table, or from a table CSS rule, or from a class (as the demo shows) and the issue still occurs. Removing it "live" using IE's F12 dev console and the issue gets fixed.
The TDs of the nested table - i.e. the "hellos" - must have a CSS border. They can inherit this, or obtain it from the class (as per the demo).
Basically, I have to tell the client they can have a collapsed-bordered table to show sub-items in the table of fields (there are usually many more than in the demo) or have a drop down list, but not both. (Or don't use IE, which isn't an option, or change the order of you form, which then would make no sense to the users.)
I tried not using ng-options (and instead ng-repeat-ing an option) but I get the same result (I'm limited to 2 links so here's the plnkr ID: 95XcM9j2eY70jUK10UrH).
I may dump the select entirely.

AngularJS Wizard with dynamic steps

I have to implement a wizard, where each step is a single input field.
Everything is wrapped inside an accordion with section headers.
The user, after filling the input and pressing Enter, should navigate the wizard field by field. Only the current field is editable, while the other ones are readonly (the user can anytime change a previously filled input, by clicking it, moving the current pointer to it).
I was wondering what could be the best approach to design this system, considering that the whole wizard structure changes in dependence of different user inputs.
I have found a tutorial using ui-router (http://scotch.io/tutorials/javascript/angularjs-multi-step-form-using-ui-router), with a fixed number of steps, but my requirements are to show the current input edit box inside the accordion, not in a fixed "ui-views" placeholder.
Take a look at https://github.com/JustMaier/angular-autoFields-bootstrap
It's a module that allows you to render forms from Metadata. So essentially, you can change the Metadata you provide dynamically to change the forms.

Conditional Formatting based on layout view

Another question for you Filemaker Pro experts. The database I am developing starts with a Main layout with a number of buttons (e.g. insert new item, show all items, etc.). Each button is associated to a script, which takes the user to the relevant layout. In each of these layouts I show the buttons in a row, and highlight the current layout with inverse colour.
My problem is that some of the buttons lead to the same layout, viewed in different modes, and I don't know how to conditionally highlight the right button.
For instance, Insert new item and Show all items take to the same layout, however in the first case the script views the layout as a form and inserts a new record, while in the second I view as a list and show all records. The layout is the same, though, so I'd need to enact a conditional formatting based on something. How do I do that, and what should I check against?
Thanks in advance for any help.
Regards.
Presumably you are currently using the formula: Get (LayoutName) to decide on your conditional formula, why not try additionally using formulas: Get(WindowMode) and Get(LayoutViewState)?
You could conditionally format the button if (which sends user to MyLayout in browse mode):
Get(WindowMode)=0 and Get(LayoutName)="MyLayout"
Or (which sends user to MyLayout in form view):
Get(LayoutViewState)=0 and Get(LayoutName)="MyLayout"
.
Other functions which may help could be Get(FoundCount) and Get(TotalRecordCount). You can see the entire list of Get functions here.

Resources