5 Replies Latest reply on Feb 27, 2007 11:42 AM by Damian Harvey

    ICEFaces SelectInputText (auto-complete)

    Damian Harvey Master

      I have a problem with ICEFaces and Seam using the SelectInputText (auto-complete) component.

      I can display a list well enough and have it limit based on letters typed in. However when I try to add code to get the selected item, it all goes wrong. The offending line in question is:

      SelectInputText autoComplete = (SelectInputText) event.getComponent();

      As you'd expect this casts the incoming component to com.icesoft.faces.component.selectinputtext.SelectInputText. This results in a ClassCastException for me.

      To further frustrate matters I have checked the incoming component class and it is indeed com.icesoft.faces.component.selectinputtext.SelectInputText.
      log.info("Event Component has class :"+event.getComponent().getClass().getName());

      14:38:48,571 INFO [STDOUT] Event Component has class :com.icesoft.faces.component.selectinputtext.SelectInputText

      I have added code to the ICEFaces sample and the only difference that I can see is that when it is passed in by the ICEFaces example it is an instance of SelectInputText, yet for some reason when I pass it in via Seam (and this includes using the sample code in my Seam project) it is not an instance.
      event.getComponent() instanceof com.icesoft.faces.component.selectinputtext.SelectInputText

      Does anyone know why this difference might result? As the ICEFaces sample code doesn't run in my project I assume that it is a configuration issue. Has anyone had ClassCast / instanceOf problems before?