我有一个页面,我编辑一些实体.该页面有两个命令按钮.一个是"后退",一个是"保存",并且在该页面上我还有输入字段(idInputSubject).其中一些是必需的,一些则不是.
如何确保我按"后退"按钮(取消编辑并返回)验证将被忽略,现在情况并非如此.现在,当我按下"返回"或"保存"按钮时,如果我没有用正确的值(idInputSubject)填充所需的文件,则会出现验证消息.
"后退"和"保存"按钮的形式相同:
<h:form id="idFormMeasureDetail" styleClass="bodyForm" prependId="false">
...
<p:commandButton value="#{contentMB.msg.label_back.value}"
action="#{chooseMeasureControllerMB.aSearch}"
rendered="#{detailMeasureMB.navigation eq 0}" ajax="false"
icon="ui-icon-arrowreturnthick-1-w"/>
<p:commandButton value="#{contentMB.msg.button_save.value}" ajax="false"
icon="ui-icon-disk" actionListener="#{detailMeasureControllerMB.alApplyChanges}"
title="#{contentMB.msg.tip_Apply.value}" />
...
<p:inputTextarea id="idInputSubject" value="#{detailMeasureMB.measure.aufgabe}"
readonly="#{!userSessionMB.supervisor and !detailMeasureMB.isCreator}"
required="#{globalSessionMB.globalWebOptionsMap['MMRequiredSubject'].propvalue}"
title="#{contentMB.msg.tip_Betreff.value}"
autoResize="false" style="width:100%;" >
</p:inputTextarea>
<p:message id="inputSubjectMsg" for="idInputSubject" display="icon" />
...
</h:form>
Run Code Online (Sandbox Code Playgroud)
ChooseMeasureControllerMB:
@ManagedBean(name = "chooseMeasureControllerMB")
@RequestScoped
public class ChooseMeasureControllerMB extends BaseMeasureControllerMB {
...
public String aSearch() {
...
// navigate to target-page
return "/pages/mm/showMeasuresList.xhtml?faces-redirect=true";
}
...
}
Run Code Online (Sandbox Code Playgroud) 我真的很想知道这究竟意味着什么?
我是否可以在开发中使用JBoss 7,还可以在生产中使用所有EE 6功能(我需要JMS,EJB 3.1,JSF 2.1,CDI ......)或者我必须等待JBoss 7的更高版本?
如果没有,那么选项是什么,因为JBoss 6.x只是经过Web Profile认证,对"仅限Web Profile认证"有什么解释?
谢谢
我有面板仪表板:
<p:dashboard id="board" model="#{dashboardOptionsMB.model}">
<c:forEach var="item" items="#{dashboardOptionsMB.emsWidgets}">
<ui:include src="/pages/dashboard/panel.xhtml">
<ui:param name="widget" value="#{item.webDashboardDbBean}" />
<ui:param name="emsValue" value="#{item.emsValue}" />
</ui:include>
</c:forEach>
</p:dashboard>
Run Code Online (Sandbox Code Playgroud)
我dashboardOptionsMB.emsWidgets在渲染页面之前加载了一个包含内容的列表,这适用于面板组件:
panel.xhtml:
<p:panel id="#{widget.widgetid}" header="#{widget.widgetheader}" closable="true" >
<h:outputText value="#{emsValue.value}" />
...
</panel>
Run Code Online (Sandbox Code Playgroud)
因此,在每次渲染之前,我使用此方法使用所有元素和内容初始化列表:
DashboardOptionsMB:
private void initWidgets(WebDashboardsDbBean dashboard) {
//dashboard is JPA entity from database
emsWidgets = dashboard.getWidgets();
...
}
Run Code Online (Sandbox Code Playgroud)
我想要实现的是在页面加载后动态加载每个面板内容.例如,每个面板应调用:
initWidget(String widgetId)
Run Code Online (Sandbox Code Playgroud)
页面加载后,以及此方法完成后更新其内容.
有没有办法设置Firefox和Chrome在h:outputText标记中使用escape = false属性.当某些html需要在浏览器中显示时,Firefox和Chrome会正确显示已解析的字符串,但应用程序中的任何其他链接都会被冻结(??).
来自db的示例html:
<HEAD>
<BASE href="http://"><META content="text/html; charset=utf-8" http-equiv=Content-Type>
<LINK rel=stylesheet type=text/css href=""><META name=GENERATOR content="MSHTML 9.00.8112.16434">
</HEAD>
<BODY><FONT color=#000000 size=2 face="Segoe UI">läuft nicht</FONT></BODY>
Run Code Online (Sandbox Code Playgroud)
在页面上解析HTML:
läuftnicht
非常奇怪的是,在IE中一切正常(通常是相反的).
我使用primefaces组件(v2.2),. xhtml,tomcat 7和JSF 2.0