Hi,
I need text-input component that has default style but it would be in readonly mode. Currently binding readonly="true()" to xsd:string element causes it to render as disabled where text is hardly readable and text isn't selectable for copy-pasting. I'm not sure if this is what xforms standard defines but I assumed readonly with xforms:input works as it works with xhtml:input. I can change text color with css but it's still not selectable for copy-pasting. |
Administrator
|
When the control is read-only, in the HTML seen by the browser there will be a disabled="" on the HTML input. This is by design. What do you mean by "I assumed readonly with xforms:input works as it works with xhtml:input"? I looks you are expecting a different behavior. Could you clarify? Alex |
Thanks, I was expecting a bit diffrent behavior.
I assumed that xforms:input looks the same on both cases: readonly or not. I assumed that only difference would have been that user cannot modify it's value. Now setting readonly sets it's value color grey (can be fixed with css easily) and disables possibility to select text for copy-pasting. If you set xhtml:input to readonly, it doesn't disable it. You can still select it's value.
|
Administrator
|
I understand. That's a tricky one. I think that the reason we chose to generate a disabled="" instead of readonly="" is that it provides a clear indication to the end user that the control can't be edited. When using readonly="" it looks as if the control can be edited, and you only realize it can't be edited when you actually try to modify it. But like you said, the downside of disabled="" is that you can't select the text. Would it make sense for you to use a xforms:output in this case? Alex |
Thanks, I'll use xforms:output.
|
Free forum by Nabble | Edit this page |