Reloading components in border layout

6 messages - 61 views

if I would like to use border layout with diferent components how could I reload specik componenets and use diferent dataproviders from them.

Assuming for center part I would like to add scrollpane and use scecific dataprovider, then I would like to change it depending on some menu selections.

is it sane design choise? any other suggestions?

the reason is that some of componens are the same and I would like to have then through all "forms"

Take a look at the Kuix.loadXml(Widget rootWidget, InputStream inputStream, DataProvider dataProvider) method where the root widget could be an existing widget presents in you screen that you have retrive the instance by its "id".

After invoking this method, the rootWidget content will change.

ok, i ll test it!

works like a charm!

there are are how ever some iprovments that can by done.

1. allow passing pathToXml file instead of inputStream

2. creating method for adding xml + css at the same time, becouse if there are css tag that are used in new widget from this new xml file style from old file will not work, and css file need to be reloaded.

ofcource one can argue that the line

Kuix.loadCss(path)

is not hard to add, but it woud make more sence having function like

Kuix.loadWidget(rootWidget, xmlPath, dataProvider, csspath)

 

 

 

Yes, but you need to know that loadCss(...) method append new styles to registred styles and in this case old defined styles stay available. That's why it could be a lillte confuse to load a widget tree from xml file and imagine that the new css definition wil be applied only to those widgets ...

well, it makes sence to me, if you load new widget, it's abvios you need to load style for it.

ofcource this introduces new chanalges like clashing style names.

but stil the idea is worth consideering :)