final void setupRender() {
ComponentAction< RadioGroup > action = new Setup(formSupport.allocateControlName(clientId));
formSupport.storeAndExecute(this, action);
String submittedValue = tracker.getInput(this);
final String selectedValue = submittedValue != null ? submittedValue : encoder.toClient(value);
environment.push(RadioContainer.class, new RadioContainer()
{
public String getControlName()
{
return controlName;
}
public boolean isDisabled()
{
return disabled;
}
@SuppressWarnings("unchecked")
public String toClient(Object value)
{
// TODO: Ensure that value is of the expected type?
return encoder.toClient(value);
}
public boolean isSelected(Object value)
{
return TapestryInternalUtils.isEqual(encoder.toClient(value), selectedValue);
}
});
formSupport.store(this, PROCESS_SUBMISSION);
}
|