title: Target Unreachable, identifier 'OrderBean' resolved to null
body: <p>Hi i created one <code>dataTable</code> using Primefaces,and i created link to the name column of the <code>dataTable</code>. Now it should move on the next page and display its selected row contents in the next page once i click on the name link but i am getting the following error:</p>
  
  <pre><code>javax.el.PropertyNotFoundException: /view.xhtml at line 50 and column 81 target="#{OrderBean.selectedOrder}": Target Unreachable, identifier 'OrderBean' resolved to null
    at org.apache.myfaces.view.facelets.el.TagValueExpression.setValue(TagValueExpression.java:121)   at org.apache.myfaces.view.facelets.tag.jsf.core.SetPropertyActionListenerHandler$SetPropertyListener.processAction(SetPropertyActionListenerHandler.java:110) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:51)
          at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:344)
          at javax.faces.component.UICommand.broadcast(UICommand.java:103)
          at javax.faces.component.UIData.broadcast(UIData.java:761)
          at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:973)
          at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:275)
          at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1285)
          at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:711)
          at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:34)
          at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171) 
     when i click on the link. Can anyone plz help me resolve this error out.check whether i made any mistake in the setpropertyaction Listener ??? 
    if so plz post the  correct code. I am waiting the answers please help me to clear the error using jas 2.0 and primefaces.
  </code></pre>
  
  <p><strong>view.xhtml</strong></p>
  
  <pre><code>&lt;p:dataTable id="dataTable" var="v" value="#{order.orderList}"  paginator="true" rows="3" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                 rowKey="#{order.year}" rowsPerPageTemplate="6,9"&gt;
  
      &lt;f:facet name="header"&gt;  
         Data Table
      &lt;/f:facet&gt;  
  
      &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
            &lt;h:outputText value="Name" /&gt;
  
          &lt;/f:facet&gt;
             &lt;p:commandLink value="#{v.name}"  action="/nextpage.xhtml?faces-redirect=true" rowSelectListener="#{orderBean.onRowSelectNavigate}" &gt; 
   &lt;f:setPropertyActionListener value="#{v}" target="#{orderBean.selectedOrder}"/&gt; 
  
  &lt;/p:commandLink&gt;
  
  
      &lt;/p:column&gt;  
  
      &lt;p:column&gt;  
          &lt;f:facet name="header"&gt;  
           &lt;h:outputText value="Year" /&gt;
          &lt;/f:facet&gt;  
          &lt;h:outputText value="#{v.year}" /&gt;  
      &lt;/p:column&gt;  
       ----------&lt;/p:datatable&gt;
  </code></pre>
  
  <p><strong>OrderBean.java</strong></p>
  
  <pre><code>import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.Arrays;
  
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  import javax.faces.bean.ViewScoped;
  import javax.faces.context.FacesContext;
  
  import org.primefaces.event.SelectEvent;
  
  @ManagedBean(name="order")
  @SessionScoped
  @ViewScoped
  
  public class OrderBean implements Serializable{
  
  
      private static final long serialVersionUID = 1L;
      String name;
      int year;
      String company;
      String number;
      private Order selectedOrder;
  
      public Order getSelectedOrder() {
          return selectedOrder;
      }
      public void setSelectedOrder(Order selectedOrder) {
          this.selectedOrder = selectedOrder;
      }
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public int getYear() {
          return year;
      }
  
      public void setYear(int year) {
          this.year = year;
      }
  
      public String getCompany() {
          return company;
      }
  
      public void setCompany(String company) {
          this.company = company;
      }
  
      public String getNumber() {
          return number;
      }
  
      public void setNumber(String number) {
          this.number = number;
      }
  
      private static final ArrayList&lt;Order&gt; orderList = 
          new ArrayList&lt;Order&gt;(Arrays.asList(
  
          new Order("vidhya",2020,"IT","1"),
          new Order("madhu",1021,"BT", "2"),
          new Order("manu",3846,"Mech","3"),
          new Order("shruthi",5647,"Benz","4")
  
      ));
  
      public ArrayList&lt;Order&gt; getOrderList() {
  
          return orderList;
  
      }
  
      public String addAction() {
  
          Order order = new Order(this.name, this.year, 
              this.company, this.number);
  
          orderList.add(order);
  
          return null;
      }
  
  
  
      public static class Order{
  
          String name;
          int year;
          String company;
          String number;
  
  
  
          public Order(String name, int year, 
                  String company, String number) {
              this.name = name;
              this.year = year;
              this.company = company;
              this.number = number;
          }
  
          public String getName() {
              return name;
          }
          public void setName(String name) {
              this.name = name;
          }
          public int getYear() {
              return year;
          }
          public void setYear(int year) {
              this.year = year;
          }
          public String getCompany() {
              return company;
          }
          public void setCompany(String company) {
              this.company = company;
          }
          public String getNumber() {
              return number;
          }
          public void setNumber(String number) {
              this.number = number;
          }
  
          public String moveToNextPage(){
              return "nextpage";
          }
          public String onRowSelectNavigate(SelectEvent event) {   
                 FacesContext.getCurrentInstance().getExternalContext().getFlash().put("selectedOrder", event.getObject());   
                 return "nextpage?faces-redirect=true";   
             }   
  </code></pre>
  
  <p><strong>nextpage.xhtml</strong></p>
  
  <pre><code>&lt;h:panelGrid id="display" columns="2" cellpadding="4" &gt;  
          &lt;f:facet name="header"&gt;  
          details 
          &lt;/f:facet&gt; 
          &lt;h:outputText value="Name:" /&gt;  
          &lt;h:outputText value="#{orderBean.selectedOrder.name}" /&gt;  
  
          &lt;h:outputText value="Year:" /&gt;  
          &lt;h:outputText value="#{orderBean.selectedOrder.year}" /&gt;  
  
          &lt;h:outputText value="Company:" /&gt;  
          &lt;h:outputText value="#{orderBean.selectedOrder.company}" /&gt;  
  
          &lt;h:outputText value="Number:" /&gt;  
          &lt;h:outputText value="#{orderBean.selectedOrder.number}" /&gt;    
      &lt;/h:panelGrid&gt; 
  </code></pre>