Primefaces 5 with JSF send data to another view from a table

0

Good day, I'm starting to work with JSF and primefaces and I have a question

I have a table with the following code:

  <h:form id="tabla">
    <p:dataTable var="sel" value="#{adminbean.seleccioness}" rows="5"
                         paginator="true"
                         paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15">
        <p:column headerText="Id">
            <h:outputText value="#{sel.pk_equipo}" />
        </p:column>
 
        <p:column headerText="Nombre">
            <h:outputText value="#{sel.nombre}" />
        </p:column>
 
        <p:column headerText="Seudonimo">
            <h:outputText value="#{sel.seudonimo}" />
        </p:column>
 
        <p:column headerText="Continente">
            <h:outputText value="#{sel.continente}" />
        </p:column>
        
    <p:column headerText="Puntaje">
            <h:outputText value="#{sel.puntaje}" />
        </p:column>   
        
        <p:column headerText="Acciones">
             <p:commandButton icon="ui-icon-disk" title="Exportar"></p:commandButton>
             <p:commandButton icon="ui-icon-search" title="Consultar" action="consultasel">
                <f:setPropertyActionListener value="#{sel}" target="#{consultaSelecciones.selselected}" />
             </p:commandButton>
             <p:commandButton icon="ui-icon-trash" title="Eliminar"></p:commandButton>
        </p:column>
         
        <f:facet name="paginatorTopLeft">
            <p:commandButton type="button" icon="fa fa-sync" />
        </f:facet>
 
        <f:facet name="paginatorBottomRight">
            <p:commandButton type="button" icon="fa fa-cloud-upload" />
        </f:facet>
    </p:dataTable>

and I have a button to consult that I want to open another view and show the data there but when I press click I get the following error:

 'Caused by: javax.el.PropertyNotFoundException: Objetivo inalcanzable, 
  identificador 'consultaSelecciones' resuelto a nulo'

this is my bean querySelections

  package com.app.controller;

  import java.io.Serializable;

  import javax.annotation.PostConstruct;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.RequestScoped;
  import javax.faces.bean.ViewScoped;
  import com.app.entity.selecciones;

  @ManagedBean
  @ViewScoped
  public class ConsultaSelecciones{

public selecciones selselected;

@PostConstruct
public void init() {
    selselected = new selecciones();
}   

public selecciones getSelselected() {
    return selselected;
}

public void setSelselected(selecciones selselected) {
    this.selselected = selselected;
}

In my application I do not have the faces-config.xml configured, I do not know if it is for that, or I would like to know that other ways to send this data to another view, it should be noted that the other bean work normal, only this which is within setPropertyActionListener

Thank you very much!

    
asked by Luigi Marquez 11.08.2018 в 17:55
source

0 answers