This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 29, 2011, 12:55 PM
38 Posts

Re: Editbox - ReadOnly property

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: Xpages
  • Replies: 3
Finally I was able to create workaround for this problem.
 
Created a script block like this: 
 
<xp:scriptBlock id="scriptBlock1" type="text/javascript">
  <xp:this.value><![CDATA[function makeReadOnly() {
 document.getElementById("#{id:readOnlyFieldXPage}").readOnly = true;
}
window.onload = makeReadOnly;]]></xp:this.value> 
 
This basically makes the field readonly via javascript when the page loads.
 
But this question is still OPEN... Why is Domino rendering the readonly field as text??? Is this a bug???
Mar 29, 2011, 1:44 PM
39 Posts
Re: Editbox - ReadOnly property
Hi,
 
I know why your thinking it is wrong, but the problems is that when you set the readonly attribute on the <xp:inputText> control it does not just a pass through to the readonly attribute on an input control.....It works like you discovered, it changes the rendered html to a <span>  This is how it works inside of xpages, for instance if you have a form bound to an xpage and change from edit mode to read only it changes those from input's to span's  This is the way the control was coded to behave.  As you found you can always use client side javascript to change the readonly attribute if you need it changed.  I actually like the controls dual rendering functionality I think the span looks a lot nicer than an input box with a readonly attribute set to yes. Also you can style the two differently even though they are the same control without using css3 selectors.  You could create a new renderer for the control that would allow you have your read only attribute work like you want, but maybe overkill for what you are needing.
 
Thanks
-Toby
Mar 29, 2011, 4:21 PM
38 Posts
Re: Editbox - ReadOnly property
Thanks Toby for the explanation. Atleast now I know this is not possible via property.
 
But you should note the help popup for the readonly property - "Indicates whether or not this control will prohibit changes by the user. This control may receive focus unless it has also been disabled."
 
Now you know the source of my confusion...  :)

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal