读书人

请教JSF中弹出“删除确认”窗口怎么

发布时间: 2011-12-10 00:07:34 作者: rapoo

请问JSF中,弹出“删除确认”窗口如何实现?
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<c:set var="ctxPath" value="${request.contextPath}"/>
<f:view>
<trh:html>
<trh:head title="四川电信 - 内控支撑系统 - [角色列表]">
<link href="${ctxPath}/css/default.css" type="text/css" rel="stylesheet"/>
</trh:head>
<trh:body>
<t:div id="container">
<t:div id="divheader">
<jsp:directive.include file="../../header.jspf"/>
</t:div>

<div id="center">
<t:div id="divmenu">
<jsp:directive.include file="../../menu.jspf"/>
</t:div>
<t:div id="divmain">
<tr:form>
<tr:messages inlineStyle="width:300px;"/>
<tr:table value="#{roleListBacking.allTRoles}" var="role" emptyText="当前还没有任何角色"
rowSelection="single" binding="#{roleListBacking.table}">
<tr:column>
<f:facet name="header">
<tr:outputText value="角色名称"/>
</f:facet>
<tr:outputText value="#{role.roleName}"/>
</tr:column>
<tr:column>
<f:facet name="header">
<tr:outputText value="角色等级"/>
</f:facet>
<tr:outputText value="#{role.roleLevel}"/>
</tr:column>
<f:facet name="footer">
<tr:panelGroupLayout layout="horizontal">
<tr:commandLink text="查看" action="#{roleListBacking.viewRoleAction}"/>
<tr:spacer width="5"/>
<tr:commandLink text="修改" action="#{roleListBacking.editRoleAction}"/>
<tr:spacer width="5"/>
<!--<tr:commandLink text="删除" action="#{roleListBacking.delRoleAction}"/>--> <tr:spacer width="5"/>


<tr:commandLink text="增加角色" action="ics_role_add"/>
</tr:panelGroupLayout>
</f:facet>
</tr:table>
</tr:form>
</t:div>
</div>
</t:div>
</trh:body>
</trh:html>
</f:view>
</jsp:root>

[解决办法]
恭喜!学习。
[解决办法]
JSF是什么东东 学习了
[解决办法]

探讨
解决了,很简单。


<h:commandLink id="lnkDeleteRole" value="删除"
onclick="if (!confirm('请您确认是否删除,点击确定将删除所有与角色有关的用户和模块!')) return false"
action="#{roleListBacking.delRoleAction}"/>

读书人网 >Java Web开发

热点推荐