看我的代码
主题.xhtml
<h:form>
<h:panelGrid>
<p:themeSwitcher style="width:165px" effect="fade" var="th" id="themePreview" >
<f:selectItem itemLabel="Choose Theme" itemValue="" />
<f:selectItems value="#{themeBean.themesList}" var="theme" itemLabel="#{theme.name}" itemValue="#{theme}"/>
<p:column>
<p:graphicImage value="images/#{th.image}"/>
</p:column>
<p:column>
#{th.name}
</p:column>
</p:themeSwitcher>
</h:panelGrid>
</h:form>
主题豆
themesList= new ArrayList<Theme>();
themesList.add(new Theme("afterdark","afterdark.png"));
themesList.add(new Theme("aristo","aristo.png"));
themesList.add(new Theme("eggplant","eggplant.png"));
themesList.add(new Theme("humanity","humanity.png"));
themesList.add(new Theme("sunny","sunny.png"));
}
public List<Theme> getThemesList() {
return themesList;
}
public void setThemesList(List<Theme> themesList) {
this.themesList = themesList;
}
主题.java
private String name;
private String image;
public Theme(String name, String image)
{
this.setImage(image);
this.setName(name);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
我遵循了主要面孔示例。
我也在构建路径 xml 中配置了主题 jar
但我什至没有在主题切换器(列表框)中获得选择
谁能建议我该怎么做