0

Apparently inconsistent behaviour on buttons targeted by autodisable attributes

asked 2011-04-28 10:29:45 +0800

cvarona gravatar image cvarona
554 1 6

updated 2011-04-28 10:30:09 +0800

Hi there,

I've noticed that buttons which are the target of an autodisable attribute inconsistently report a 'disabled' state after being enabled as a result of the execution of the automatic disabling-enabling if they were initially disabled:

<vbox>
	<button id="a" label="a - Initially disabled" disabled="true" onClick='alert( "Klikk!" )' />
	<button id="b" label="b- Klikk" autodisable="self,a" />
        <button label="Is 'a' actually disabled?" onClick='alert("" + a.isDisabled() )' />
</vbox>

After clicking on button 'b', 'a' will be no longer disabled. It will however report being so when questioned via the isDisabled() method.

I'm not sure whether this is done so on purpose or it's a bug. I would anyway like to point out that the autodisable feature, great as it is per se, loses much of its convenience if if fails to restitute the temporarily disabled buttons into their original state.

With kind regards

César Varona

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2011-04-28 11:57:42 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Hi,

I've slightly modified your code and it works as expected:

<vbox>
	<button id="a" label="a - Initially disabled" disabled="true" autodisable="true" onClick='alert( "Klikk!" )' />
	<button id="b" label="b- Klikk" autodisable="true" onClick='alert( "Klikk!" )'  />
        <button label="Is 'a' actually disabled?" onClick='alert("" + a.isDisabled() )' />
</vbox>

Or did I miss something?

Cheers, Maik

link publish delete flag offensive edit

answered 2011-04-29 02:46:29 +0800

cvarona gravatar image cvarona
554 1 6

Well, with your modification the 'a' button actually works as expected, but the 'autodisable' feature does not work at all (it's not a boolean value that must be specified but the ids of the components to be automatically disabled upon click).

With kind regards

César Varona

link publish delete flag offensive edit

answered 2011-04-29 03:06:32 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Yes, you're right, good to learn something new from a mistake...:-)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-04-28 10:29:45 +0800

Seen: 228 times

Last updated: Apr 29 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More