I am trying to populate a SelectInputText (auto-complete) field for when a user 
edits a record. The SelectInputText works fine however I need the current value 
to be displayed when a user goes in to edit the record.

I have followed the advice from this thread: 
http://www.icefaces.org/JForum/posts/list/3718.page

But get a NullPointer as my method can't find the JSF component. 

My JSF page has a form (<h:form id="scheduleDate">) and in that form is the 
SelectInputText component (<ice:selectInputText id="unlocode"...)

My code to populate this component is: 

  | //Set the list of matches to the incoming value
  | selectList.add(new SelectItem(scheduleDate.getUnLocode(), 
scheduleDate.getUnLocode().getName()));
  | 
  | //Find the JSF component from the page
  | SelectInputText sit = 
(SelectInputText)FacesContext.getCurrentInstance().getViewRoot().findComponent("scheduleDate:unlocode");
      
  | 
  | //Set the selected item on the component (this is where the null pointer 
occurs
  | sit.setSelectedItem(scheduleDate.getUnLocode().getLocode());
  | sit.setValue(scheduleDate.getUnLocode());
  | 

Am I correct in the notation of "scheduleDate:unlocode"?
Has anyone got a working example of this sort of thing?

Thanks,

Damian.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024688#4024688

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024688
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to