[Engine-devel] webadmin: How to make a text box readonly.

Hi, I am trying to populate a text box (EntityModelTextBoxOnlyEditor) with a default value that is read only (can't be changed by user). Can someone help me with how I can do that? Thanks Sharad Mishra

Hi, If you have a corresponding EnityModel for that Editor, you could use entityModel.setIsChangable(false). Now the textbox will be grayed out and the user will not be able to edit the value. For setting a default value, you can use entityModel.setEntity("XYZ"). Thanks, Kanagaraj On 02/05/2013 12:42 AM, snmishra@linux.vnet.ibm.com wrote:
Hi,
I am trying to populate a text box (EntityModelTextBoxOnlyEditor) with a default value that is read only (can't be changed by user). Can someone help me with how I can do that?
Thanks Sharad Mishra
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Kanagaraj" <kmayilsa@redhat.com> To: snmishra@linux.vnet.ibm.com Cc: ovedo@redhat.com, engine-devel@ovirt.org Sent: Tuesday, February 5, 2013 6:36:28 AM Subject: Re: [Engine-devel] webadmin: How to make a text box readonly.
Hi,
If you have a corresponding EnityModel for that Editor, you could use entityModel.setIsChangable(false). Now the textbox will be grayed out and the user will not be able to edit the value. For setting a default value, you can use entityModel.setEntity("XYZ").
Thanks, Kanagaraj
On 02/05/2013 12:42 AM, snmishra@linux.vnet.ibm.com wrote:
Hi,
I am trying to populate a text box (EntityModelTextBoxOnlyEditor) with a default value that is read only (can't be changed by user). Can someone help me with how I can do that?
For a read-only text editor you can also use EntityModelLabelEditor.
Thanks Sharad Mishra
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message ----- From: "Daniel Erez" <derez@redhat.com> To: snmishra@linux.vnet.ibm.com Cc: ovedo@redhat.com, engine-devel@ovirt.org Sent: Tuesday, February 5, 2013 7:55:31 AM Subject: Re: [Engine-devel] webadmin: How to make a text box readonly. ----- Original Message -----
From: "Kanagaraj" <kmayilsa@redhat.com> To: snmishra@linux.vnet.ibm.com Cc: ovedo@redhat.com, engine-devel@ovirt.org Sent: Tuesday, February 5, 2013 6:36:28 AM Subject: Re: [Engine-devel] webadmin: How to make a text box readonly.
Hi,
If you have a corresponding EnityModel for that Editor, you could use entityModel.setIsChangable(false). Now the textbox will be grayed out and the user will not be able to edit the value. For setting a default value, you can use entityModel.setEntity("XYZ").
Or if you do not have the corresponding EntityModel, you can use yourEntityModelTextBoxOnlyEditorInstance.setEnabled(false) and set the value as yourEntityModelTextBoxOnlyEditorInstance.asEditor().getSubEditor().setValue("") Tomas
Thanks, Kanagaraj
On 02/05/2013 12:42 AM, snmishra@linux.vnet.ibm.com wrote:
Hi,
I am trying to populate a text box (EntityModelTextBoxOnlyEditor) with a default value that is read only (can't be changed by user). Can someone help me with how I can do that?
For a read-only text editor you can also use EntityModelLabelEditor.
Thanks Sharad Mishra
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
participants (4)
-
Daniel Erez
-
Kanagaraj
-
snmishraï¼ linux.vnet.ibm.com
-
Tomas Jelinek