【发布时间】:2015-12-06 14:08:09
【问题描述】:
我在视图中有一个<h:outputText>。
在控制器中,我想使用下面的代码来操作 value 和 style 属性。有可能吗?
private void updateMsgCreateRegistrationKey(String objectName, String msg, String msgType){
UIComponent UIOutputText = getUIComponentOfId(FacesContext.getCurrentInstance().getViewRoot(), objectName);
if (UIOutputText != null){
UIOutputText.setRendered(true);
if(msgType.equalsIgnoreCase("Info")){
}else if(msgType.equalsIgnoreCase("Error")){
}
}
RequestContext.getCurrentInstance().update(objectName);
FacesContext.getCurrentInstance().renderResponse();
}
【问题讨论】:
-
“有可能吗??”:试试看……
-
可能是这样,但为什么。
标签: jsf controller components