Please have a look at the following jsbin
At first, numberTest requires the user to input a number between 5 and 10 (as noted by the description beneath it). If you press the change min/max button, the min/max fields are updated to 500 and 510. Again, you can see the description has updated to these new values.
However, it still requires the user to enter a value between the original min/max settings (5 and 10). How do I get the validation to see the new settings? Clearly, I am setting them correctly because the description under the field is updating correctly. It seems that the validation is stuck with the original values.
EDIT: I added better validation messages to the field. You can see that even the validation message thinks that the new min/max values are correct but the field still requires 5-10.
The problem is that you're not using expressionProperties to change the values, but changing them manually. angular-formly does a lot of optimizations to make sure we're not adding watchers that are unnecessary. expressionProperties is how you inform angular-formly that these values can change.
Here you go: http://jsbin.com/xenuqo/edit?js,output
For more on expressionProperties see this
Related
Ordinarily, this is a very simple thing. My issue is I can't seem to get multiple values, so I'm guessing it's a format issue? In my report, here are the default values:
When I preview the report in VS, it shows up exactly as it should, and obviously, I have the multi-select setup correctly:
NOTE: The values of 2 and 3 are the ID's in the query. This is done to utilize the indexing on these values as opposed to just pulling up a big list of strings, so it's finding the ID but actually displaying the "description" in the drop-down.
After the report has been deployed, I discovered that within the options of the report (click report, go to Manage, then navigate to Parameters) this is where there seems to be the hang up. I can select just 2 or just 3 and there's no problem, it will use either of them as the default. I've tried various formats to use 2 AND 3 but have had no luck and get the error The value provided for the report parameter 'Model' is not valid for its type. (rsReportParameterTypeMismatch). I'm not sure why the default values selection in my first screenshot doesn't take care of this, but for whatever reason, the last screenshot appears to override this functionality. Any idea as to how I might get my 2 values?
I figured it out. Pressing enter to go to the next line, no comma or other separator will get this to work.
I'm using react-select with react-final-form and I need to have two selects, where the selected option in the first select dynamically sets the options for the second select. For example, when option One is selected in the first select, the second select gets options One A and One B.
These selects are used in an array. Here is my codesandbox with initial setup https://codesandbox.io/s/react-final-form-field-arrays-e4mm6?fontsize=14.
I've found two similar examples, but I don't know how to adapt them to my use case.
First, I've found this example for react-final-form which sets field's value using createDecorator, but it's used for the value of the field and not the options prop.
Second, I've found this example for react-select which sets options dynamically using state, but I don't know how I can adapt it to my case, considering field arrays.
I would appreciate any help.
Interesting, problem. Here ya go. I created a <PickOptions/> component that watches the first field and provides the options to the second. It also clears the second field when the value of the first changes, which seemed like something you'd want. You could also set it to the first option in the array or something...
I have an input element on my form that accepts a date/time. It has validation to check that it's a valid date/time. The default value for the field is the current date and time. When using Chrome, I can change the value of this input box multiple times, and as long as it is a valid date and time it will be accepted. However, in IE 11, if I change it to another valid date/time, it indicates an invalid value and will not allow the form to save.
The date/time field:
input#transit_date_arrived.form-control.date-time-picker(name='transit_date_arrived', ng-model='vehicle.transit_date_arrived', type='datetime')
In the vehicle model:
transit_date_arrived: {
type: sequelize.DATE,
allowNull: true,
validate: {
isDate: true
}
},
If anyone knows how to get this to work with Internet Explorer, I would really appreciate it, thanks!
One problem with IE and angularJS (in fact, maybe more than just a.JS) is that a field marked as invalid also spontaneously becomes "dirty" when typed in, tabbed through or otherwise interacted with. Apparently this also applies when validation resets the field, and on the second interaction the same happens.
According to a few questions and a bit of research, validation is actually very broken in IE. At this link, for example, determination between literal empty strings and invalid strings in impossible.
This link shows some issues that the author has come across in actual date verification, including error handling and false-date resolution. Unfortunately, his code has broken the definition for a "true" date - i.e. 0000.00.00 would be recognised as a valid date, due only to it's formatting.
There is an example of date verification here, which you may wish to use to append your code. in particular, you may wish to use $valid and $error.required.
There's also a very ugly piece of code here, which intends to allow validation in 4-step form.
I'm having trouble using ng-options with filters.
The problem is that when an option is removed by a filter, the model of the select element retains the value of the removed option.
Here is a plunker. I have two filters working on the ng-options set. One that removes duplicates from the list of options, and one that removes nulls. You can see the problem I am speaking of by following these steps.
In the "Preferred Email" dropdown, select the last email option, 'jimbob#yahoob.com'.
Delete the text in the "Other Email" input box.
You can see now that because "Other Email" is null, it is no longer an available option, and the dropdown has defaulted to "Please Select Preferred Email". However the model of the select element still has that object assigned to it.
Same problem different context.
In the "Preferred Email" dropdown, select the option 'jimbob#yahooz.com'.
Now delete the 'z' in "jimbob#yahooz.com"
Upon doing so, the values in the two input boxes ('Email' and 'Home Email') become duplicates, and the second one ('Home Email') becomes filtered out of the available options. However the object that was just filtered remains assigned to the model.
Edit: My solution (Can anyone do better?)
Here (plunker) is the best I could come up with. I'm new to angular and can't help but think there is a better way to do this, I think this solution is "bad" but it works.
Essentially I pass into the filters a reference to the scope (this.contact) along with the name of which default item I am working with ('default_email' or 'default_phone'). If the filter is removing an item from the options set, it checks if it is the default, and if it is, sets the default to undefined.
I also added a bit more code, to get more context as to what I am working towards.
I know this is old, but I spent a long time trying to figure out the best way to handle this.
Turns out it's fixed in Angular 1.4! Try replacing the Angular version in your original plunker with 1.4, and the problem just goes away. I found this out by trying various versions until I narrowed it down.
I am using ADF in JDeveloper and don´t have any experience with either of the two. Now I´ve run into quite some trouble yet, but for this particular thing I decided to consult the wisom of stackoverflow.
The thing is, I have an edit form for an object that contains 3 checkboxes. The checked values are set to 1, unchecked to 0. In my database, the values are NOT NULL, and I want to keep it that way.
The thing is, in the edit form, if the user submits the form leaving any boxes unchecked, it will result in an error, because the unchecked box values apparently remain null. Only after checking and then unchecking the boxes again, their values will be '0' rather than null.
I've tried some things, including making the attributes mandatory in the domain BCD, but that just gives a bit more neat error message..
Any help would be greatly appreciated!!
EDIT
I made a little progress thanks to the guide provided by Joe, but still run into problems.
I changed the values that should be checkboxes in my model, making them BOOLEANs where the table columns are NUMBERs (All are also mandatory and have a default value of 0).
This automatically changed the corresponding View Object too. In the Application module, this now works great. It shows checkboxes, a checked one will return 1, an untouched one will return 0.
However, I deleted the old form, and inserted a new one using the corresponding Data Control. I gave these values the checkbox type. I still had to edit the bindings (which I think reflects the problem, as this is not the case with, say, a model-level defined LOV) and gave them 1 for checked and 0 for unchecked.
However, now apart from the original problem still occurring, also the checkboxes cannot be unchecked after checking, and return 0 when checked (and null when left untouched).
Even though this has created new problems, it works correctly in my AM. Does someone know what I'm doing wrong in my Swing form?
this link might help:
http://theo.vanarem.nl/2010/07/07/adf-checkbox-representing-a-yes-or-no-value/
or
Extend the EO impl and override doDML and check each of the attributes - if null, set it to 0