philipp
15 messages 2008-08-28 |
I think the function that updates the data in the dataprovider schould run within a worker task. You can implement the interface from WorkerTask (in the kutil package) and push the implementation via Worker.insatnce.pushTask( ... ) to the Worker. The screen updates schould be ok after that.
|
|
philipp
15 messages 2008-08-28 |
Wow - that was fast. Thank you for the quick reaction.
But there is a question, that comes to my mind: wasn't this possible before? I never tried it, but Menu is also a subclass of Widget and a command like
Kuix.loadXml( myScreen.getFirstMenu(), xmlFile, null )
schould do the same. Am I wrong?
I was looking for a possibility to do this inside the xml file. Something like the #inc command, but with dynamicly changing filenames. An attribute of Menu would be great. Something like <_contentXmlFile>@{file}</_contentXmlFile>. For my project it would be even better - because I've just a few small context menus - to define all of them in just one xml, like described in my first message (in this thread).
Anyway - Thanks for the work - you do a great job.
|
|
philipp
15 messages 2008-08-27 |
hmmm.. stupid me! i've found the solution:
dispatchItemsUpdateEvent( DataProvider.FILTER_MODEL_UPDATE_EVENT_TYPE, tag, this, (LinkedListEnumeration)getUserDefinedValue( tag ) );
simple and effective.
cheers
|
|
philipp
15 messages 2008-08-27 |
ok - the basic setu pis simple: there is a List filled with ListItems from a dataprovider. i applyed a filter on the dataprovider, that filters out some items - depending on the attributes of these items. that works fine so far. if now an attribute of one of the items change, there is no refiltering done. how can i make the filter run again?
|
|
philipp
15 messages 2008-08-21 |
you can reference the widget via the id attribute.
<tabItem id="tabItem0" />
in java code
screen.getWidget("tabItem0")
---
but usualy, it shouldn't be necessary to do this. you can send data, and style-properties to the widget via the DataProvider and get events and data back via the FrameHandler ( see also onAction attribute )
|
|
philipp
15 messages 2008-08-20 |
I solved my problem by extending the Screen widget and it's subclass ScreenMenu. And it works the way i wanted, but it has a side effect. All other widgets on the screen don't get any shortcut key processing events :-( That isn't a problem for me, but not a real solution. Anyway - if you want it - i can send you the source code.
cheers
|
|
philipp
15 messages 2008-08-20 |
The DataProvider is a great construct to deliver application data to the ui ( and in the future maybe back again ;-) ), but in my opinion it shouldn't be used to create menus. In order to keep the ui structure apart from application data, the descripted way would be more elegant ( even if it's no the best solution, i've ever seen ;-) )
I think this seperation is one of the main advantage of Kuix to the other ui frameworks ( i havn't seen all of them ).
|
|
philipp
15 messages 2008-08-20 |
hello,
is there any possibility the define context sensitive popup menus? i know, that it is possible if a DataProvider is used to dynamicly create the menuItems, but is it possible to define multiple popup menus like this:
<screenSecondMenu>
Menu
<_select>@{menu_selection}</_select>
<menuPopup id="menu_1">
<menuItem />
...
</menuPopup>
<menuPopup id="menu_2">
<menuItem />
...
</menuPopup>
</screenSecondMenu>
and just one popup menu is shown if it's triggered
|
|
philipp
15 messages 2008-08-13 |
hmmm... that's a good point. basicly, i agree. i wanted to use this for simple program logic. like storing data and than switching to the next screen. maybe, i pmlement it by myself. thanks for now.
|
|
philipp
15 messages 2008-08-13 |
ah - i forgot another advantage: also the order how the events are called could be controlled via the xml file.
|
|
philipp
15 messages 2008-08-13 |
I'm not sure, if this feature is already included in Kuix, but I haven't found it yet. The possibility to give a list of actions to the onAction attribute would lead to a more clean and elegant application design. It would be possible that every event have just one receiver and a construct like the following would be possible:
<textField id="text_field_name" />
<button onAction="store_data(${data_provider}, tag_name, #text_field_name), client_login(#text_field_name), switch_screen(main)">%LOGIN_OK%</button>
|
|
philipp
15 messages 2008-08-11 |
ok - that would be cool. But I could imagine an even more elegant way ;-)
I would be cool, if the dataprovider attribute that is already in every widget, would be writeable and inheritable.
it is already possible to set object attributes inside xml (see items attrobute in List) and why shouldn't work this for the DataProvider?
|
|
philipp
15 messages 2008-08-11 |
Is there a possibility the change the DataProvider for a subtree inside a single xml file?
At the moment, I'm using a construction like this (see below) to provide a different DataSource for e.g. a List.
public class OldDataProvider extends DataProvider {
public Object getUserDefinedValue( String property ) {
if ( "new_data_provider".equals(property) ) {
return new NewDataProvider();
}
}
}
<screen>
...
#inc(list.xml, ${new_data_provider})
...
</screen>
It would be greate to avoid the #inc and insert a list with a different DataProvider.
Any Ideas?
|
|
philipp
15 messages 2008-07-30 |
ok - i've found the function, that i searched for. it's called "invalidate".
anyway - kuix is a great peace of code - really good work
|
|
philipp
15 messages 2008-07-30 |
I've got a similar problem. I've created a custom widget, that gets a dynamic property delivered by the binded DataProvider. The function processModelUpdateEvent is called correctly, but if this function call the paint(Graphics g) function die widget dosn't get repainted :-(
How can repaint a widget or the whole screen?
|
|