vee: validate with required fails when setting checkbox value programmatically - vee-validate

This: https://codesandbox.io/s/jovial-glade-tg7ev
ValidationObserver works when clicking a, b or c checkbox. But when value is inserted in array programmatically (click button), the ValidattionObserver doesn't detect it. Is that an error and I think the valid property from ValidationObserver should change?
Ken

To test the validation when setting the values programatically, you have to call the following piece of code, just after you've updated the value, and put a ref="observer" on the ValidationObserver component.
this.$refs.observer.validate();
Updated codesandbox: https://codesandbox.io/s/summer-pine-mrrlm

Related

How to submit the value in an inputtext field by setting autoSubmit to false

I have an ADF form based on a VO and I need to check whether a particular field is null or not on click of a Submit button. For this, i set autoSubmit to true and get the value entered to a variable in my bean.On click of Submit button , i check if the variable is null or not and display error faces message if the variable is null. But how do i get the value entered in the form to a variable in the bean with autoSubmit set to false?
Why do you have it turned on in the first place? And why do you want to turn it off? Are you clear on it's functioning and why to use it?
Autosubmit is used to support Partial-Page Refresh.
If you don't need PPR, Just turn it off. The value will still be available once the submit button is pressed. Read about it here.
An input component that has its autosubmit property set to true also
performs a partial submit of the form. However, this time it doesn't
submit the entire form but only the component that triggers the submit
plus components referenced it in their PartialTriggers property.
Autosubmit is not required to access values entered into input components on the screen. Autosubmit submits only the field and also bypasses certain phases of the page processing lifecycle.
if you turn autosubmit off, the entire page - all the fields - is submitted and goes through the complete page processing lifecycle, so you have access to all input fields.
Docs here.

admin on rest in create form - Generated the TextInput by loop. If I type anything in one text-box, it is reflecting in all other generated text-box

I created the TextInput by loop. If I type anything in one text-box, it is reflecting in all other textbox's as well. How to prevent this reflecting one textbox value into others textbox's automatically.
You should set it's source property. But it's always best to show an example of your problem in a codesandbox.

Access 2016 Form Control Validation Rule Not Firing

I have a simple unbound access 2016 form. On the form, I have several controls including text and combo boxes. On the first text box control I would like to require a data value (underlying table field data type is short text).
I have set the Validation Rule property for the control in the property sheet to "Is Not Null" and added an appropriate validation text message.
For an unknown reason I have not been able to get this validation rule to ever fire. I have cleared the validation rule on the table to make sure it wasn't interfering, however, no luck.
It's like the validation check is not happening when focus leaves the control. There is no other event procedure that has been written that would interfere either.
Thanks for the help.
You can give the control a default value, then
Form_load()
Yourcontrol.setfocus
Sendkeys "{DEL}"
The requirement was to validate the control for a missing value using the validation rule when the control lost focus (ie user tabbed out of text box without ever entering a value). I wanted the user to get immediate feedback that they needed to provide a value for the given control.
As Rene pointed out in the comments, the validation rule does not fire unless there has been a value change.
The Sendkeys solution has issues, I only use Sendkeys as a last resort.
The solution in this case was to put the validation test in the Control_OnExit event handler. The user gets immediate feedback as desired and does not wait until the record is submitted.
One further note that could easily be missed; in an unbound form, the before_update event will never fire.

Issue with validation in knockout js

I put validation on name input field field you can see it when you click on addFields.I am having problem that validation message coming before click on Add Branch button because in addFields function i'm setting the value of name empty because if i don't do this click on edit and make changes and click add or cancel on it and after that click on addfields then it show the previous value in input fields. i want to show validation message on click of Add Branch and want input fields empty on click of addFields and with values on click of edit. How can i achieve these scenario together ?
here is link
`http://jsfiddle.net/sohimohit/43zkoszu/13/`
You can use showAllMessages(false) on your error object
http://jsfiddle.net/43zkoszu/16/
All though I must say that your method of doing this is a little strange. Normaly with MVVM you have a seperate model for this and create a new one each time you want to registger a new
As #Marius has already said, you need use isModifed(false) for changed field. So, your code should be like this
self.AddField = function(){
self.BranchId("");
self.BranchId.isModified(false);
self.name("");
self.name.isModified(false);
self.description("");
self.description.isModified(false);
// .... etc ..
self.show(false);
self.show.isModified(false);
self.showFields(true);
self.showFields.isModified(false);
}
Also, please, notice you have comas (,) instead of semicolons (;) in your AddField code.

