如何预选组件中的h:selectManyCheckbox
元素?我已经搜索了f:selectItem
标签的属性,但还没有找到如何预先选择这个项目(即在调用网站时已经勾选了它).
这个问题已经解决了这个问题,但是提出的解决方案并没有对我有用.我在我的支持bean中定义了以下枚举:
public enum QueryScope {
SUBMITTED("Submitted by me"), ASSIGNED("Assigned to me"), ALL("All items");
private final String description;
public String getDescription() {
return description;
}
QueryScope(String description) {
this.description = description;
}
}
Run Code Online (Sandbox Code Playgroud)
然后我用它作为方法参数
public void test(QueryScope scope) {
// do something
}
Run Code Online (Sandbox Code Playgroud)
并在我的JSF页面中通过EL使用它
<h:commandButton
id = "commandButton_test"
value = "Testing enumerations"
action = "#{backingBean.test('SUBMITTED')}" />
Run Code Online (Sandbox Code Playgroud)
到目前为止一直很好 - 与原始问题中提出的问题相同.但是我必须处理一个javax.servlet.ServletException: Method not found: %fully_qualified_package_name%.BackingBean.test(java.lang.String)
.
所以似乎JSF正在解释方法调用,好像我想调用一个String作为参数类型的方法(当然不存在) - 因此不会发生隐式转换.
可能是什么因素导致这个例子的行为与前面提到的不同?
我目前正在开发一个简单的Web项目,我正在使用Polarion的SDK .尝试使用相应的*.jar-Files时,Tomcat 7会在启动时抛出以下错误消息:
SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.NoClassDefFoundError: Lcom/polarion/alm/ws/client/session/SessionWebService;
Run Code Online (Sandbox Code Playgroud)
根据我所进行的研究,Java正试图找到com.polarion.ws.client.session.SessionWebService 的实例(因此是领先的L).我已经检查了所需条目的类路径 - 它就在那里.
C:\Polarion\polarion\SDK\lib\com.polarion.alm.ws.client\wsclient.jar
Run Code Online (Sandbox Code Playgroud)
截至目前,我已经完成了可能出错的想法.你有什么想法?
非常感谢!西蒙