2 Replies Latest reply on Apr 23, 2010 12:31 PM by Stanimir Stamenkov

    Component.getInstance(String) for non-component (non-Seam component) value

    Stanimir Stamenkov Newbie

      The API documentation [1] lacks a formal contract and I haven't been able to find out elsewhere whether using org.jboss.seam.Component.getInstance("varName") is valid to lookup a non-Seam component value, e.g. there's a factory method defined as:


          @Factory("dataList")
          public List<String> initDataList() {
              List<String> dataList;
              // Initialize the list.
              return dataList;
          }



      Then somewhere else one invokes:


          List<String> dataList = (List<String>) Component.getInstance("dataList");



      Is the given usage o.k.?


      [1] http://docs.jboss.org/seam/2.0.2.SP1/api/org/jboss/seam/Component.html#getInstance(java.lang.String)