Dear all,
The requirement is when photoMainStatus = true, then in the HTML, the radio
is selected.when photoMainStatus=false , the radio is not selected.
In the java, i can find i already pass the value to photoMainStatus, but in
HTML, all radio is not selected.
thanks a lot.
java code:
ListView fileListView = new ListView("fileList", files) {
@Override
protected void populateItem(final ListItem item) {
........
setPhotoMainStatus(fileObj.isMain());
System.out.println("fileObj.getId():"+fileObj.getId()+";
isPhotoMainStatus():" + isPhotoMainStatus());
if (fileObj.isMain())
{
setFileId(fileObj.getIndexNo());
}
Radio r = new Radio("radio", new
PropertyModel(getParent().getParent(), "photoMainStatus"));
r.add(new AjaxEventBehavior("onchange") {
@Override
protected void onEvent(AjaxRequestTarget target) {
}
});
item.add(r);
System.out.println("RADIO VALUE : " +
r.getModelObjectAsString());
System.out.println("RADIO VALUE : " + r.getValue());
}
HTML codes:
<td width="100">
<input type="radio"
wicket:id="radio"/>
</td>
The debug out is :
fileObj.getId():158; isPhotoMainStatus():true
RADIO VALUE : true
RADIO VALUE : radio93
fileObj.getId():159; isPhotoMainStatus():false
RADIO VALUE : false
RADIO VALUE : radio94
--
View this message in context:
http://www.nabble.com/Help%2C-Radio-value-can-not-be-displyed-in-HTML-tp19305132p19305132.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.