Hey everybody, what I am trying to do is have it so when a person selects a typeahead valuelist, that the text in that valuelist is selected so the user can then just hit delete to clear out the info. so I thought i could just run the Servoy elements.whatevername.selectAll() onFocus of that element but it seems to be just selecting the text for a second, then the typeahead behavior takes over and I see the dropdown list values displayed instead of just highlighting all the text. Not sure if I explained myself clearly but thats the issue im having… is there a way to select all the text in a typeahead valuelist without the typeahead behavior taking over?
The onFocus event fires before the mouse click so you end up with all selected text for a brief moment as the method is fired to be immediately replaced by the cursor in the field where the user clicked.
I think a transparent button (no border) placed directly on top of your type ahead field will do what you want. The method for the button:
I like this behavior much better so maybe Servoy will think about changing things around a bit!
No no no, your suggested solution is ok David but an onfocus event should be what it is ‘an onfocus event’ and should do something when somebody gives an element focus. But not something that is not expected. Selecting all text in a field is unexpected…
I like this behavior much better so maybe Servoy will think about changing things around a bit!
No no no, your suggested solution is ok David but an onfocus event should be what it is ‘an onfocus event’ and should do something when somebody gives an element focus. But not something that is not expected. Selecting all text in a field is unexpected…
To be more clear, the issue is that the “selectOnEnter=true” property doesn’t select all the text of a field when it is a type ahead field. Like it does with all other field types (a bug? an oversight?). So we’re left with coming up with an alternative.
I would like to see this property working correctly on a type ahead field – not change how the onFocus event works.
Hey david, the solution worked out for me except, that im hitting another issue now. the onDataChange method doesn’t seem to get triggered the same as it once did. Basically my form, onDataChange, applies an address to a form, and once that address is assigned to a form, the address is locked by another field in the address table… if the address is updated and no longer is attached to that form, then i go back and update the address table to unlock that address. also, an address can be applied to multiple forms.
the way it was working before the invisible label was placed on top was that it would grab the id of the previous address, the id of the new address and lock the id of the new address, then check if the id of the old address was applied to any other form.. if it had.. then i leave that address locked. if that address is no longer applied to any form, then i unlock that address. however, the onDataChange is triggering early now (before the change is complete) so when i go into the system with the old address id and try to find any other occurance of that id in the forms table, it always finds one because the update hasnt been triggered. but after when i then go and check the db, that old address id is no where to be found in the form table.
it seems like because of the way the invisible label is working, onDataChange is being called before the data is totally changed in the database when before it seemed to be calling this method after the data was changed. just wondered if that makes sense and if anybody else who has implemented something like the invisible label has the same type of functionality.