How to target the viewModel when there is no pageForm object?
How is the viewModel object (or equivalent) accessed on these other pages?
For example the new Affected User form cannot be customized the way that any of the other forms are, unless the controls can be accessed. How would one work with this form? boundObj is also not available, that I can tell.
Edit: Thanks to a colleague I know how to interrogate a control for the view model it is bound to, but there does not seem to be one view model that all the controls on the page are bound to. Is that the real answer here, perhaps?
Best Answer
-
Nicholas_Velich Cireson Consultant Ninja IT Monkey ✭✭✭✭Hi Tom,
This will depend on the page. Not every page in the portal is intended/able to be so easily customized as the various form pages, especially when it comes to manipulating the "view model" behind the scenes.
Regarding the Affected User example you provided, that page is built using AngularJS, so the data you are interacting with on the form is stored in the AngularJS $scope variable. The data in $scope is eventually passed into an a service which determines the type of WI to create, sets the properties unique to that type of WI in the projection, and commits. The fields that are set in this service are currently fixed, so additional properties/relationships cannot be added at this time; however, you certainly could write something to modify the values in the existing fields on that page.
More info on how to access/modify the $scope variable in the browser console here: https://stackoverflow.com/questions/13743058/how-do-i-access-the-scope-variable-in-browsers-console-using-angularjs
Thanks,
Nick5
Answers
This will depend on the page. Not every page in the portal is intended/able to be so easily customized as the various form pages, especially when it comes to manipulating the "view model" behind the scenes.
Regarding the Affected User example you provided, that page is built using AngularJS, so the data you are interacting with on the form is stored in the AngularJS $scope variable. The data in $scope is eventually passed into an a service which determines the type of WI to create, sets the properties unique to that type of WI in the projection, and commits. The fields that are set in this service are currently fixed, so additional properties/relationships cannot be added at this time; however, you certainly could write something to modify the values in the existing fields on that page.
More info on how to access/modify the $scope variable in the browser console here: https://stackoverflow.com/questions/13743058/how-do-i-access-the-scope-variable-in-browsers-console-using-angularjs
Thanks,
Nick