Looking to retrieve the selected ListView row at any given time. I know I can keep track of it on click, but there are many scenarios where the "selected" status gets removed. I would like to keep it consistent so that if the row has the selected background color I can get that index.
Right now I'm keeping a variable on click and hunting down all the scenarios where it gets removed (window blur, redraw of the list view). The one I can't find an event for is when you slide the row to show the edit actions. As soon as you start to slide, the row loses its selected background color, but there's no event for that as far as I can tell.
Any help would be appreciated. Thank you
The ListView has no selected state in Titanium. Not sure if it has natively either.
If the functionality is there natively it could be a great add-on to Titanium, and to help set that in motion you could raise a ticket on the Appcelerator Jira to get that implemented. To expedite even that you could submit a Pull Request to their open source code on github
For now you will indeed have to keep track of it through click events and what you describe.
I solved by setting selectionStyle to none, listening for the click and updating the background color manually. This doesn't truly represent the native "selected" status of the row, but works for my purposes.
Related
The short question is: which is better for tStringGrid cell choosing on Android and why? OnCellClick or OnSelectCell or OnTap?
I have an Android app that previously used (don't laugh!) OnMouseDown to determine which cell in a tstringgrid was tapped. It worked well for years. Sadly, it is not compatible with gestures on the newer Androids, so I have to rewrite the cell choosing routine for my tStringGrids. The reason I went with OnMouseDown was due to issues with other routines, but that was years ago and those issues are hopefully long fixed. Looking for recommendations and pitfalls among the other options.
BTW, OnMouseDown was removed from the UI in v10.1 (Berlin) though it still exists as an option to set at runtime. I should have taken that as a clue back then. :) I am currently using 11.1 to update the app to Android API level 30.
In case it helps to see what is being clicked, here it is. It's a home control app. The selectable cells are where you see "ON", "OFF", "<", ">". The latter two are for dimming. The grids are read-only - all content is set on the home controller, not in my app, so cells are never edited by the user. There is no need to show which cell was last clicked and I prefer NOT to change the color or shade of the cell upon clicking.
We have a PWA (web app) that the user can add to the homescreen to make it look more like an app. Some users have reported a strange issue that only seems to appear on IOS sometimes when the following step has been made.
Open the app from the homescreen
Use the app for a while
Put it into background
Turn off the screen for a while
Turn the screen back on and put the app to foreground again
The bug is that nothing seems to happen when you click on a select or date input control. First I thought that there was some overlay in the app that was blocking the ui controls but the elements receive focus on click, but not options are shown.
Now it really becomes strange. When I tried to click a little bit under the select input an option was selected. The same thing occured with a time select. If I first clicked on the timeselect input control and then a little bit under, it updated the time.
So, the controls seems to be there but nothing is visible on the screen. I have only been able to reproduce this on my own once but multiple users have been reporting the same thing. The only way to work around the bug is to restart the app.
It seems to be for all native safari controls that shows some kind of modal/popover.
I've did an indepth investigation on this select dropdown problem and posted an issue at bugs.webkit.org: https://bugs.webkit.org/show_bug.cgi?id=238318
It's a problem with dropdowns of several components (such as select, input file/date/month) where either the animation to have the dropdown appear or disappear seems to get stuck. You can sometimes see the dropdown being tiny and very transparent (if you zoom into a screenshot) and sometimes you'll be able to select an option even though you don't see the dropdown.
My problem is this:
I have an application and I have to decide the state of an element. The element can have two states, in position number 1 - it has black background in position number 2 - it has white background. Nothing else changes on it, nor it's size, nor it's value, nor it's name, nor it's visibility, nor it's enabled value nothing... Only it's background colour.
Imagine it like if you had a button on the screen and tapping on it changes only it's background.
Do you have any idea what could I do in order to get the state of this webelement?
If I understand it correctly , you want to identify the element with its background color. You can do that with SikuliX Java api
The easiest way is Option 2 under "How do I set up SikuliX" and here is how to use it with Java (with Maven, so you have all the dependencies)
here is a project I did with SikuliX, in case it is of any help.
I am not sure , if you are trying to do it in mobile but I think right now it can not be used with mobile devices, as mentioned in pre-requisites.
I'm sure I'm not the only person asking this question. When you have a jQuery UI implementation, and you use the .buttonset(); command to turn a set of checkboxes into a button-set (multi selectable), I'm having trouble when a user de-selects an item after selecting it.
So let's say on hover, it turns into a certain colour (based on the settings of the jQueryUI theme I downloaded), and after clicking, it turns into the active state colour. When I click the same item again, and move the mouse away, it remains the hover colour, causing confusion as to whether the item is deselected or not.
And this only happens on Firefox only - seems to work fine on Chrome & Safari.
Here's a demo link: http://www.tylervolker.com/mls-search
I tried to force a blur() event to these items but no dice it seems.
$('.label').click(function(){
$(this).blur();
});
What am I missing? Or is this just a Firefox thing I need to live with until either jQueryUI updates their code, or Firefox appends this?
This appears to be this known jQuery UI bug - http://bugs.jqueryui.com/ticket/5518. The button widget isn't set to be addressed by the jQuery UI dev team until 1.11 so I wouldn't expect a fix for this anytime soon.
There are some suggested workarounds in the related issues on that ticket.
I am using the new BrowserField2 in BlackBerry OS5 to display HTML content in my app. There are 3 options available for navigation through links in that content.
CURSOR navigation uses a block cursor and actually moves through the characters of the page. Not very useful for me.
POINTER navigation uses a mouse like pointer that you move around the screen and hover over elements. This could work but there is a bug however in that the browser field captures navigation and never lets go so this mode is effectively broken if you share a screen with any other managers. Once your focus enters the browser field you cannot move focus back out and into neighboring fields. RIM has acknowledged the bug but has no work around.
NONE which is for custom navigation but they offer no explanation as to how you would do this.
What I ideally want is to simply have trackpad movements move the focus through the links and highlight them. Then a click would activate the link. I assume I would select the NONE option above and implement my own focus navigation but I am not clear how this can be accomplished with the new APIs.
Is anyone familiar with the new browser2 component could give some guidance?
Thanks!
There's a workaroudn to getting back the focus out of the BrowserField using the NAVIGATION_POINTER.
I found it in this thread:
http://supportforums.blackberry.com/t5/Java-Development/BrowserField-2-Navigation-Mode/td-p/632172
"farahh" posted this:
I found out a hack..
with the navigation set to pointer mode, a click outside the browserfield manager invokes Manager.invokeAction(int). I used the getFieldWithFocus to verify which field has focus and then switch the focus to something else.
Cheers.
Nahuel
PD: i havent found out how to get the behaviour you want, i need that as well so if you got it working please let me know, its kinda urgent in my project =(
I actually reverted back to the older browser1 (OS4) component because the navigation problems in browserField2 (OS5) were a deal breaker for me. Luckily the OS4 browser does everything I need in terms of functionality and it has the exact navigation behavior I need and there are no focus problems mixing it with other views.