diff --git a/src/Tests/ControlTests/DataPagerTests.cs b/src/Tests/ControlTests/DataPagerTests.cs index eded24ff8..da1cba7fb 100644 --- a/src/Tests/ControlTests/DataPagerTests.cs +++ b/src/Tests/ControlTests/DataPagerTests.cs @@ -78,21 +78,6 @@ public async Task StaticCommandApendablePager() ); check.CheckString(r.FormattedHtml, fileExtension: "html"); - - var commandExpressions = r.Commands - .Select(c => (c.control, c.command, str: c.command.GetProperty().Expression.ToCSharpString().Trim().TrimEnd(';'))) - .OrderBy(c => c.str) - .ToArray(); - check.CheckLines(commandExpressions.GroupBy(c => c.command).Select(c => c.First().str), checkName: "command-bindings", fileExtension: "txt"); - - var nextPage = commandExpressions.Single(c => c.str.Contains(".GoToNextPage()")); - var prevPage = commandExpressions.Single(c => c.str.Contains(".GoToPreviousPage()")); - var firstPage = commandExpressions.Single(c => c.str.Contains(".GoToFirstPage()")); - var lastPage = commandExpressions.Single(c => c.str.Contains(".GoToLastPage()")); - - await r.RunCommand((CommandBindingExpression)nextPage.command, nextPage.control); - Assert.AreEqual(1, (int)r.ViewModel.Customers.PagingOptions.PageIndex); - } public class GridViewModel: DotvvmViewModelBase diff --git a/src/Tests/ControlTests/testoutputs/DataPagerTests.StaticCommandApendablePager.html b/src/Tests/ControlTests/testoutputs/DataPagerTests.StaticCommandApendablePager.html index 0dec86104..8a9290a44 100644 --- a/src/Tests/ControlTests/testoutputs/DataPagerTests.StaticCommandApendablePager.html +++ b/src/Tests/ControlTests/testoutputs/DataPagerTests.StaticCommandApendablePager.html @@ -1,25 +1,25 @@ -
(dotvvm.applyPostbackHandlers(async (options) => { let cx = $context; return await dotvvm.dataSet.loadDataSet(options.viewModel.Customers, (options) => dotvvm.dataSet.translations.PagingOptions.goToNextPage(ko.unwrap(options).PagingOptions), ((...args)=>(dotvvm.applyPostbackHandlers(async (options) => await dotvvm.staticCommandPostback("WARNING/NOT/ENCRYPTED+++WyJEb3RWVk0uRnJhbWV3b3JrLlRlc3RzLkNvbnRyb2xUZXN0cy5EYXRhUGFnZXJUZXN0cytHcmlkVmlld01vZGVsLCBEb3RWVk0uRnJhbWV3b3JrLlRlc3RzIiwiTG9hZEN1c3RvbWVycyIsW10sMSxudWxsLCJBQT09Il0=", [args[0]], options),$element,[],args,$context))), dotvvm.dataSet.postProcessors.append); },$element,[],args,$context)), -postProcessor: dotvvm.dataSet.postProcessors.append +autoLoadWhenInViewport: false }"> - +
+ + + end -
- end -
diff --git a/src/Tests/Runtime/config-tests/ConfigurationSerializationTests.SerializeDefaultConfig.json b/src/Tests/Runtime/config-tests/ConfigurationSerializationTests.SerializeDefaultConfig.json index cd07e69fb..ecc1ad642 100644 --- a/src/Tests/Runtime/config-tests/ConfigurationSerializationTests.SerializeDefaultConfig.json +++ b/src/Tests/Runtime/config-tests/ConfigurationSerializationTests.SerializeDefaultConfig.json @@ -378,6 +378,19 @@ "required": true, "onlyBindings": true }, + "LoadingTemplate": { + "type": "DotVVM.Framework.Controls.ITemplate, DotVVM.Framework", + "dataContextChange": [ + { + "$type": "DotVVM.Framework.Binding.HelperNamespace.DataPagerApi+AddParameterDataContextChangeAttribute, DotVVM.Framework", + "Name": "_dataPager", + "NestDataContext": false, + "TypeId": "DotVVM.Framework.Binding.HelperNamespace.DataPagerApi+AddParameterDataContextChangeAttribute, DotVVM.Framework" + } + ], + "mappingMode": "InnerElement", + "onlyHardcoded": true + }, "LoadTemplate": { "type": "DotVVM.Framework.Controls.ITemplate, DotVVM.Framework", "dataContextChange": [