There is no way to detect when a user selects files from an Input Type File form element in Angular JS. So we will have to do it the old fashion way.

Rather than binding, we can directly make use of the input element’s onchange event.

And in our Javascript file where your controller is located, add this function:

That’s it!

I bet you get confused why the ListView object does not capture click events at times. Ever thought that maybe the components within each ListView entry contain components that accept input events?

Take for example EditText or a Spinner? If this was a regular TextView, then there will definitely be no problem when it comes to capturing click events in the OnItemClickListener or OnItemLongClickListener().

What you can do to fix this is to set your EditText component to disable events so these such events will be relegated to the ListView.

You can do this by setting android:focusable=”false” and android:focusableInTouchMode=”false” in the XML layout file. Try it and check it out.

You will see that by setting these attributes to false in your EditText, your ListView object can then capture click events.

The trick here is with the use of CSS. Add the code below and those spinner arrow buttons in your input form fields will be hidden.

A big thanks to user antonj of Stack Overflow.

Related Posts Plugin for WordPress, Blogger...