添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

No, there is no native support for changing a text field’s readOnly property. This could be a good feature request for [email protected]

There are some easy workarounds you could try. You can achieve the same effect by toggling a text field’s enabled/disabled status. When a text field is disabled, it is read-only by definition. The only difference would be you couldn’t control the text field widget’s disabled look (gray background) but this may be better usability anyway as it provides visual feedback that text field is read-only.

Another approach would be to toggle the visibility of a hotspot (or bring to front / send to back) and then don’t do anything with the text field. So, place a hotspot widget over your text field (same dimensions or larger) to make it read only (if user tries to click on the text field, they will click on the hidden hotspot instead and nothing will happen. To enable text field editing, hide the hotspot. The text field will be untouched and look the same regardless of its fake “read-only-ness”. Or, you could style the text field any way you wish when the hotspot is visible (using the hotspot’s OnShow and OnHide events.)

If you really wanted to change the textFieldWidget.readOnly property, you could probably do this with some javascript injection --search for “javascript” and “change widget with javascript” in this forum.

Or fake it with a dynamic panel. In State2 switch the input field with a label, and bind it to the input field text so they match.

Demo: https://rhlcs5.axshare.com/#c=2
RP file: ReadOnly.rp (59.1 KB)

Ok, I didn’t think it was possible. My workaround involved using a second field that was disabled and switching them. The gray background of the disabled field is what was bothering me, and like you mentioned I had an alternate usability cue to show when it was enabled and disabled.

Thanks for the ideas.