2 Replies Latest reply on May 27, 2009 1:35 AM by Jon-Erik Schneiderhan

    rich:orderingList selection not injecting

    Ian McMahon Newbie

      I have a rich:orderingList which displays a list of routes, and one of the things it does is populate a selected= collection in the backing bean.  I setup selectedRoutes as an @In Collection, but it's null when I enter either of the action methods.  @In String newPoint is being injected properly, and the add point method works fine.

                      <rich:orderingList id="pointList" value="#{route.routePoints}" selected="#{selectedRoutes}" var="point" listHeight="300" listWidth="350">
                          <rich:column  width="180">
                              <f:facet name="header">
                                  <h:outputText value="Waypoint" />
                              <h:outputText value="#{point.waypoint.identifier}"/>
                          <h:inputText id="newPoint" value="#{newPoint}" required="false"/>
                          <a:commandButton action="#{routeManager.addPoint()}" value="Add New" reRender="pointList"/>
                          <a:commandButton action="#{routeManager.delSelected()}" value="Del Selected" reRender="pointList"/>

          private Route route;
          private String newPoint;
          private Collection<RoutePoint> selectedPoints;
          public void getRoute() {
              route = (Route)em.createQuery("Select r from Route r where r.id = 1").getSingleResult();
          public void addPoint() {
              if(newPoint == null || newPoint.equals("")) return;
              route.addWaypoint(new Waypoint(newPoint));
          public void delSelected() {
              if(selectedPoints==null) return;
              for(RoutePoint p:selectedPoints) {