我想实现我在我的页面中使用的 pf 3.5仪表板组件*.xhtml
:
<p:growl id="growl" showDetail="true" />
<p:dashboard id="board" model="#{dashboardBean.model}">
<p:ajax event="reorder" listener="#{dashboardBean.handleReorder}"
update="growl" />
<p:panel id="products" header="Products">
<h:outputText value="Product Content" />
</p:panel>
<p:panel id="plans" header="Plans">
<h:outputText value="Plans Content" />
</p:panel>
<p:panel id="notes" header="Notes">
<h:outputText value="Notes Content" />
</p:panel>
</p:dashboard>
作为我的后端:
我正在使用与上面链接相同的 bean ,并且:
public DashboardBean() {
model = new DefaultDashboardModel();
DashboardColumn column1 = new DefaultDashboardColumn();
DashboardColumn column2 = new DefaultDashboardColumn();
DashboardColumn column3 = new DefaultDashboardColumn();
column1.addWidget("products");
column2.addWidget("plans");
column3.addWidget("notes");
model.addColumn(column1);
model.addColumn(column2);
model.addColumn(column3);
}
但是,当我在服务器上打开我的页面时,什么都没有显示。我的html输出:
<form id="form" enctype="application/x-www-form-urlencoded" action="/ProductOverview.xhtml" method="post" name="form">
<input type="hidden" value="form" name="form">
<span id="form:growl"></span>
<div id="form:board" class="ui-dashboard"></div>
<input id="j_id1:javax.faces.ViewState:0" type="hidden" autocomplete="off" value="-5329509311621774370:-4596343252720161135" name="javax.faces.ViewState">
</form>
我真的很感谢你的回复!