0

Update vBox

asked 2014-03-26 10:04:22 +0800

wigberto gravatar image wigberto
52 4

How can I create a timer so that it is updated vbox and to be able to change the icon depending on the status? Now I have it like in the example, but I don´t know it must be "updateVox" Example:

                            <vbox id="statusSystemVbox">
                                <button
                                    src="/img/64/iconoActualizar64.png"
                                    onClick="@command('openWindow')">
                                </button>
                                <button id="isStatusStopButton"
                                    src="/img/64/iconoPlay64Verde.png"
                                    onClick="@command('activeSystem', status='STOP')"
                                    if="${vm.isStatusSystem == true}">
                                </button>
                                <button id="isStatusStartButton"
                                    src="/img/64/iconoPlay64Rojo.png"
                                    onClick="@command('activeSystem', status='PLAY')"
                                    if="${vm.isStatusSystem == false}">
                                </button>
                            </vbox>
                            <timer id="timerVbox"
                                delay="${labels.timer.time}" repeats="true"
                                onTimer="@command('updateVbox')" />
delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

answered 2014-03-26 10:23:25 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2014-03-26 11:58:57 +0800

In your command updateVbox you shall notify all the things that could have changed. Bind the source of your images to your vm.

Like this :

@Command
@NotifyChanged ({"isStatusSystem","sourceIcon"})
public void updateVbox () {
  // change here the source if it must be changed.  
}

edit :

<button src="@load(vm.sourceIcon)" onClick="@command('openWindow')">

or when it's in an other object and where only that object has a getter :

<button src="@load(vm.object.sourceIcon)" onClick="@command('openWindow')">
link publish delete flag offensive edit

Comments

Thank you.

wigberto ( 2014-03-27 14:33:30 +0800 )edit
0

answered 2014-03-26 11:22:14 +0800

wigberto gravatar image wigberto
52 4

how do I bind the sourceIcon with vm?

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-03-26 10:04:22 +0800

Seen: 15 times

Last updated: Mar 26 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More