-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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))"/>
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;
}
Asked: 2013-12-27 04:22:43 +0800
Seen: 13 times
Last updated: Dec 30 '13