On a form I have several text-fields and a Button.
After pressing the button I want to set the cursor (setfocus) in one of the fields, depending of the logik within the button.
I tried this:
elements.<<MyField>>.requestFocus(true);
It have the expected result in:
Internet Explorer
Safari on MAC
It does not work on:
iPAD
iPHONE
the corsor is nowhere on the screen (pressing TAB on an attached Bluetooth-Keyboard has no effect)
Has someone an idea what’s wrong or how I can get it working??
Is it a (known) bug?
Is it solved in a newer release?
Mobile input fields behave a bit differently than standard. For example, the input keyboard pops up automatically and the type of input can be controlled.
Servoy’s web client isn’t designed with mobile in mind so handling mobile nuances isn’t supported. Plus, you will find that performance of web client on mobile devices is on the low end (to put it nicely).
The latest version of Servoy has a specific mobile client.
It probably is working. Just that it isn’t popping open a keyboard (which is triggered by touch) and if a keyboard isn’t up, the input cursor doesn’t actually show in the field. My guess without specifically testing out.
Ok, thanks David. It would also be nice if the numerical keyboard would popup when entering a numerical field.
In HTML5 there are tags for that but according to Paul Bakker it is not easy to implement in Servoy webclient because of the variety of supported browsers…
However, if you don’t care about IE7 and whatnot it’s not hard to implement. The idea is that Servoy input fields are either of type “text” or “textarea”. Change any “text” type input to one of the above html5 input types using web client utils. You can automate by using design time properties and one function that loops through all fields tagged with whatever naming scheme you come up with for design time property and values (ie: inputType = color | date | datetime | datetime-local | email | month | number | range | search | tel | time | url | week ).
Now you have all the cool input widgets on both mobile browsers and regular browsers. And mobile devices will pop open input specific keyboards.
However, there is one…slight…problem. Servoy won’t recognize data input from fields that aren’t of type “text”. Good news is that this is controlled by their client-side javascript found in servoy.js which isn’t that hard to modify:
And Troy is doing an approach in Data Sutra that is quite a bit better (a bit more future-proof as Servoy changes versions) but would take some time to write up.
This part is probably worth a feature request in the end. For Data Sutra we just did it ourselves and moved on A lot of cool input “widgets” can be had using this approach.
Hi,
thanks but I’m sorry I don’t know what to do now. I’m not yet very familiar with Servoy.
Here again may problem:
I press a button
within the logik of the button, I change field-properties
Example:
elements.cust_no_SearchField.bgcolor = “#aaaaaa”;
elements.cust_no_SearchField.readOnly = true;
elements.prospect_i_SearchField.bgcolor = “#FFF”;
elements.prospect_i_SearchField.readOnly = false;
elements.prospect_i_SearchField.requestFocus(true);
After that on iPAD & iPhone:
no objekt on the form has the focus.
the cursor is not visible
I want to achieve that the right field has the focus and the user can type.
If the answer to that was in the posts, I did not realize.
I want to achieve that the right field has the focus and the user can type.
If the answer to that was in the posts, I did not realize.
On mobile devices a touch event needs to fire to make this happen. requestFocus() doesn’t fire a touch event so this is why you see the different behavior between platforms.
I could tell you how to hack it in but using web client for mobile solutions is just a bad idea. Either use Servoy’s mobile client or some other front-end technology with Servoy as your backend.
Harro-DUS:
elements.prospect_i_SearchField.requestFocus(true);
I could tell you how to hack it in but using web client for mobile solutions is just a bad idea. Either use Servoy’s mobile client or some other front-end technology with Servoy as your backend.
Hello David,
when I started my project the mobile solutions did not exist and my SERVOY-consultants did not offer other technonolgies.
Overall my project does what it should do.
Just this behaviour ist not user friendly.
If possible I would like to set the Focus by program to a specific field after changing properties of text-boxes (ex: bgcolor)
I would appreciate if you could help me to solve this.
Kind regards Harro
When I use a statement like this:
elements.company_name.bgcolor = “#FFF”;
no object on the form has the focus.