Menu

#154 reordering of getPostBackTarget in TPage

v2.0
open
nobody
5
2006-02-13
2006-02-13
No

This problem is in 2.0.3 as well as the current CVS
version.

If getPostBackTarget() is reordered to what is shown
below it fixes the following problem:

If you have a page with a TLinkButton and a TButton and
both transfer you to another page in their postback
functions; and you first click the TLinkButton, then
click back in the browser, then click the TButton; upon
clicking the TButton the postback function for the
TLinkButton fires instead of the TButton.

public function getPostBackTarget()
{
foreach(array_keys($this->postBackCandidates) as $name)
{
if(isset($_POST[$name]))
return $this->postBackCandidates[$name];
}

if(strlen($this->postBackTarget))
{

if(isset($this->postBackCandidates[$this->postBackTarget]))
return
$this->postBackCandidates[$this->postBackTarget];
}
return null;
}

Discussion


Log in to post a comment.