1.如何获取managebean对象?
也可以通过
方式获得
2.如果获取valueChange控件及其新值?
3.如果获取session值?
4.如何根据控件id找到某个控件
5.如何解决页面数据缓存在服务端的问题
web.xml中作如下配置:
FacesContext context
=
FacesContext.getCurrentInstance();
VariableResolver vr = context.getApplication().getVariableResolver();
GrxxForm grxxform = (GrxxForm)vr.resolveVariable(context, " grxxform " );
VariableResolver vr = context.getApplication().getVariableResolver();
GrxxForm grxxform = (GrxxForm)vr.resolveVariable(context, " grxxform " );
ValueBinding vb
=
context.getApplication().createValueBinding(
"
#{tabpanebean}
"
);
TabpaneBean bean = (TabpaneBean) vb.getValue( context ) ;
TabpaneBean bean = (TabpaneBean) vb.getValue( context ) ;
2.如果获取valueChange控件及其新值?
public
void
processValueChange(ValueChangeEvent event)
...
{
UIComponent component = event.getComponent(); //获取值变控件对象
String qsny = String.valueOf(event.getNewValue()); //获取值变控件的新值
......
}
UIComponent component = event.getComponent(); //获取值变控件对象
String qsny = String.valueOf(event.getNewValue()); //获取值变控件的新值
......
}
javax.servlet.http.HttpServletRequest req
=
(javax.servlet.http.HttpServletRequest) getExternalContext().getRequest();
HttpSession session = req.getSession( true );
......
(javax.servlet.http.HttpServletRequest) getExternalContext().getRequest();
HttpSession session = req.getSession( true );
......
HtmlDataTable table1
=
(HtmlDataTable) context.getViewRoot().findComponent(
"
yourtableid
"
);
web.xml中作如下配置:
<
context-param
>
< param-name > javax.faces.STATE_SAVING_METHOD </ param-name >
< param-value > client </ param-value >
</ context-param >
< param-name > javax.faces.STATE_SAVING_METHOD </ param-name >
< param-value > client </ param-value >
</ context-param >