-
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.
Repro for postback handler binding translation issue
- Loading branch information
1 parent
0df5117
commit 468a7ce
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Samples/Common/ViewModels/FeatureSamples/PostBack/PostBackHandlerBindingViewModel.cs
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,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DotVVM.Framework.ViewModel; | ||
using DotVVM.Framework.Hosting; | ||
|
||
namespace DotVVM.Samples.Common.ViewModels.FeatureSamples.PostBack | ||
{ | ||
public class PostBackHandlerBindingViewModel : DotvvmViewModelBase | ||
{ | ||
public bool Enabled { get; set; } = false; | ||
|
||
public int Counter { get; set; } = 0; | ||
|
||
public string[] Items { get; set; } = new string[] { "Item 1", "Item 2", "Item 3" }; | ||
} | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
src/Samples/Common/Views/FeatureSamples/PostBack/PostBackHandlerBinding.dothtml
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,35 @@ | ||
@viewModel DotVVM.Samples.Common.ViewModels.FeatureSamples.PostBack.PostBackHandlerBindingViewModel, DotVVM.Samples.Common | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
</head> | ||
<body> | ||
|
||
<p> | ||
<dot:CheckBox Text="Suppress postbacks" Checked="{value: Enabled}" /> | ||
</p> | ||
<p>Counter: {{value: Counter}}</p> | ||
|
||
<p>Click on grid rows to increment the counter.</p> | ||
|
||
<dot:GridView DataSource="{value: Items}"> | ||
<Columns> | ||
<dot:GridViewTextColumn HeaderText="Column 1" ValueBinding="{value: _this}" /> | ||
</Columns> | ||
<RowDecorators> | ||
<dot:Decorator Events.Click="{command: _parent.Counter = _parent.Counter + 1}" style="cursor: pointer"> | ||
<PostBack.Handlers> | ||
<dot:SuppressPostBackHandler Suppress="{value: _parent.Enabled}" /> | ||
</PostBack.Handlers> | ||
</dot:Decorator> | ||
</RowDecorators> | ||
</dot:GridView> | ||
|
||
</body> | ||
</html> | ||
|
||
|