Help, Radio value can not be displyed in HTML
Click to flag this post
by wch2001 Sep 04, 2008; 03:43pm :: Rate this Message: - Use ratings to
moderate (?)
Reply | Reply to Author | Edit | Delete | Print | View Threaded | Show Only
this Message
This message was accepted by the [EMAIL PROTECTED] mailing list.
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-tp19305271p19305271.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]