0

How can we Notify Class Method in ZK

asked 2013-12-27 04:22:43 +0800

jatindersingh gravatar image jatindersingh
93 5
http://javaj2eehub.com/

updated 2013-12-27 04:23:30 +0800

Hi There i have a class method which will return the red color code by taking an hex value is there any way i can notify the method so that the text box updated with red color code.

public int getRedColor(String colorHex) {
        int redColor = Integer.parseInt(colorHex.substring(1, 3), 16);
        return redColor;

    }

Defined in Zul.

<textbox readonly="true" hflex="1" id="redColor" value="@bind(vm.getRedColor(vm.freeformRecord.colour))"/>

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-12-30 17:16:12 +0800

rickcr gravatar image rickcr
704 7

updated 2013-12-30 17:16:38 +0800

I believe in the case you described, since you're using the same vm, you should be able to do..

 value="@bind(vm.getRedColor())"/>

Your vm already knows about freeformRecord.colour so maybe just change your method to..

 public int getRedColor() {
    String colorHex = this. freeformRecord.colour;
    int redColor = Integer.parseInt(colorHex.substring(1, 3), 16);
    return redColor;

}
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
2 followers

RSS

Stats

Asked: 2013-12-27 04:22:43 +0800

Seen: 13 times

Last updated: Dec 30 '13

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