File tree Expand file tree Collapse file tree 3 files changed +20
-12
lines changed
Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 66using System . Threading . Tasks ;
77using DotVVM . Framework . Hosting ;
88using DotVVM . Framework . Routing ;
9+ using DotVVM . Framework . ViewModel ;
910
1011namespace DotVVM . Samples . BasicSamples . ViewModels
1112{
1213 public class DefaultViewModel : SamplesViewModel
1314 {
1415 public string Title { get ; set ; }
16+
17+ [ Bind ( Direction . None ) ]
1518 public List < RouteData > Routes { get ; set ; }
1619
1720 public override Task Init ( )
Original file line number Diff line number Diff line change 99 color: maroon;
1010 text-decoration: line-through;
1111 }
12+ .alt-row {
13+ background-color: #FFFFBB;
14+ }
1215 </style>
13- <dot:RequiredResource Name="globalize:cs-CZ" />
1416</head>
1517<body>
1618 <div class="container">
1719 <h1>Task List</h1>
1820
21+ <form>
1922 <fieldset data-testattribute>
2023 <legend>Add Task</legend>
2124
22- <p>Title: <dot:TextBox Text=" {value: NewTaskTitle}" /></p>
23- <p><dot:Button Text="Create" Click=" {command: AddTask()}" /></p>
25+ <p>Title: <dot:TextBox Text={value: NewTaskTitle} /></p>
26+ <p><dot:Button Text="Create" Click={command: AddTask()} IsSubmitButton /></p>
2427 </fieldset>
28+ </form>
29+
2530 <p> </p>
2631
2732 <table class="table">
28- <dot:Repeater DataSource="{value : Tasks}" WrapperTagName="tbody" RenderSettings.Mode="Server" PostBack.Update="true" >
29- <tr class="{value : IsCompleted ? ' completed' : '' }">
30- <td>{{value : Title}}</td>
33+ <dot:Repeater DataSource={resource : Tasks} WrapperTagName="tbody" PostBack.Update>
34+ <tr class-completed={resource : IsCompleted} Class-alt-row="{resource: _collection.IsEven }">
35+ <td>{{resource : Title}}</td>
3136 <td>
3237 <dot:LinkButton Text="done"
33- Click=" {command: _parent.CompleteTask(TaskId)}"
34- Visible="{value : !IsCompleted}" />
38+ Click={command: _parent.CompleteTask(TaskId)}
39+ Visible={resource : !IsCompleted} />
3540 </td>
3641 </tr>
3742 </dot:Repeater>
3843 </table>
3944 </div>
4045
4146</body>
42- </html>
47+ </html>
Original file line number Diff line number Diff line change 22@masterPage Views/Samples.dotmaster
33
44<dot:Content ContentPlaceHolderID="Main">
5- <dot:Repeater WrapperTagName="ul" DataSource={value : Routes }>
6- <li><a href={value : Url}>{{value : RouteName}}</a></li>
5+ <dot:Repeater WrapperTagName="ul" DataSource={resource : Routes }>
6+ <li><a href={resource : Url}>{{resource : RouteName}}</a></li>
77 </dot:Repeater>
8- <div>Number of Tests: {{value : Routes.Count}}</div>
8+ <div>Number of Tests: {{resource : Routes.Count}}</div>
99</dot:Content>
You can’t perform that action at this time.
0 commit comments