Get value from autocomplete text field in ApEx

I want to create a dynamic action, that will set a value to an item on the page, when the value of another item (autocomplete text field) is set.
So the proccess goes like this:
Click on the autocomplete field
type some letters
choose one of the suggested values
I cannot find an event that will be executed when the selection of one of the suggested values happens. This way, I cannot see how I can read the value of the autocomplete field, once a suggested value is selected.
The change event doesn't fit my needs, it doesn't execute when one suggested value is selected.
I had the same problem, found this link: https://community.oracle.com/thread/2130716?tstart=0 and modified my dynamic action as follows to get the desired behaviour:
Event = Custom
Custom Event = result
From the link:
the problem seems to be the default behavior of the browser. When you
enter some text into the autocomplete and the list is displayed, the
focus is still in the text field. Also if you use the keyboard cursors
to pick an entry the focus will still be in the textfield. That's why
the change event of the textfield doesn't fire. It only fires if you
leave the field.
On the other side if you pick an entry with the mouse, the browser
will remove the focus from the text field for a moment (before the
JavaScript code puts the focus back), because you clicked outside of
the field. But that's enough so that the browser fires the change
event.
I had a look into documentation of the underlaying jQuery Autocomplete
widget
(http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/) and
there is actually an event called "result" which can be captures if an
entry is selected from the drop down list.
Try "Lose Focus" as event. It will trigger your dynamic action when you leave the autocomplete field, i.e. your curosr is moved to another field.
This probably depends on the APEX version you are using.
In case of 18.2, because the underlying component is based on Oracle JET's "inputSearch" component, you need to use following configure to capture the select change event for text with autocomplete:
event: Custom
custom event: ojupdate
Reference:
https://docs.oracle.com/cd/E87657_01/jet/reference-jet/oj.ojInputSearch.html#event:optionChange
I turned on the browser console, then turned ApEx Developer toolbar debug, and found that, on the contrary, the "Change" event does fire upon user clicking with the mouse on one of the selections. However if the user uses keyboard (type a few letters to narrow the list down, then use down arrow key to arrive at desired value, then press enter) then the Change event does not fire, just as you say.
Moreover: even when you do get the value sent back via mouse-click initiated Change event, the value isn't the autocomplete's complete and valid value, but instead the possibly partial and wrong-case value just as typed by the user. I.e., the the change event's submission of the value precedes the autocomplete's substitution.
The answer that #VincentDeelen gave is the best alternative that I can see, although it doesn't quite give that "instantantenous synchronicity" feel. You could maybe use the "Key Down" event, but be careful with that. You could get a really excessive amount of web and db traffic as each and every keystroke (including corrections) results in another firing of the dynamic action.
Testing environment: ApEx 4.2.3 with Chrome 33 as well as IE 9.
p.s. This might be worth a mention to the ApEx development team as well.
It's not really ideal, but you could use onfocus(). I'm looking for the same thing you are, I think, a custom event that fires when the selection of a suggested value happens. I haven't found it yet though and that is my work-around for now. It will run whatever function you've created for this initially with no value, but once the selection is made it will return focus and run the function again with the right value. Like I said, not ideal but it works.
Jeffrey Kemp is right. You can set it up through a dynamic action using the custom event, result. You can also register it on page load using document.getElementById("{id}").addEventListener("result", {function}); or $("#{id}").result( function( event, data, formatted ) { //something here });.
Oracle apex 19 now added a "component event" when you create a dynamic action called "Update [Text Field with autocomplete]" - this action is fired when you select a value from the list, but not when you leave the field (similar to adding the custom event "ojupdate").

Resources