<p:dashboard id="dash" model ="#{homeReceptionDashboardBck.model}">
<c:forEach
items="#{homeReceptionDashboardBck.widgets}"
var="widgetsElement">
<p:panel id = "widgetsElement.idWidget" header="widgetsElement.name">
<c:forEach
items="#{homeReceptionDashboardBck.uploadBooking(widgetsElement)"
var="bookings">
<h:outputText value="#{booking.owner.ragioneSociale}">
</h:outputText>
</c:forEach>
</p:panel>
</c:forEach>
</p:dashboard>
我创建一个在应用程序启动时加载的空模型:
for(i = 0;i<officesList.size();i++) {
DashboardColumn columnTmp = new DefaultDashboardColumn();
model.addColumn(columnTmp);
columnDashboard.add(columnTmp);
List<MeetingRoom> tempMeetingRoom = new ArrayList<>();
tempMeetingRoom = meetingmr.getAllByOffice(
officesList.get(i).getId(),
true,
JSFUtil.getActiveUser());
for(x = 0;x<tempMeetingRoom.size();x++)
{
//popolo la lista che mi serve all'inizio per la lista dei Panel da inserire
meetingRoomByOffice.add(tempMeetingRoom.get(x));
}
officePositionAndColumn[i][0] = (int) (long) officesList.get(i).getId();
officePositionAndColumn[i][1] = i;
}
在这部分代码中,我做了很多事情,但重要的是“create”和添加一个新的空列。我创建了一个在java代码中使用的DashboardColumn列表,称为ColumnDashboard。
我创建了一个特定的菜单,以便在模型中添加一个小部件:xhtml--->
<smifn:actionsMenu id="tableAddMeetingRoom" styleClass="col-xs-8 col-md-12 text-right"
title="#{msg['booking.add_meeting_room']}">
<c:forEach items="#{homeReceptionDashboardBck.meetingRoomByOffice}"
var="meetingRoomElement">
<p:menuitem id="#{homeReceptionDashboardBck.getMenuItemId(meetingRoomElement)}"
actionListener="#{homeReceptionDashboardBck.onAddPanel(meetingRoomElement)}"
process="@this" partialSubmit="true"
value="#{meetingRoomElement.name}"
icon="icon-add-3"
iconPos="left"
>
<p:ajax process="widgetBookingReception" update="widgetBookingReception"/>
</p:menuitem> <!-- oncomplete="PF('bookingSelect').show()"-->
</c:forEach>
</smifn:actionsMenu>
public void onAddPanel(MeetingRoom panelSelected) {
int i;
//splitto il nome per creare l'id
String [] nameMeetingRoom = panelSelected.getName().split(" ");
String idWidget = nameMeetingRoom[0]+"_"+nameMeetingRoom[1];
//oggetto di tipo DashboardWidget
DashboardWidget tmp = new DashboardWidget();
//imposto l'id, nome della stanza e l'ufficio relativo
tmp.setIdWidget(idWidget);
tmp.setName(panelSelected.getName());
tmp.setOffice(panelSelected.getOffice());
//aggiungo alla lista dei widget l'oggetto relativo
widgets.add(tmp);
//stringa per la posizione della colonna
int columnPosition = -1;
//faccio un for per passare tutte le colonne relative
for(i = 0;i<officePositionAndColumn.length;i++)
{
//se l'id che era stato impostato è uguale a quello passato
if(officePositionAndColumn[i] [0] == panelSelected.getOffice().getId())
//posizione della colonna che va da 0 a n.
columnPosition = officePositionAndColumn[i][1];
}
//se è stato trovata la posizione della colonna
if(columnPosition>=0) {
//mi ricavo la colonna
DashboardColumn columnSelected = new DefaultDashboardColumn();
columnSelected = columnDashboard.get(columnPosition);
//imposto l'id al widget
columnSelected.addWidget(idWidget);
//sovrascrivo la colonna con quella modificata
columnDashboard.set(columnPosition, columnSelected);
//reimposto il modello e ricarico le colonne
setModel(new DefaultDashboardModel());
for(i = 0;i<columnDashboard.size();i++)
{
this.model.addColumn(columnDashboard.get(i));
}
for(i = 0;i<meetingRoomByOffice.size();i++)
{
if(meetingRoomByOffice.get(i).equals(panelSelected))
{
meetingRoomByOffice.remove(i);
}
}}
int i;
FacesContext fc = FacesContext.getCurrentInstance();
Application app = fc.getApplication();
dashboard = (Dashboard) app.createComponent(
fc,
"org.primefaces.component.Dashboard",
"org.primefaces.component.DashboardRenderer");
dashboard.setId("dash");
dashboard.setModel(model);
Panel panel1 = (Panel) app.createComponent(
fc,
"org.primefaces.component.Panel",
"org.primefaces.component.PanelRenderer");
panel1.setId("Sala_Demo");
panel1.setToggleable(true);
panel1.setClosable(true);
panel1.setHeader("Sala Demo");
for(i = 0;i<widgets.size();i++)
{
Panel panel = (Panel) app.createComponent(
fc,
"org.primefaces.component.Panel",
"org.primefaces.component.PanelRenderer");
panel.setId(widgets.get(i).getIdWidget());
panel.setToggleable(true);
panel.setClosable(true);
panel.setHeader(widgets.get(i).getName());
getDashboard().getChildren().add(panel);
}
我找到了这个解决方案:
对于任何会发现我在创建动态仪表板时遇到的相同困难(一切都是动态的)的人来说,这是一个例子。
我的问题
private DashboardModel model;
private List<DashboardColumn> dashboardColumn;
DashboardColumn columnTmp = new DefaultDashboardColumn();
model.addColumn(columnTmp);
columnDashboard.add(columnTmp);
for(x = 0;x<tempMeetingRoom.size();x++)
{
meetingRoomByOffice.add(tempMeetingRoom.get(x));
}
for(i = 0;i<officesList.size();i++) {
officePositionAndColumn[i][0] = (int) (long) officesList.get(i).getId();
officePositionAndColumn[i][1] = i;
}
<smifn:actionsMenu id="tableAddMeetingRoom" styleClass="col-xs-8 col-md-12 text-right"
onclick="@this.update()"
title="#{msg['booking.add_meeting_room']}">
<c:forEach items="#{homeReceptionDashboardBck.meetingRoomByOffice}" var="meetingRoomElement">
<p:menuitem id="#{homeReceptionDashboardBck.getMenuItemId(meetingRoomElement)}"
action="#{homeReceptionDashboardBck.onAddPanel(meetingRoomElement)}"
process="@this"
value="#{meetingRoomElement.name}"
icon="icon-add-3"
iconPos="left"
update ="widgetBookingReception">
</p:menuitem> <!-- oncomplete="PF('bookingSelect').show()"-->
</c:forEach>
</smifn:actionsMenu>
update=“WidgetBookingReception”>
对更新整个表单很重要onAddPanel方法
我有一门特别课程,有两个主要目标:
String [] nameMeetingRoom = panelSelected.getName().split(" ");
String idWidget = nameMeetingRoom[0]+"_"+nameMeetingRoom[1];
DashboardWidget tmp = new DashboardWidget();
tmp.setIdWidget(idWidget);
tmp.setName(panelSelected.getName());
tmp.setOffice(panelSelected.getOffice());
widgets.add(tmp);
现在我将找到列表中的位置,更新模型和菜单中的listOfMeetingRoom。
for(i = 0;i<officePositionAndColumn.length;i++)
{
//se l'id che era stato impostato è uguale a quello passato
if(officePositionAndColumn[i] [0] == panelSelected.getOffice().getId())
//posizione della colonna che va da 0 a n.
columnPosition = officePositionAndColumn[i][1];
}
//se è stato trovata la posizione della colonna
if(columnPosition>=0) {
//mi ricavo la colonna
DashboardColumn columnSelected = new DefaultDashboardColumn();
columnSelected = columnDashboard.get(columnPosition);
//imposto l'id al widget
columnSelected.addWidget(idWidget);
//sovrascrivo la colonna con quella modificata
columnDashboard.set(columnPosition, columnSelected);
//reimposto il modello e ricarico le colonne
setModel(new DefaultDashboardModel());
for(i = 0;i<columnDashboard.size();i++)
{
this.model.addColumn(columnDashboard.get(i));
}
for(i = 0;i<meetingRoomByOffice.size();i++)
{
if(meetingRoomByOffice.get(i).equals(panelSelected))
{
meetingRoomByOffice.remove(i);
}
}
我就是这样更新整个模型的。但现在我们必须将其更新为XHTML。
我创建了一个完整的动态仪表板,这是代码:
<p:dashboard widgetVar="dash" model ="#{homeReceptionDashboardBck.model}">
<c:when test="not empty #{homeReceptionDashboardBck.widgets}">
<c:forEach items="#{homeReceptionDashboardBck.widgets}" var="Element">
<p:panel id="#{Element.idWidget}" header="#{Element.name}">
<c:when test="not empty #{homeReceptionDashboardBck.uploadBooking(Element)}">
<c:forEach items="#{homeReceptionDashboardBck.uploadBooking(Element)}" var="row">
<h:outputText value="#{homeReceptionDashboardBck.getEventGeneralInfo(row)}"> </h:outputText>
<h:outputText> <br/></h:outputText>
</c:forEach>
</c:when>
<c:otherwise>
<c:when test="#{homeReceptionDashboardBck.uploadBooking(Element)}">
<h:outputText value="Nessun evento prenotato"> </h:outputText>
<h:outputText> <br/></h:outputText>
</c:when>
</c:otherwise>
</p:panel>
</c:forEach>
</c:when>
</p:dashboard>
> Kubectl apply-f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recomended.yaml kubectl代理--address=“192.168.56.12”-p 8001-accept-hosts='^*$' [root@k8s-master~]#kubectl
提示: ●一个地图,最多支持4种模板。 ●新增字段设置字段名称及字段类型。 操作步骤: 1)在动态模板中点击新增字段弹出新增字段窗口。 2)填写字段名称及选择字段类型,点击确定后,在内容字段下显示新增字段。 注意: ①字段名称不能出现重复。 ②字段名称及字段类型可以进行编辑和删除。 ③鼠标左键选择字段可以进行字段顺序调整。 提示: ●勾选 "提交发布动态时所在位置" ,在手机端发布动态的时候,会定
我试图为Jira找到一些扩展(或者内置功能),可以像在流行的信使中那样给用户分配状态,例如“度假”或“今天在家办公”。如果能看到一个仪表板,所有用户的状态都显示在一起,那就太好了。 唯一听起来和我要找的东西很接近的是https://confluence.atlassian.com/conf54/confluence-user-s-guide/sharing-content/user-status-
双向绑定
我可以连接elasticsearch。然而,我无法在5601上访问kibana。有人能帮忙吗?提前谢谢。 在基巴纳。yml文件,我已经修改了服务器。主机参数指向我的域。 Elasticsearch版本:7.7.0 基巴纳。yml 基巴纳原木
我有如下疑问: 我在我的java类中执行上述查询: 问题是我在运行时从文本属性文件中获取,如下所示: 如上面一行所示,属性文件有一个sql的参数。所有参数都由双管分隔。 我正在使用管道分隔符上的split方法将此行读入。 所以我得到的<code>queryParams</code>字符串数组将是: < code > String[] < code > query params ,其中< code>