我的问题是在我的主页上,我capacidade
完全得到了变量.然后我有那个c:forEach
和另一个名字的字段"nome"
.当我试图坚持,然后我capacidade
填补了字段,但"nome"
属性来了null
.我看到如果我在他之前推他c:forEach
,那它就有效了.但是我需要让他在c:forEach
田野之后.
<s:decorate template="layout/form.xhtml">
<ui:define name="label">capacidade:</ui:define>
<h:inputText size="50" value="#{home.instance.capacidade}" maxlength="100" required="true" />
</s:decorate>
<a4j:outputPanel id="camposPresenca">
<c:forEach items="#{home.presencas}" var="presenca" varStatus="loop">
<s:decorate template="layout/form.xhtml">
<ui:define name="label">Presença #{loop.index + 1}</ui:define>
<rich:calendar enableManualInput="true" value="#{presenca.dataPresenca}" datePattern="dd/MM/yyyy" oninputblur="validarData(this);" required="true"/>
<h:inputText size="100" value="#{presenca.horarioPresenca}" maxlength="250" />
</s:decorate>
</c:forEach>
</a4j:outputPanel>
<s:decorate template="layout/form.xhtml">
<ui:define name="label">Nome:</ui:define>
<h:inputText size="50" value="#{home.instance.nome}" maxlength="100" required="true" />
Run Code Online (Sandbox Code Playgroud)
有人知道如何解决这个问题吗?
请帮我理解,
<h:form>
<h:panelGrid columns="3">
<h:outputText value="Age:"/>
<h:inputText value="#{userBean.age}" size="4"/>
<a4j:commandButton value="Enter Age" reRender="age"/>
</h:panelGrid>
<h:panelGrid>
<h:outputText id="age" value="Your age: #{userBean.age}"/>
</h:panelGrid>
</h:form>
Run Code Online (Sandbox Code Playgroud)
当单击commandButton时,它如何评估bean以调用setter.它是否从输入区域内使用的bean中得到了补偿?
谢谢
我面临一个非常奇怪的问题.我正在使用jsf 1.2和richfaces 3.3.3构建一个Web应用程序.我没有加载任何外部jquery版本,而是坚持富表面提供的默认版本,即jquery版本1.3.2.我使用'jQuery'关键字访问默认的jquery.
我在页面顶部包含了一些javascript文件,其中包含jquery.当我从该页面中删除所有richfaces组件时,它看起来像是没有加载jquery.那是在控制台上,我看到消息'jQuery is undefined'.但是当我在页面中包含"rich:extendedDataTable"标记时,此错误就会消失.奇怪的是,如果我包含'rich:dataTable',错误仍然存在.只有当我使用'rich:extendedDataTable'时,看起来jQuery才会加载到我的页面中.所以我现在做的是在页面上放置一个'rich:extendedDataTable',因为mo的原因和render是'False'.我不确定这有多大意义.
jsf包含在页面顶部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../../styles/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../../styles/Stylesheet.css" rel="stylesheet" type="text/css" />
<script src ="first.js" language="JavaScript"/>
<script src ="second.js" language="JavaScript"/>
<script src ="validation.js" language="JavaScript"/>
Run Code Online (Sandbox Code Playgroud)
在控制台上看到的错误是 ReferenceError:未定义jQuery
这里发生了什么?Wy看起来只有在我包含特定的丰富组件时才会加载jquery.即使在该页面中没有加载丰富的组件,我如何使用jQuery在我的apge bby默认值上可用
我正在使用<rich:select/>
元素从列表中选择一个元素,并且需要在用户更改所选元素后执行操作.我写了这个:
<rich:select ... >
<f:selectItems ... />
<a4j:ajax listener="#{...}" event="change" render="..."/>
</rich:select>
Run Code Online (Sandbox Code Playgroud)
并面临一个问题:change
只有当<rich:select>
焦点丢失时才会发生事件.change
当用户选择它的第一个值(来自空的默认值)时,事件根本不起作用.
如何在选择更改后立即调用操作?
我为JSF中的selectOneMenu创建了这个valueChangeListener:
<a4j:region>
<a4j:repeat>
<label class="select">
<h:selectOneMenu id="onlyThis" value="#{bean.prio}"
valueChangeListener="#{bean.prioChangeListener}" >
<f:selectItems value="#{bean.prioSelectItems}" />
</h:selectOneMenu>
</label>
</a4j:repeat>
</a4j:region>
Run Code Online (Sandbox Code Playgroud)
我不明白为什么这个valueChangeListener不会被执行的原因,如果在xhtml页面中选择了另一个值.
我的代码中有错误吗?豆是以正确的方式宣布的
版本:
Apache MyFaces 2.0 Rich Faces 4.3
问题 :
我们正在从JSF 1.2迁移到JSF 2.
由于没有内置支持对rich:dataTable进行排序,因此我们根据富面展示使用自定义排序解决方案.排序工作正常,唯一的问题是因为a4j:commandLink用于排序操作触发器,列标题文本带有"下划线"样式.有没有办法删除下划线a4j:commandLink
?丰富的面孔展示没有显示任何造型a4j:commandLink
?
请帮忙.
我有jsfunction
<a4j:jsFunction action="#{myBean.action}"
data="#{myBean.data}" render="@form" execute="@form" name="openConfirm"
onbeforedomupdate="openConfirmDialog(event.data);"></a4j:jsFunction>
Run Code Online (Sandbox Code Playgroud)
我需要打开一个确认对话框(在 onbeforedomupdate 上,这有效..但是打开所有调用的对话框)我真的需要只有在验证 jsf 提交时才打开对话框表单。验证错误显示表单未验证的时间。
在脚本中识别 JSF 循环是否返回验证错误的最佳方法是什么?
我需要类似于 onbeforedomupdate="if (event.validationError==false)showDialog();"
多谢,
我有2个Facelets文件(index.xhtml和report.xhtml).我使用RichFaces <ui:include src="report.xhtml"/>
将报告加载到索引中.工作良好.但是,当我尝试仅显示某些条件的报告时,我失败了!什么不起作用是这样的:
<ui:include src="report.xhtml" rendered="#{indexService.contentName == 'report'}"/>
.
ui:include的呈现属性似乎不起作用.
如何在某些条件下将report.xhtml加载到index.xhtml中?我的代码中的错误在哪里?
编辑:
其中一半现在有效.更改Facelet文件适用于条件.但加载的Facelet的功能无法正常工作.这是为什么?代码中的问题在哪里?
基于我现在的建议:
<h:form>
<h:panelGrid>
<a4j:commandLink value="Home" render="contentpanel" action="#{indexService.setContentName('home')}"/>
<a4j:commandLink value="Report" render="contentpanel" action="#{indexService.setContentName('report')}"/>
</h:panelGrid>
</h:form>
<a4j:outputPanel id="contentpanel">
<ui:fragment rendered="#{indexService.contentName eq 'report'}">
<ui:include src="report.xhtml" />
</ui:fragment>
</a4j:outputPanel>
Run Code Online (Sandbox Code Playgroud)
编辑2:
这是我的报告Facelet.如果我在没有任何条件的情况下使用报告Facelet的功能完美,但如果我使用我在编辑1中发布的条件加载它,那么按钮<rich:panelMenuItem .../>
不再起作用并且<h:outputText escape="false" value="#{reportService.content}"/>
不加载内容.知道为什么吗?
编辑3:
改变了<rich:panel header="Report">...</rich:panel>
,但行为仍未改变.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
<h:outputStylesheet>
.placesmenu {
width: 200px;
vertical-align: top;
}
.contentplace {
vertical-align: …
Run Code Online (Sandbox Code Playgroud) <f:view>
标签是否应该在标签外面(周围)<rich:page>
?还是里面呢?
请注意,我确实想要一个<f:view>
标签,因为我想设置locale.