Talk about add-ons and extension development.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 7th, 2009, 5:30 am
Posted November 7th, 2009, 5:30 am
Hi, when I add an "observes" attribute to a textbox it becomes read-only, meaning I can't edit it's input. The textbox resides in a preference window. - Code: Select all
<textbox id="antonpod-et-textbox" minwidth="300" change="antonpod.et.onChange(event);" observes="antonpod-et-emptybr"/>
Why is this happening and what's the way around this, if any? Tnx.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 7th, 2009, 3:50 pm
Posted November 7th, 2009, 3:50 pm
This is the broadcaster element: - Code: Select all
<broadcasterset> <broadcaster id="antonpod-et-enbr" disabled="false"/> <broadcaster id="antonpod-et-emptybr" disabled="false"/> </broadcasterset>
max1million
Posts: 2365Joined: November 15th, 2004, 5:03 am
November 8th, 2009, 7:01 am
Posted November 8th, 2009, 7:01 am
Try the oncommand, onclick or some such on the antonpod-et-emptybr to make the switch, may also need onload or onsynfrompreference to check antonpod-et-emptybr and set antonpod-et-textbox.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 8th, 2009, 9:59 am
Posted November 8th, 2009, 9:59 am
max1million wrote:Try the oncommand, onclick or some such on the antonpod-et-emptybr to make the switch, may also need onload or onsynfrompreference to check antonpod-et-emptybr and set antonpod-et-textbox.
I'm not sure I follow your solution... I use the broadcaster to automatically disable/enable multiple elements in a preference window, instead of changing the "disabled" attribute of each of them separately. Somehow this makes the textbox which listens to the broadcaster to be read-only, while I need it to be able to get input. May it be that the textbox shares some default "readonly" attribute of the broadcaster?
max1million
Posts: 2365Joined: November 15th, 2004, 5:03 am
November 9th, 2009, 1:25 am
Posted November 9th, 2009, 1:25 am
Change it separately, for that one.
May be with using observes on textbox the normal idea would be to observe a value rather then user input, dunno haven't done. Of course it should go without saying that if the element being broadcasted is disabled, since that is what is being broadcast, then so would be the textbox, and therefore readonly, since input would be disabled.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 9th, 2009, 3:29 am
Posted November 9th, 2009, 3:29 am
Change it separately, for that one.
This is always an option, yes. Of course it should go without saying that if the element being broadcasted is disabled, since that is what is being broadcast, then so would be the textbox, and therefore readonly, since input would be disabled.
Sure, in my case when the textbox is enabled I can't edit/copy it's current value.
max1million
Posts: 2365Joined: November 15th, 2004, 5:03 am
November 10th, 2009, 2:36 am
Posted November 10th, 2009, 2:36 am
OK just fiddled with it and it seems that as long as there is an attribute for disabled the property disabled is true.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 10th, 2009, 11:14 am
Posted November 10th, 2009, 11:14 am
max1million wrote:OK just fiddled with it and it seems that as long as there is an attribute for disabled the property disabled is true.
Disabled elements are grayed out, but here the textbox appears enabled. Should I just report a bug and see what people are saying?
fcp
Posts: 31Joined: August 15th, 2009, 12:31 pm
November 10th, 2009, 12:25 pm
Posted November 10th, 2009, 12:25 pm
anton1981 wrote:when I add an "observes" attribute to a textbox it becomes read-only, meaning I can't edit it's input.
Are you trying to observe the “value” attribute? If so, you may have run into bug 183776. Actually, setting the value attribute (instead of the value property) of a textbox seems currently problematic no matter whether you set it via a broadcaster or directly; see bugs 184732 and 277892.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 10th, 2009, 1:09 pm
Posted November 10th, 2009, 1:09 pm
Are you trying to observe the “value” attribute?
No, just the the "disabled" attribute.
fcp
Posts: 31Joined: August 15th, 2009, 12:31 pm
November 10th, 2009, 3:28 pm
Posted November 10th, 2009, 3:28 pm
anton1981 wrote:Are you trying to observe the “value” attribute?
No, just the the "disabled" attribute.
Then see bug 174492, which is Wontfix. I am afraid that the only way to avoid the problem is giving up using the broadcaster.
anton1981
Posts: 23Joined: September 20th, 2008, 6:00 pm
November 11th, 2009, 4:07 am
Posted November 11th, 2009, 4:07 am
Then see bug 174492, which is Wontfix. I am afraid that the only way to avoid the problem is giving up using the broadcaster.
fcp, thanks for the info.
Return to Extension Development
Who is online
Users browsing this forum: chris22 and 3 guests
|