I want to disable/enable a submit button based on the state of paper-checkboxes in my iron-form. So, for that I am using the iron-change event.
In that event, I want to see whether any checkbox is checked or not. One approach is to loop over all checkboxes.
Is there any other way in Polymer to get the length of checked paper-checkboxes?
Ok I figured it out. The paper-checkbox has 'checked' attribute set.So, we can do something like this:
document.querySelectorAll('paper-checkbox[checked]')
Related
I want to basically know if I am having rows selected to activate an input, the thing is
"selectionChange" event is not capturing when the selection is being changed I have a small example.
https://codesandbox.io/s/ag-grid-react-redux-events-forked-459v6?file=/index.js
What id expect to happen is to get the alert to show when something is selected on this example.
Turns out in React this property is onSelectionChange, following react pattern
I am using angularui bootstrap typeahead module for my project.
I am unable to pre-populate the drop-down with predefined value.
Whenever user click on input text of typeahead, it should automatically show the typeahead suggestion dropdown(from a static JSON).
Whenever user starts typing, then the behaviour should be normal.
I tried this solution but unfortunately it stopped working when I upgraded my angularjs to version 1.3
So I essentially accomplished this by making a custom directive and making a minor modification to the ui bootstrap typeahead code. You have to trick the typeahead into thinking someone has typed something in it. I placed a little pulldown arrow to the right of the field so essentially it looked like a pulldown and clicking on that arrow would show ALL choices. You should be able to do it using onfocus.
Basically find the code in the bootstrap typeahead that binds to the key events and I changed it to check for a keydown event of 40
if(scope.matches.length === 0 && evt.which === 40) { // Added
// COMMENT OUT modelCtrl.$setViewValue(modelCtrl.$viewValue);
modelCtrl.$setViewValue(''); // Added
}
You'll also need to make sure the typeaheadMinLength is set to 0. Note in the code above it checks for the case of the user NOT having typed anything AND the special keydown event that I trigger. You should be able to change this to trigger on onfocus. I copied the bootstrap typeahead to mytypeahead.js and then modified it as above, along with a few other minor mods that you may or may not need depending on if the field is "required" or not.
I am unable to fire OnItemClicklistner method on clicking on Checkbox (in my List-view), i have tried following way...
i have set the focusability and clickability to false as follows.
android:focusable="false"
android:clickable="false"
android:focusableInTouchMode="false"
It fires the OnItemClicklistner but doesn't send reference of Checkbox in view parameter. Please help on this.
Please look at Google documentation at CheckBox class.
Checkbox does not have OnItemClicklistener. You may be getting events from a different UI element, hence confusing you. Checkbox has setOnClickListener method for you to use. Remember documentation is there to help you.
Is there any way to know the current value of a checkbox in wicket before any action takes place?
wantOnSelectionChangedNotifications() is not useful for me, I want to know the value of the checkbox before clicking on it.
Thanks
first of all in the server you cannot know the state of the input with out a form.
use AjaxFormComponentUpdatingBehavior or AjaxFormSubmitBehavior to attach the event to the checkbox and submit their form. with this aproach you going to submit all components inside the form, if you just want the value of the check you could use a nested form(wicket include support for it)
Right now I have change listener but it requires the checkbox to lose focus to register. I looked around online and was unable to find out if such listener (or better substitute) exists.
Is there anyway at all to create a click listener?
Have you tried check?
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.Checkbox-event-check