Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brian Jamieson
Disabled field does not pass on it's value.
May 29, 2011 8:27 AM
Answer

Brian Jamieson

Rank: Junior Member

Posts: 51

Join Date: October 15, 2010

Recent Posts

Hi,

I have a process that updates a visible, but disabled field programmatically. When the form is submitted, the new value is not persisted.
Has anyone else seen this behaviour ?

1<aui:input name="entryRecoveryNote" id="entryRecoveryNote" size="45"
2    value="<%= phoneBook.getEntryRecoveryNote() %>"
3    disabled="true" style="color:red;" />

1document.getElementById("<portlet:namespace />entryRecoveryNote").value = "Blah Blah Blah"


I think I'll change it to be something like demo.append('<div>You clicked ' + this.get('label')+'</div>'); but the behaviour is not what I expected.
Hitoshi Ozawa
RE: Disabled field does not pass on it's value.
May 29, 2011 3:01 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I think you really want to make it a "readonly" field instead of "disabled. Unfortunately, I don't think aui supports "readonly".
Maybe, create an improvement request in the LPS?
Tejas patel
RE: Disabled field does not pass on it's value.
February 20, 2013 4:52 AM
Answer

Tejas patel

Rank: Junior Member

Posts: 71

Join Date: January 23, 2012

Recent Posts

Brian Jamieson:
Hi,

I have a process that updates a visible, but disabled field programmatically. When the form is submitted, the new value is not persisted.
Has anyone else seen this behaviour ?

1<aui:input name="entryRecoveryNote" id="entryRecoveryNote" size="45"
2    value="<%= phoneBook.getEntryRecoveryNote() %>"
3    disabled="true" style="color:red;" />

1document.getElementById("<portlet:namespace />entryRecoveryNote").value = "Blah Blah Blah"


I think I'll change it to be something like demo.append('<div>You clicked ' + this.get('label')+'</div>'); but the behaviour is not what I expected.



You have to check that if the value you get is null or blank then do not change it.
ex
IN JSP page
1
2<aui:input label="xyz" name="xyz" type="text"
3                value="xyz"disabled="true" />


And in Controller (JAVA)
1
2String str = ParamUtil.getString(actionRequest, "xyz", "");
3if (!(str.equals("")))
4        {
5            //set new value here
6        }else{
7           //leave old value as is
8}