Quantcast
Channel: ZK Forum - Individual question feed
Viewing all articles
Browse latest Browse all 356

How can I bind an int value to radiogroup for selectedItem? It wants String?

$
0
0
In my ViewModel I have an object that represents what I'm capturing data from the form for. (For simplicity using Person here) The problem is one of the properties is an int that I need to bind to a radiogroup, but ZK seems to want a String to decide what value to set? [CODE] [/CODE] The radio button won't be set if "ageRangeId" is an int. It works if I have it a String. The somewhat easy way out is to bind the selected item to a vm "ageRangeAsString" and then in the getter/setter I do the conversion from/to the ageRangeId of the Person object. Seems a bit awkward though. Curious why ZK can't try to force the conversion (simply throw an exception if it fails.) Am I missing something or am I correct that the selectedItem only works off of a string (when working off the value)?

Viewing all articles
Browse latest Browse all 356

Trending Articles