Primefaces SelectOneRadio outcome page with change

236 Views Asked by At

A basic problem, i guess, but i cannot get it to work: with changing the selection in primefaces selectoneradio a backing bean should be called and afterwards a new page should be loaded. as there is no action attribute, how can i solve this?

i also tried to solve it with f:ajax, but could not get it to work

jsf:

<p:selectOneRadio value="#{controller.selectedValue}">
   <f:selectItems value="#{controller.getListValues()}" var="item"/>
   <f:ajax event="click" listener="#{controller.execute()}"/>
</p:selectOneRadio>

backing bean:
public String execute() {
   doSomething();
   return "new-page.jsf"; 
}

so what i want to have is, that the user clicks on a radio button, something should be executed, and the outcome is then new-page.jsf

0

There are 0 best solutions below