Ticket #11 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

registerRequiresPostBack

Reported by: xue Owned by: xue
Priority: major Milestone: 3.0beta
Component: Prado Framework v3 Version:
Severity: Keywords:
Cc:

Description (last modified by xue) (diff)

Currently, if a control wants to use postback functionality, it has to use the following lines, sometimes with a few inline javascript code (such as Event.stop(e);),

$options = $this->getAutoPostBackOptions();
$scripts = $page->getClientScript();
$postback = $scripts->getPostBackEventReference($this,'',$options,false);
$scripts->registerClientEvent($this, "click", $postback);

I suggest we eliminate the inline javascript code and simplify the above lines into the following line only,

$this->getPage()->registerRequiresPostBack($this->getPostBackOptions());

To do so, TPostBackOptions need a few more properties, including EventTarget, EventParameter, and EventName.

Change History

Changed 3 years ago by xue

  • description modified (diff)

Changed 3 years ago by xue

  • milestone changed from Version 3.0 alpha release to Version 3.0 beta release

Changed 3 years ago by wei

This has been changed to

$this->getPage()->getClientScript()->registerPostBackControl($this);

registerPostBackControl(TControl $control, $namespace="Prado.WebUI") {

//assume all postback enabled control has getPostBackOptions (may be define an interface) $options = $control->getPostBackOptions();

}

Changed 3 years ago by wei

Also, make getPostBackOptions return array instead of TPostBackOptions unless the later are used else where.

Changed 3 years ago by xue

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.