{"action":"created","issue":{"url":"https://api.github.com/repos/riganti/dotvvm/issues/142","labels_url":"https://api.github.com/repos/riganti/dotvvm/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/riganti/dotvvm/issues/142/comments","events_url":"https://api.github.com/repos/riganti/dotvvm/issues/142/events","html_url":"https://github.com/riganti/dotvvm/issues/142","id":124389909,"number":142,"title":"Determine whether the postback is currently running in a bindings","user":{"login":"tomasherceg","id":5599524,"avatar_url":"https://avatars.githubusercontent.com/u/5599524?v=3","gravatar_id":"","url":"https://api.github.com/users/tomasherceg","html_url":"https://github.com/tomasherceg","followers_url":"https://api.github.com/users/tomasherceg/followers","following_url":"https://api.github.com/users/tomasherceg/following{/other_user}","gists_url":"https://api.github.com/users/tomasherceg/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasherceg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasherceg/subscriptions","organizations_url":"https://api.github.com/users/tomasherceg/orgs","repos_url":"https://api.github.com/users/tomasherceg/repos","events_url":"https://api.github.com/users/tomasherceg/events{/privacy}","received_events_url":"https://api.github.com/users/tomasherceg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/riganti/dotvvm/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/riganti/dotvvm/labels/Framework","name":"Framework","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/riganti/dotvvm/milestones/5","html_url":"https://github.com/riganti/dotvvm/milestones/Version%201.0","labels_url":"https://api.github.com/repos/riganti/dotvvm/milestones/5/labels","id":1236141,"number":5,"title":"Version 1.0","description":"","creator":{"login":"tomasherceg","id":5599524,"avatar_url":"https://avatars.githubusercontent.com/u/5599524?v=3","gravatar_id":"","url":"https://api.github.com/users/tomasherceg","html_url":"https://github.com/tomasherceg","followers_url":"https://api.github.com/users/tomasherceg/followers","following_url":"https://api.github.com/users/tomasherceg/following{/other_user}","gists_url":"https://api.github.com/users/tomasherceg/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasherceg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasherceg/subscriptions","organizations_url":"https://api.github.com/users/tomasherceg/orgs","repos_url":"https://api.github.com/users/tomasherceg/repos","events_url":"https://api.github.com/users/tomasherceg/events{/privacy}","received_events_url":"https://api.github.com/users/tomasherceg/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":3,"state":"open","created_at":"2015-08-01T12:59:59Z","updated_at":"2016-01-02T12:22:57Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-12-30T19:26:54Z","updated_at":"2016-01-02T12:37:03Z","closed_at":null,"body":"When using the FileUpload control, it may take several seconds for the server to process the uploaded files. However the IsBusy property of the UploadedFilesCollection is true only when the files are uploading on the server and not when the UploadCompleted postback is running.\r\n\r\nIt would be useful to create some generic mechanism for binidings to be able to determine whether specific postback is running. \r\n\r\nWhat about adding a PostbackStatusHandler postback handler which would set some viewmodel property to true before the postback and set the value back to false after the postback.\r\n\r\nSomething like this:\r\n\r\n    <dot:FileUpload Files=\"{value: Files}\" UploadCompleted=\"{command: ProcessFiles()}\">\r\n        <PostBack.Handlers>\r\n            <dot:PostbackStatusHandler IsPostbackRunning=\"{value: IsProcessing}\" />\r\n        </PostBack.Handlers>\r\n    </dot:FileUpload>\r\n    <div class=\"loading\" Visible=\"{value: Files.IsBusy || IsProcessing}\">Uploading</div>\r\n\r\nThe advantage of this mechanism is that the postback handlers can already specify which event they are associated with and the only thing we have to implement would be the handler itself and some thing that would allow to specify a callback for a particular postback."},"comment":{"url":"https://api.github.com/repos/riganti/dotvvm/issues/comments/168387211","html_url":"https://github.com/riganti/dotvvm/issues/142#issuecomment-168387211","issue_url":"https://api.github.com/repos/riganti/dotvvm/issues/142","id":168387211,"user":{"login":"exyi","id":7894687,"avatar_url":"https://avatars.githubusercontent.com/u/7894687?v=3","gravatar_id":"","url":"https://api.github.com/users/exyi","html_url":"https://github.com/exyi","followers_url":"https://api.github.com/users/exyi/followers","following_url":"https://api.github.com/users/exyi/following{/other_user}","gists_url":"https://api.github.com/users/exyi/gists{/gist_id}","starred_url":"https://api.github.com/users/exyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exyi/subscriptions","organizations_url":"https://api.github.com/users/exyi/orgs","repos_url":"https://api.github.com/users/exyi/repos","events_url":"https://api.github.com/users/exyi/events{/privacy}","received_events_url":"https://api.github.com/users/exyi/received_events","type":"User","site_admin":false},"created_at":"2016-01-02T12:37:03Z","updated_at":"2016-01-02T12:37:03Z","body":"I'm not against the postback handler, this is quite cool use case for it. However there may be more use cases for evaluating client-side functions. We can just create static class and import it by default to bindings - it'll look like `{value: Dotvvm.IsPostbackRunning}`, another property could be `{value: Browser.WindowWidth}` or {value: Dotvvm.LastPostbackErrorMessage}."}}