我想使用ui:repeat或任何其他迭代标记为数组列表中的每个项显示一次多个组件。
<!-- print multiple mandates -->
<ui:repeat id="mandates" var="mandate" value="#{taxheadDirectDebit.mandates}">
<a4j:region id="remittanceDetailsSection"
rendered="#{(taxheadDirectDebit.accountFinancialInfo.registration.type != 'PREM') or (taxheadDirectDebit.accountFinancialInfo.registration.type != 'VAT')}">
<!-- Remittance Details -->
<fieldset><legend class="sub"> <h:outputText
value="#{msg['remittanceDetails.title']}" /> </legend>
<!-- Estimated Liability -->
<div class="field">
<div class="label"><label for="allocatedAmount"><h:outputText
for="estimatedLiability"
value="#{msg['remittanceDetails.estimatedLiability']}" /> </label><span
class="requiredFlag">*</span></div>
<div class="error">
<rich:message styleClass="errorText" for="estimatedLiability" />
</div>
<div class="input">
<h:inputText id="estimatedLiability" size="30"
maxlength="11" label="#{msg['registerContractPage1.subTaxNumber']}"
value="#{taxheadDirectDebit.estimatedLiability}">
<a4j:ajax event="change" render="remittanceFrequency" />
</h:inputText>
</div>
<br class="clear" />
</div>
<!-- Is Seasonal -->
<div class="field">
<div class="label"><label for="isSeasonal"> <h:outputText
for="isSeasonal"
value="#{msg['remittanceDetails.isTheNatureSeasonal']}" /> </label><span
class="requiredFlag">*</span></div>
<div class="error"><rich:message styleClass="errorText"
for="isSeasonal" /></div>
<div class="input"><h:selectOneRadio id="isSeasonal"
label="#{msg['remittanceDetails.isTheNatureSeasonal']}"
value="#{taxheadDirectDebit.isSeasonal}"
styleClass="radioLabelTop">
<ddo:twoOptionSelection />
<a4j:ajax event="click" render="remittanceFrequency" />
</h:selectOneRadio></div>
<br class="clear" />
</div>
</fieldset>
</a4j:region>
<!-- Remittance Frequency -->
<a4j:outputPanel id="remittanceFrequency">
<div class="field">
<div class="label"><label for="allocatedAmount"><h:outputText
for="estimatedLiability"
value="#{msg['remittanceDetails.estimatedLiability']}" /> </label><span
class="requiredFlag">*</span></div>
<div class="error">
<rich:message styleClass="errorText" for="estimatedLiability" />
</div>
<div class="input">
<h:inputText id="estimatedLiability" size="30"
maxlength="11" label="#{msg['registerContractPage1.subTaxNumber']}"
value="#{taxheadDirectDebit.estimatedLiability}">
<a4j:ajax event="change" render=":remittanceDetails:mandates:remittanceFrequency" />
</h:inputText>
</div>
<br class="clear" />
</div>
<fieldset><legend class="sub"> <h:outputText
value="#{msg['remittanceDetails.frequency']}" /> </legend>
<!-- Amount to be Debited -->
<div class="field">
<div class="label"><label for="amountEachMonth"><h:outputText
for="amountEachMonth"
value="#{msg['remittanceDetails.amountToBeDebited']}" /> </label></div>
<div class="error"><rich:message styleClass="errorText"
for="amountEachMonth" /></div>
<div class="input"><h:inputText id="amountEachMonth" size="30" readOnly="true"
maxlength="8" label="#{msg['remittanceDetails.amountToBeDebited']}"
value="#{mandate.remittanceDetails.amountEachMonth}">
<a4j:ajax event="change" render="remittanceFrequencyNoDebitedEachMonth"/>
</h:inputText></div>
<br class="clear" />
</div>
<a4j:outputPanel id="remittanceFrequencyNoDebitedEachMonth">
<!-- Months -->
<div class="field">
<div class="grid1"><h:outputText
value=" " /> 
</div>
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.isSeasonal == 1}">
<div class="grid2"><div align="center">
<h:outputText value="#{msg['reviewDetails.reduce']}"/><div align="center"></div>
</div></div>
</rich:panel>
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.action == 'AMEND'}">
<div class="grid3">
<div align="center">
<h:outputText value="#{msg['reviewDetails.suspend']}"/><div align="center"></div>
</div>
</div>
</rich:panel>
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.isSeasonal == 1}">
<div class="grid2">
<div align="center">
<h:outputText value="#{msg['reviewDetails.exclude']}"/><div align="center"></div>
</div>
</div>
</rich:panel>
<br class="clear" />
<div class="floatleft">
<div class="row3">
<div class="row1">
<!-- January -->
<!-- Months Column -->
<div class="grid1">
<label>
<h:outputText readOnly="true" disabled="true" size="4" value="#{msg['calendar.month.0']}" />
</label>
</div>
<!-- Reduce check box -->
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.isSeasonal == 1}">
<div class="grid2">
<div align="center">
<h:selectBooleanCheckbox
id="reduce12"
value="#{mandate.remittanceDetails.remittanceFrequencys[0].reduce}"
disabled="#{mandate.remittanceDetails.remittanceFrequencys[0].exclude}">
<a4j:ajax event="click" render="remittanceFrequency" />
</h:selectBooleanCheckbox>
</div>
</div>
</rich:panel>
<!-- Suspend check box -->
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.isSeasonal != 1}">
<div class="grid2hidden">
<h:outputText value=" " />
</div>
</rich:panel>
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.action == 'AMEND'}">
<div class="grid3">
<div align="center">
<h:selectBooleanCheckbox
id="suspend0"
value="#{mandate.remittanceDetails.remittanceFrequencys[0].suspend}">
<a4j:ajax event="change" />
</h:selectBooleanCheckbox>
</div>
</div>
</rich:panel>
<!-- Exclude check box -->
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.isSeasonal == 1}">
<div class="grid2">
<div align="center">
<h:selectBooleanCheckbox
id="exclude0"
value="#{mandate.remittanceDetails.remittanceFrequencys[0].exclude}"
disabled="#{mandate.remittanceDetails.remittanceFrequencys[0].reduce}">
<a4j:ajax event="change" render="remittanceFrequency" />
</h:selectBooleanCheckbox>
</div>
</div>
</rich:panel>
<rich:panel styleClass="ddo-panel" rendered="#{taxheadDirectDebit.isSeasonal != 1}">
<div class="grid2hidden">
<h:outputText value=" " />
</div>
</rich:panel>
<div class="errorRemittance">
<rich:message styleClass="errorText" for="remittanceAmount0"/>
</div>
<!-- Monthly Amount field -->
<div class="grid5">
<h:inputText
id="remittanceAmount0" size="30" maxlength="8" readOnly="true"
value="#{mandate.remittanceDetails.remittanceFrequencys[0].amount}"
disabled="#{!mandate.remittanceDetails.remittanceFrequencys[0].reduce}"
label="#{msg['remittanceDetails.amountToBeDebited']}">
<a4j:ajax event="change" render="remittanceFrequency" />
</h:inputText>
</div>
</div>
</div>
<div class="errorText" font="bold">
<rich:message styleClass="errorTextNoPadding" for="continue"/>
</div>
</div>
</div>
</a4j:outputPanel>
</fieldset>
</a4j:outputPanel>
<rich:message>
<rich:message for="remittanceFrequency" ajaxRendered="true" />
</rich:message>
</ui:repeat>
我已经拿出了很多我的代码在这里,所以可能有unmacthed div等,但想法是存在的。
我有两个问题:
我试过tr:iterator,c:forEach,a4j:repeat,tr:forEach。我很确定我所尝试的方式是不可能的,所以如果有人有过类似的经验,我会非常感谢你的帮助。我不能更改我正在使用的MVC框架,但可以使用jQuery。
我解决了这个问题,将ajax区域移到重复之外,然后调用整个区域的渲染。我知道不漂亮,但我能找到最快的解决办法。
在消息前端,我只需将列表中的项的索引添加到消息中即可。
"remittanceDetails:mandates:"+taxhead.getMandates().indexOF(mandate)+":remittanceAmount" + frequency.getMonth().getCode()
JSF负责其余的工作。
在提供的 container 里通过指定的 Driver 渲染一个 Rax 元素,并返回该根组件的实例。如果提供了可选的回调函数,该回调将在组件被渲染或更新之后被执行。 注意当首次调用 render 时,会将容器节点里的所有 DOM 元素都替换掉,后续调用时则进行高效更新处理。 方法 render(element, container, options, [callback]) 参数 elemen
描述 (Description) 它包含用于呈现构建视图的模板的逻辑。 语法 (Syntax) view.render() 例子 (Example) <!DOCTYPE html> <html> <head> <title>View Example</title> <script src = "https://code.jquery.com/jquery-2.1.3
类型:(createElement: () => VNode) => VNode 详细: 字符串模板的代替方案,允许你发挥 JavaScript 最大的编程能力。该渲染函数接收一个 createElement 方法作为第一个参数用来创建 VNode。 如果组件是一个函数组件,渲染函数还会接收一个额外的 context 参数,为没有实例的函数组件提供上下文信息。 Vue 选项中的 render 函数
f-render 是专为 vue-ele-form 开发的可视化表单设计工具, 让表单开发的效率更上一层楼! 支持本地启动,告别被墙 所有表单组件属性都可点选,告别不完整的体验 持久化存储,告别刷新就没的尴尬 界面效果:
描述 把模版渲染到 DOM 中: m.render(document.body, "hello") // <body>hello</body> 签名 m.render(element, vnodes) 参数 类型 是否必需 描述 element Element 是 一个 DOM 元素,vnode 会被渲染到该元素内。 vnodes Array|Vnode 是 需要渲染的 vnode 返回 返回 u
ember-render-helpers @ember/render-modifiers as template helpers:{{did-insert}}, {{did-update}}, {{will-destroy}} The original idea came from this Pre-RFC. Installation ember install ember-render-help