0

I have the following issue.

Here is the JSF template client:

<h:selectOneRadio value="#{booking.actividad}"
                                  layout="pageDirection">
                    <f:selectItems value="#{actividadesClientBean.actividadesByFechaMayor}"
                                   var="m"
                                   itemValue="#{m.id}"
                                   itemLabel="#{m.nombre}"/>
 </h:selectOneRadio>

The value tag on h:selectIneRadio is supposed to save the selectedItem in actividad String variable on the booking Bean. But when selected, nothing happens. It saves null... The Items are correctly rendered, and all what has to do with the UI is correct. I've been looking for the error four hours and nothing. Hope you can help me. Thanks!

Bean code:

@Named
@FlowScoped("booking")
public class Booking implements Serializable {


    @PersistenceContext
    private EntityManager em;
    private double precioC = new Double(0);
    private String tarjeta = "";
    private String actividad;

    public String getActividad() {
        return actividad;
    }

    public void setActividad(String actividad) {
        this.actividad = actividad;
    }
    .......
    .......
    More code

It's the first time I work with a faces-flow. It might be something related with it. But I'm not quite sure. Here is my flow-chart:

<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
    <flow-definition id="booking">
        <flow-return id="goHome">
            <from-outcome>/users/privatepage</from-outcome>
        </flow-return>
    </flow-definition>
</faces-config>
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
deadlock
  • 164
  • 1
  • 14
  • Can you post all the significant part of your page, to recreate a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)? – WoAiNii May 24 '20 at 09:30
  • How does your action and save button look like? If you have problems with flow scope, try it with session or ViewScope to check if that’s your problem. – TomStroemer May 25 '20 at 18:22
  • https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value – Kukeltje May 25 '20 at 18:25
  • the problem was that the h:rm tags were missing – deadlock May 25 '20 at 22:59
  • @ignacioaranguren - I hope the solution for [this question](https://stackoverflow.com/questions/61974822/error-writing-java-util-date-into-json-file) worked for you. Do not forget to accept the answer so that future visitors can also use the solution confidently. Feel free to comment in case of any doubt/issue. – Arvind Kumar Avinash Jun 07 '20 at 15:52

0 Answers0