Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 9 Monaten, 3 Wochen
Letzter Beitrag:
vor 9 Monaten, 2 Wochen
Beteiligte Autoren:
Christine Wagner, Allard

[WD21] Dashboard [SOLVED]

Startbeitrag von Christine Wagner am 28.09.2017 06:33

I'm implementing a dashboard for our product. I need configurations for nearly each widget. And widgets may exist several times in the dashboard.

I have implemented a very simple dashboard, to try out all functionality. There is only one Internal Window named IW_Static, which only shows some text.

I can already add as many widget I like with different strings. (Using an edit field and a button. The button creates the widget with the given string)

I can already store the dashboard status and load it again (Using a global array to store the different strings and reading the string returned from DashSaveConfiguration; I'm creating each widget by programming on loading the saved status again.)

Now I need a functionality to update all instances of widgets shown on the dashboard (but only the ones visible, not the hidden ones.) There is a local procedure "Update" in the IW_Static. But how do I call this procedure? IW_Static.Update() calls only the Update method of the first instance. I can't find a way to get the instances from the dashboard.

Please, help! Any help is really appreciated! Thanks a lot for any idea! (You see, I'm really desperate already)

I will also need a functionality to update a specific instance, when it is changed from hidden to visible. Any idea there?

Best Regards
Christine Wagner


Sorry, I found a workaround.
I will call DashDisplay and update the widgets in the "Refreshing the IW_... Widget" section.
If someone knows a possibility to get the instance of a specific widget (of a certain subscript), I would nevertheless very much appreciate to find out about this.

Christine Wagner

von Christine Wagner - am 28.09.2017 07:01

I did same kind of thing. To make graphs in dashboard. Use a template internal window withchart ( enable everything ) so control an be used for everything.
User can add charts to the dashboard by adding a chart widget and then adding s rows to a chart file

Trick is to redraw the chart control. So you have to know what Id the dashboard item has

Add a widget in a file and save it with a dashboard ID

I have an internal window that loads a global dahboadrID and a periodnr. Then calculates stuff and draws graph

Hope you get a bit what I try to tell. If you need more info. Snet me a pb. Maybe I can sent you some code by mail ( Have to warn youthough code is in dutch ;-)

What do you want in your widgets? Charts like I did?


von Allard - am 03.10.2017 07:55
I have of now (I'm currently checking in all my changes) a working solution for my dashboard. I'm not only showing charts, but my main widgets show statistical values. The widget, I implemented now to get everything to work, shows basically the number of datalines of a specific type (configured from the user).
My solution now is rather complicated. I have implemented a basic abstract Dashboard_Widget class and will implement a subClass for each type of widget. I'm storing these objects in a "garrWidgets is array of dynamic Dashboard_Widget" in the window with the dashboard. The code line creating the widget looks this way:

nDashSubscipt = DashAddWidget(DASH_Dashboard, garrWidgets[nArrSubscript].Widget, garrWidgets[nArrSubscript].Title, garrWidgets[nArrSubscript])
garrWidgets[nArrSubscript].Subscript = nDashSubscipt

The Global declaration of my internal window looks like this:

PROCEDURE MyWindow(gclWidget is dynamic object Dashboard_Widget)

This way I have access to the same object in both locations and can even change some value from within the internal window, without losing this info in the external one.
I'm now also able to store the exact state of the dashboard and load it again without having to know anything about the internal window itself.

I'm not sure this solution is the prettiest one possible, but it works. So I'm satisfied.

PS: I think I know what you mean and perhaps it would have simplified a lot of my code. Whenever adding a widget to the dashboard, you are adding it to the array (as am I, when I think about it). As the subscriptionId is strongly ascending, I know it looking at the size of the array. I do need some functions I can call for every Widget (getting the configurationstring for storing it for example). Using a class, I'm sure these methods exist. Using internal windows I wouldn't have this security for all widgets. But it would have been less code. Not sure which solution would be better, but I prefere my current one. Thanks a lot for your input!

von Christine Wagner - am 03.10.2017 09:46

Ok Works great doesn't it.

The thing with webdev though is the lack of support for internal windows in webdev. The dashboard in webdev cannot be properly resized due to the fact that internal windows can't

regards .

von Allard - am 04.10.2017 19:13
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.