3 Replies Latest reply on Nov 15, 2012 5:09 PM by Sascha Herrmann

    casting ViewObject to CustomViewObjectImpl

      Hello everybody,

      I created DeviceViewImpl via wizard from DeviceView.xml and I want to utilize. (I need to insert some new rows in it).
      I wrote this code into managed bean:
              Object obj = BeanHelper.getBindings().get("DeviceView1");
              JUCtrlListBinding julb = (JUCtrlListBinding) obj;
              ViewObject vo = julb.getViewObject();
              DeviceViewImpl dvi = (DeviceViewImpl) vo;
      But last line throws ClassCastException and I am not sure why. I can probably achieve my goal with instance of general ViewObject, but I guess it is not very typesafe solution..
      All advices appreciated. thanks

      Edited by: adekcz on 14.11.2012 7:41