-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support PostBack.Handlers in CompositeControls
PostBack.Handlers are copied onto the created controls, if they contain a matching command binding. * We map postback handlers onto the command bindings set on the CompositeControl by comparing the EventName and property name * For each control returned from GetContents, we enumerate its command bindings and compare them to the command bindings found on the CompositeControl. * If a matching command binding is found, we clone its postback handlers onto the child control. EventName is adjusted to match the new property name The control enumeration is done recursively before adding the control to Children, thus walking only through the tree created in this CompositeControl - nested CompositeControls, initialized Repeaters, ... are not included. In order to support templatws created in the CompositeControl, we recurse into CloneTemplates. For DelegateTemplate or any other more advanced needs, a protected CopyPostBackHandlersRecursive method is provided. resolves #1699
- Loading branch information
Showing
5 changed files
with
173 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Tests/ControlTests/testoutputs/CompositeControlTests.AutoclonedPostbackHandlers.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<html> | ||
<head></head> | ||
<body> | ||
|
||
<!-- command --> | ||
<div> | ||
<div data-bind="foreach: { data: List }"> | ||
<input onclick="dotvvm.postBack(this,["List/[$index]"],"IYZcgJXAUDcvRzk7","",ko.contextFor(this).$parentContext,[["confirm",{message:"Test not precompiled"}]],[],undefined).catch(dotvvm.log.logPostBackScriptError);event.stopPropagation();return false;" type="button" value="Item"> | ||
</div> | ||
<input onclick="dotvvm.postBack(this,[],"IYZcgJXAUDcvRzk7","",null,[["confirm",{message:"Test not precompiled"}]],[],undefined).catch(dotvvm.log.logPostBackScriptError);event.stopPropagation();return false;" type="button" value="Last Item"> | ||
</div> | ||
<div> | ||
<div data-bind="foreach: { data: List }"> | ||
<input onclick="dotvvm.postBack(this,["List/[$index]"],"/cYhsuIE/4DfszAC","",ko.contextFor(this).$parentContext,[["confirm",{message:"Test precompiled"}]],[],undefined).catch(dotvvm.log.logPostBackScriptError);event.stopPropagation();return false;" type="button" value="Item"> | ||
</div> | ||
<input onclick="dotvvm.postBack(this,[],"/cYhsuIE/4DfszAC","",null,[["confirm",{message:"Test precompiled"}]],[],undefined).catch(dotvvm.log.logPostBackScriptError);event.stopPropagation();return false;" type="button" value="Last Item"> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters