0

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

  • When you say "nothing happens when the inputtext lost the focus" do you mean that the JavaScript event doesn't fire at all or that the input field value does not change as you expect it to? – Ross Oct 20 '11 at 04:10

1 Answers1

0

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

Per H
  • 1,542
  • 10
  • 19