protected Class<? extends UIComponent> getComponentClass() {
return UIInplaceInput.class;
}
protected void doDecode(FacesContext context, UIComponent component) {
UIInplaceInput inplaceInput = null;
if (component instanceof UIInplaceInput) {
inplaceInput = (UIInplaceInput) component;
} else {
if (logger.isDebugEnabled()) {
logger.debug("No decoding necessary since the component "
+ component.getId() +
" is not an instance or a sub class of UIInplaceInput");
}
return;
}
String clientId = component.getClientId(context);
if (clientId == null) {
throw new NullPointerException("component client id is NULL" );
}
if (InputUtils.isDisabled(inplaceInput) || InputUtils.isReadOnly(inplaceInput)) {
if (logger.isDebugEnabled()) {
logger.debug(("No decoding necessary since the component "
+ component.getId() + " is disabled"));
}
return;
}
//TODO:
//Should use clientId instead?
Map <String, String> request = context.getExternalContext().getRequestParameterMap();
String newValue = (String)request.get(clientId);
if (newValue != null) {
inplaceInput.setSubmittedValue(newValue);
}
}