Hello,
I'm wondering about how to set the caret position in TextItem fields, or selection a range of characters in fields.
Should this be done by writing direct javascript code?
Case where I fell over this is this:
a TextItem with a FocusHandler does something with setValue. But when this event has been done handling, the caret is moved back to the start from the input text. Whereas when a user clicks on the form item, the caret is usually set at the end, so I would like to set it at the end as well.
Business case is fields with a unit e.g. "20 Km", when the user edits the field, he should only be able to change the "20", and when editing is done, the "Km" text should be put back after. With approach from above, user clicks in the field, "Km" goes away, but caret is set at front of the "20".
regards,
I'm wondering about how to set the caret position in TextItem fields, or selection a range of characters in fields.
Should this be done by writing direct javascript code?
Case where I fell over this is this:
a TextItem with a FocusHandler does something with setValue. But when this event has been done handling, the caret is moved back to the start from the input text. Whereas when a user clicks on the form item, the caret is usually set at the end, so I would like to set it at the end as well.
Business case is fields with a unit e.g. "20 Km", when the user edits the field, he should only be able to change the "20", and when editing is done, the "Km" text should be put back after. With approach from above, user clicks in the field, "Km" goes away, but caret is set at front of the "20".
regards,
Comment