Primefaces prime faces主题切换程序:如何将主题添加到我的项目中
看到我的代码了吗 theme.xhtmlPrimefaces prime faces主题切换程序:如何将主题添加到我的项目中,primefaces,Primefaces,看到我的代码了吗 theme.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
<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>
我以素面为例
我还在构建路径xml中配置了主题JAR
但我在主题切换程序(列表框)中甚至没有得到选择
有谁能建议我做什么吗
它们展示了如何为这个非常简单的示例编写代码
这里还有一个很好的教程请参见
它们展示了如何为这个非常简单的示例编写代码
这里还有一个很好的教程
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;
}
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;
}