0
votes

I am trying to develop an interface that binds to a complex backend model. What I need is a way for scripting to enable me to have a page load different page fragments based on what list row a user clicks on. As an example, on the left side of the page there would be a vertical list displaying different sections in a large assessment 'document' (mental health assessment) (each section would be it's own data model [e.g. presenting problems family history, trauma history, etc...). In the main section of the page to the right, you would have room for a page fragment or some type of container that would contain the actual page or page fragments associated with each section listed in the list on the left. When you click on the section name in the list to the left, scripting would be able to have the correct page fragment or page loaded inside the container. The data model needs to be this complex because there are multiple types of "documents' and the system needs to be able to dynamically load a list of document sections and allow the user to load the form for each section type.

1
There would be multiple ways of getting this accomplished. I would consider having either a relation item or field associated with each item in your initial list and then having your form/pagefragment/separatepage or what ever show based on the list item click. For example: your first list item is supposed to bring up the form for family history, so have a relation to family history and in your list row onclick event have widget.root.PageFragments[widget.datasource.item.YourRelationItem].visible = true; The same would be true for different pages or just form widgets. - Markus Malessa
I had thought of this as well. In this situation, the document components would be different for each document type and even a specified document may change over time. I am trying to see if there were a way to not have the user interface be static so that it can accommodate ongoing changes to existing document types as well as provide for a user correctly accessing older document types that have been deprecated. For example, if I had a patient that came for services 3 years ago, their intake form may be different than the form developed for this year and I need to be able to access it. - Patrick Wood
My thought was that the visible/invisible approach might make the page become unwieldy over time? - Patrick Wood
The dynamic page content is definetely possible, however since it sounds like a lot of your items are going to be based on hard data, the models really are not dynamic, so you really can't build in dynamic data at run time for example. Rather than visible/invisible properties I might suggest navigating to different pages instead and maybe having many-to-many relations to your list item and if your list item has OldFamilyHistory and NewFamilyHistory data relations incorporate a popup to select which page you may want to navigate to. - Markus Malessa
@MarkusMalessa can something like you did for this question be done to add whole page fragments at runtime?: stackoverflow.com/q/54532079/11107802 - Patrick Wood

1 Answers

0
votes

THIS IS FROM Markus Malessa: The dynamic page content is definitely possible, however since it sounds like a lot of your items are going to be based on hard data, the models really are not dynamic, so you really can't build in dynamic data at run time for example. Rather than visible/invisible properties I might suggest navigating to different pages instead and maybe having many-to-many relations to your list item and if your list item has OldFamilyHistory and NewFamilyHistory data relations incorporate a popup to select which page you may want to navigate to.