Hi All, In the app I am developing, I have a profile button that I have included in the Master view and so all other views can see it. However, when profile changes, the active view should be refreshed to run HTTPClients and read the relevant data for the new profile selected. So the problem is that ReloadView does not perform as I expected and throw errors. I don't think it has any thing to do with the usage of Master view as even when I put the drop down directly to the page still this do not perform properly and errors like this appear in all pages.
Without the reload view things are all good!On the side note, is there any way to define more than one master view? at help it refers to them as Masterviews but I could not find how to define more than one of them.Thanks in advance for your help.Regards,Amin
Hello Amin,
Certainly, the error is clear (this time): we try to access to an "Hidden" propery of an variable which is not the expected one, because is undefined or null. I think that the problem is caused with the ReloadView action, because, this is an little special action, that must be use with caution.
So what happen? In fact, the ReloadView action causes that the entire app is are loaded again. This behaviour (which is the expected, on the other hand), can cause problems like you describe, Amin. The solution, in your cause, may it's try to avoid the ReloadView usage.
Please, try it and don't hesitate to post here if you think that I can help in something.
About the various master views... certainly something like that is not possible. It's an interesting concept, and I will try to take a look at that. Maybe I can add something like that, must be study when possible and look for some possible way to do it.
Of course, depending on what you wanted, maybe we can also find another possible approach too, so, if you think that can detail a little more exactly what you wanted... maybe I can help in something.
Hi David,
Thanks for the speedy reply as always.
First off, re. the reload view: okay I understand the problem now! all the queries are password protected and if it reloads the whole app then the tokens are lost, the variables including them are blank and nothing will work! About what I want to do, in the 'database example', user can keep, read and modify his/her notes. What if there are more than one subject for the notes. There is a dropdown that user can select the subject of the note and reads, modifies all the notes relevant to the selected subject. In such a design we would need to reload the reports/tables each time the subject changes, otherwise even though the subject has been changes reports will continue displaying the previous notes. We can manually reload by click back and come back to the page but it is indeed not the way to go :). There are proper "HttpSetData" lines at the root of each view to call the right notes for the selected subject and load it to the reports but the key question is that how can I refresh only the view in which the subject has been changed? Ideally if I could read the name of the active view and "ReplaceView" would work to call the same view, it would refresh the page and problem was solved. Any idea how I can achieve that?
Re. more than one MasterView. The point is that, there are several items that we repeat some of them in some of pages and some other in some other pages. So if we put all in master view, there is no way to say show which element at which view and not at the others. I work with a professional graphic designer on this project, and when he saw that he said that Adobe Indesign (If I am correct) can define several 'masters' and you can choose which master to be called at which pages. In fact it allows you to say which items appear to the front and which ones to the back as well, so for instance if you have a background for all pages that should stay to the back and a button which should come to the front, it is still achievable like this. But any how it was just a thought, if we have it, it is fantastic but it is nice that we have Master view in general.
Talking about improvements, Appbuilder is a great app and has improved our development speed considerably yet there are some bugs that if fixed will help a lot. "undo" in app builder acts very strangely, if you accidentally move an element and then undo, it will not return the object to where it was and instead will undo something else, same applied to cut. So we totally avoid ctrl+z because it will not undo the last action and we can not predict what will happen if we use it. Also it lacks grouping objects, so for instance if we could group a number of buttons, each time we accidentally move one we would not need to align them all once again and in the long run it would save a lot of time.
Thanks for the great app and fantastic support David!
Amin
Hello Amin,
About the first issue, I don't think that you need to reload the view at all. In other words, if you want to perform another HTTP call or just play with the Report's Data variable, the Report control must reflect the changes. In my opinion you must not deal with the view load or reload, but, just made the right HTTP calls or change the Report's Data variable when needed. You can do it in the same view various times without problems. So you can change the subject that you need to "query", and then perform the right HTTP call to feed the Report's Data variable with the new data.
About the Master view, certainly, there is just one right now. Can be useful, but, if we use it "as is", expecting that all the controls placed in the Master view are placed in all the views in which the Master view is used. I want to think around this, Amin, since another customers told me about this before too. I am not quite sure about how I can implement it, nor when I have the required time to put my hands on, so I can't promise nothing, but I will try.
About the Undo, I think you refer to the designer Undo, not the code editor Undo. The code editor Undo and Redo works more or less as expected in an common code editor. The designer Undo don't work like that, Amin. They try to be useful, but, certainly not all the times we get the same results that we can expect in an code editor, in fact, we only have an Undo in the designer, and not an Redo. Something else to be improved when possible, yes.
Please, try to modify the Report's Data variable by made HTTP calls (to receive the data to place in the Data variable) or just to change the Data variable (which is an Array variable after all), in one word, try to do what you wanted forgetting the "reload" of the view. You must look in this way... and then please, post here if you need some particular help or something else about this question. I will try to help you when possible!
Hello Amin,
Maybe I can explain a bit more about the "reload" view... the point is that, maybe, in the Database sample, you see the HTTP call in the Show event of the views... but this is just the way in which someone (me) decide to construct the Database sample.
What matter here is that the HTTP call to feed the Report's Data variables can be executed in any time, not only in the Show event of the views, or when the view is loaded. We can made any HTTP call, any time we need and without reload any view.
Sure David, I understand that and I know I can call the HttpClients by other events and not just the show. The point is that I have near 20 Https clients, in 8 views. Refreshing the view, or triggering view's show event, by dropdown itemclick event, could simply fix the problem. Now I need to go page by page and call each HttpClient at its own view. Tried to bypass it but seems like there is no escape from reproducing it all.
Out of curiosity now, is it possible to read what view is active? So lets say if I keep the button in the MasterView is there a way that I know from what view it has been clicked? so in the ItemClick event of the dropdown, I will know in what view click has taken place and so what HttpClient should be recalled?
Thanks a mill for taking the time to look at it.
Regards,
Amin
Hello Amin,
Sure David, I understand that and I know I can call the HttpClients by other events and not just the show. The point is that I have near 20 Https clients, in 8 views. Refreshing the view, or triggering view's show event, by dropdown itemclick event, could simply fix the problem. Now I need to go page by page and call each HttpClient at its own view. Tried to bypass it but seems like there is no escape from reproducing it all.
What if you place the code of the Show view event in an app's function? Then you can call to the app's function in the Show view event and also in other places too. But anyway, supose that in the Show event you prepare certain HTTP call, depending on certain variables, etc. In principle, you can also prepare another HTTP call with other dependencies, new argument values, etc., in other possible place. Anyway, maybe in your case it's possible to use one app's function and then call to it in the Show view event and other possible places.
Out of curiosity now, is it possible to read what view is active? So lets say if I keep the button in the MasterView is there a way that I know from what view it has been clicked? so in the ItemClick event of the dropdown, I will know in what view click has taken place and so what HttpClient should be recalled?
About to know the current view, we have the [App.CurrentView] global app variable, which may can be useful.
Hi David,
Thanks for your assistance, could sort that out with [App.CurrentView], kept the dropdown in the MasterView and refreshed proper HttpClients based on the activeview response any time the master button is hit.
Thanks a mill,
Hello Amin,
Hi David,
Thanks for your assistance, could sort that out with [App.CurrentView], kept the dropdown in the MasterView and refreshed proper HttpClients based on the activeview response any time the master button is hit.
Thanks a mill,
Añways thanks you for your support. Probably you already know it... but we have another maybe interesting app's event: ViewChange· Maybe not useful in your specific case here, but, who know, maybe can be useful in the future.
Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.