我在h:panelGroup中有一个ui重复jsf组件,它有一个带有搜索字段的引导程序表。
当我单击此表中的按钮时,会出现模态,要求用户确认删除操作。
当我确认时,我的模态通过bean方法关闭并更新了面板组,但是当发生这种情况时,我在引导表上的搜索字段消失了,仅当我按F5刷新页面时才再次出现。
当我删除ajax时,页面会刷新,并且搜索字段不会隐藏。
我不能在这里使用质数表。经理命令
PS:我在这里是newba,在JSF中,我无法正确设置代码格式。请放心
<h:panelGroup id="tableGroups">
<div class="row">
<div class="col-md-12">
<!-- Advanced Tables -->
<div class="panel panel-default">
<div class="panel-heading">Grupos</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Nome do grupo</th>
<th>Descrição do grupo</th>
<th>Opções</th>
</tr>
</thead>
<tbody>
<ui:repeat value="#{BeanNewGroup.listGroups()}" var="g">
<tr class="odd gradeX">
<td><h:outputText value="#{g.strGroupName}"/></td>
<td><h:outputText value="#{g.strGroupDescription}"/> </td>
<td>
<p:commandButton icon="fa fa-edit" style="text-shadow: none;" class="btn btn-primary btn-sm" actionListener="#{BeanNewGroup.updateGroup(g.id)}" value="Editar"/>
<p:commandButton icon="fa fa-pencil" style="text-shadow: none;" class="btn btn-danger btn-sm" actionListener="#{BeanNewGroup.openModalConfirmDeleteGroup(g.id)}" value="Deletar"/>
</td>
</tr>
</ui:repeat>
</tbody>
</table>
</div>
</div>
</div>
<!--End Advanced Tables -->
</div>
</div>
</h:panelGroup>
我的豆子
public void deleteGroup() throws InterruptedException {
DaoGroup dg = new DaoGroup();
PojoUser pu = new PojoUser();
pu.setId((Long) session.getAttribute("USER_SECURITY_LOGIN_ID"));
PojoGroup tmpPg = new PojoGroup();
tmpPg.setId(lonGroupId);
Boolean existGroup = dg.getSchudule(tmpPg, pu);
Boolean existContatoToGroup = dg.getContactToGroup(tmpPg, pu);
if (existGroup == false && existContatoToGroup == false) {
if (dg.deleteGroup(tmpPg, pu)) { RequestContext.getCurrentInstance().execute("PF('confirmDelGroup').hide();");
addMessageSucess("Sucesso!", "Grupo deletado com sucesso!");
updateEntirePage("formGroups");
} else {
addMessageWarning("Falha", "Falha ao deletar o grupo!");
RequestContext.getCurrentInstance().execute("PF('confirmDelGroup').hide();");
}
} else {
addMessageWarning("Falha", "Grupo em uso, impossível deletar!");
} RequestContext.getCurrentInstance().execute("PF('formDelGroupModal').hide();");
updateEntirePage("tableGroups");
}