jsf ui:repeat 的动态 id 问题
我遇到了一个问题,希望你能帮助我。我正在与 jsf 和 mojarra 合作。我用它创建了一个输入文本矩阵。
<ui:repeat var="farePrice" value="#{baseFareTable.newVersion[stations]}" varStatus="status">
<td class="pic">
<h:inputText id="prueba1" value="#{farePrice.newPrice}" disabled="#{farePrice.disabled}" styleClass="medium_input" maxlength="5" >
<f:convertNumber for="prueba1" maxFractionDigits="1" pattern="0.00"></f:convertNumber>
<f:ajax event="blur" render="prueba1"/></h:inputText>
</td>
</ui:repeat>
它为每个输入文本呈现类似这样的内容
<td class="pic">
<input id="j_idt92:j_idt69:0:j_idt73:1:prueba1" class="medium_input" type="text" onblur="mojarra.ab(this,event,'blur',0,'j_idt92:j_idt69:0:j_idt73:1:prueba1')" maxlength="5" value="0.7" name="j_idt92:j_idt69:0:j_idt73:1:prueba1">
</td>
基本上,我需要限制值,以便始终只查看一位小数,这就是为什么我执行一个ajax调用来呈现自己(通过mojarra.ab方法)和当输入文本失去焦点时,将再次使用转换器编号。问题是当输入文本失去焦点时什么也不会发生。我在外面做这个, ui:repeat 并且它有效。
有人可以帮助我吗?
谢谢
i´m having a problem with which i hope you can help me. I´m working with jsf and mojarra. I create a matrix of inputtext with this.
<ui:repeat var="farePrice" value="#{baseFareTable.newVersion[stations]}" varStatus="status">
<td class="pic">
<h:inputText id="prueba1" value="#{farePrice.newPrice}" disabled="#{farePrice.disabled}" styleClass="medium_input" maxlength="5" >
<f:convertNumber for="prueba1" maxFractionDigits="1" pattern="0.00"></f:convertNumber>
<f:ajax event="blur" render="prueba1"/></h:inputText>
</td>
</ui:repeat>
which renders something like this for each inputtext
<td class="pic">
<input id="j_idt92:j_idt69:0:j_idt73:1:prueba1" class="medium_input" type="text" onblur="mojarra.ab(this,event,'blur',0,'j_idt92:j_idt69:0:j_idt73:1:prueba1')" maxlength="5" value="0.7" name="j_idt92:j_idt69:0:j_idt73:1:prueba1">
</td>
Basically, what i need it´s to restrict the value so only one decimal is always viewed, that´s why i do an ajax call that renders himself (by the mojarra.ab method) and the converterNumber is used again when the inputtext lost the focus. The problem is that nothing happens when the inputtext lost the focus. I´m doing this outside and ui:repeat and it works.
Could anyone help me?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确信 BalusC 很快就会给出更全面的答案,但请尝试使用
而不是
。http://docs.jboss.org/richfaces/latest_3_3_X/en /devguide/html/a4j_repeat.html
I'm sure BalusC will give have a more comprehensive answer soon, but try using
<a4j:repeat>
instead of<ui:repeat>
.http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/a4j_repeat.html