Ticket #622 (closed defect: fixed)

Opened 17 months ago

Last modified 6 months ago

Changing Display-attribute of a TActiveCheckBox dynamically isn't possible

Reported by: mata_svada Owned by: xue
Priority: urgent Milestone: 3.1.2
Component: Prado Framework v3 Version: 3.1
Severity: minor Keywords:
Cc:

Description

It's impossible to change Display for a TActiveCheckBox from None to Dynamic dynamically (tested in Konqueror and Firefox). It works when JavaScript? is disabled.

Change History

Changed 16 months ago by xue

  • milestone set to 3.1.0

Changed 16 months ago by xue

  • milestone changed from 3.1.0 to 3.1.1

Changed 14 months ago by carl

Confirmed. This also occurs on TActiveRadioButton. Works like a charm with TActiveLinkButton, because the display property is set on the link button tag itself, while TActiveRadioButton and TActiveLinkButton has a span tag surrounding it's input and label tag. It is this span tag that needs to be altered.

Changed 13 months ago by xue

  • milestone changed from 3.1.1 to 3.1.2

Changed 6 months ago by mikl

  • owner changed from xue to mikl
  • status changed from new to assigned

One problem is that the span tag doesn't have an id. That's easy to fix. The bigger problem is that the span tag is not always generated. This leads to a whole bunch of problems. For example all of TCallbackClientScript's handy methods like hide(), pulsate(), etc. will not work on the control if it doesn't have a span tag.

But there's no way now to find out before render() if the control will have a surrounding span tag. Prado hides this decision from the programmer. I think the only way to fix this is to always create the surrounding tag. The situation would become more predictible and the programmer would not be suprised about "randomly" generated tags.

Changed 6 months ago by mikl

  • owner changed from mikl to xue
  • status changed from assigned to new

Changed 6 months ago by mikl

My suggestion on how to solve this: As mentioned above put TCheckBox into a well defined state and always render the span tag incl. id. Moreover we could define another interface:

interface IControlContainer 
{
   public function getContainerClientID();
}

TCheckBox and TRadioButton would implement this interface. In TCallbackClientScript we check if the current control implements this interface and then can decide whats the right HTML element id for the requested action. (pulsate() would affect container span, check() would affect the input control itself, etc...).

We would have a minor break in bc but would gain a stable and predictible behaviour of T(Active)Checkbox/RadioButton.

Changed 6 months ago by mikl

  • status changed from new to closed
  • resolution set to fixed

Fixed in [2424].

Note: See TracTickets for help on using tickets.