Tuesday 15 July 2014

ajax - Primefaces - ui:repeat component does not update -


I have a problem updating an AJAX: Update has started from a command button outside the replication UI: Repeat (See code below). The variable priceHour is needed to calculate other prices (week, mon .. ..)

  & lt; H: form id = "myForm" & gt; & Lt; Ui: repeating id = "alvs" var = "alv" value = "# {myBean.allV}" & gt; & Lt; H: Panel group provided = "# {alv.status == 'ON'}" & gt; & Lt; Div class = "pricing" & gt; & Lt; H: output text style class = "bold" value = "# {alv.shortName}:" /> & Lt; P: Input Text = "# {alv.priceHour}" id = "hours" required = "true" & gt; & Lt; F: convertor pattern = "###" type = "currency" /> & Lt; / P: inputText> & Lt; P: inputtext value = "# {alv.priceDay}" id = "days" & gt; & Lt; F: convertor pattern = "###" type = "currency" /> & Lt; / P: inputText> & Lt; P: inputtext value = "# {alv.priceWeek}" id = "week" & gt; & Lt; F: convertor pattern = "###" type = "currency" /> & Lt; / P: inputText> & Lt; P: inputtext value = "# {alv.priceMonth}" id = "month" & gt; & Lt; F: convertor pattern = "###" type = "currency" /> & Lt; / P: inputText> & Lt; / Div & gt; & Lt; / H: panelGroup & gt; & Lt; P: Message / & gt; & Lt; / Ui: Repeat & gt; & Lt; P: command button value = "calculator" action1 = "# {myBean.priceCalc}" process = "@ this, alvs: hour" update = "lvs" /> & Lt; / H: form & gt;   

When I click on the button, nothing happens and the UI: Repeat and prices are not updated. what is wrong?
I also tried to update "myForm: alvs" , update: myForm: alvs ": nothing!
I am using primetime 3.5 thanks in advance

U : Repeat is not a rendered component, so you can not see anything in HTML about it. You can not make any updates that have not been sung. Apart from this, there is also no id feature in ui: repeat code .

For your ui: repeat example h: panelGroup inside:

  & lt ; H: panelGroup id = "alvs" & gt; & Lt; Ui: Repeat ... & gt; & Lt; / Ui: Repeat & gt; & Lt; / H: panelGroup & gt;   

and update the panel set in your button:

  & lt; P: commandButton value = "calculator" actionListener = "# {myBean.priceCalc}" process = "@ this, alvs" update = "alvs" />   

Note that I removed : hour because you can not see it, each ID will be different for repeating.

More info:



No comments:

Post a Comment