使用jsf基本常见问题1

使用jsf基本常见问题1

1.commandButton不能触发其Action,原因是commandButton放到了verbatim中

2.不能将InputText的值邦定到实体变量中,原因是 设置了commandButton的immediate为true造成的

3.java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.substringBeforeLast(Ljava/lang/String; Ljava/lang/String;)Ljava/lang/String;是因为commons-lang.jar版本的问题

4.在 panelTabbedPane中使用inputdate,无法正常使用,并且导致action无法执行,是因为 panelTabbedPane与其它控件的兼容性较差

5如何在 panelTabbedPane中加Tab Change事件, 设置serverSideTabSwitch="true"并且添加<t:tabChangeListener  type="back bean.PlmtManage Bean" />PlmtManage Bean需要实现TabChangeListener接口
 我是将TabChangeListener接口添加在backing bean上的,导致Tab Change事件发生时该 bean老重新create,所以放弃使用

6. bean中获取另外一个 bean中的属性
   FacesContext fc = FacesContext.getCurrentInstance();
  String userName = (String)fc.getApplication().createValueBinding("#{Person.userName}").getValue(fc);
    this.custId = custId;
  FacesContext fc = FacesContext.getCurrentInstance();
  Bank Bean bank = (Bank Bean) fc.getApplication().createValueBinding("#{bank}").getValue(fc); 
The same result you can reach using the Variable Resolver:
FacesContext fc = FacesContext.getCurrentInstance();
Bank Bean bank = (Bank Bean) fc.getApplication().getVariableResolver().resolveVariable(fc, "bank"); 

你可能感兴趣的:(使用jsf基本常见问题1)