[jboss-user] [JBoss Seam] - Re: SeamSelectItems - 1.1.1beta4

MikeDougherty do-not-reply at jboss.com
Fri Jan 12 13:51:59 EST 2007


Yeah, OK. That makes sense, and I do agree, it is more elegant. I thought maybe there was a performance or functional reason why you were recommending it.

I missed the JAR file description in the document, sorry about that.

I'm still having a bit of trouble with this converter.


  | public class SubjectSelectConverter extends org.jboss.seam.selectitems.jsf.SelectItemsConverter {
  | 
  |     @Override
  |     protected Object convertToObject(FacesContext arg0, UIComponent arg1, String arg2)
  |             throws ConverterException {
  | 	log.debug("convertToObject(#0, #1, #2)", arg0, arg1, arg2);
  | 	return new Subject(arg2, arg2);
  |     }
  | 
  |     @Override
  |     protected String convertToString(FacesContext arg0, UIComponent arg1, Object arg2)
  |             throws ConverterException {
  | 	log.debug("convertToString(#0, #1, #2)", arg0, arg1, arg2);
  | 	return arg2.toString();
  |     }		
  | }
  | 

Gives me:

  | Converter must implement SelectItemsConverter: mil.fits.survey.SubjectFactoryBean$SubjectSelectConverter at 102c93e
  | 

I even tried putting the selectitems-ui.jar in the EAR path to make sure the classloader could see the SelectItemsConverter when it instantiated SubjectSelectConverter. But no such luck. Doesn't make a lot of sense to me.


On a similar subject, I saw someplace that I could define a converter for a specific class globally. According to your post I guess that would be in faces-config.xml. But I didn't bookmark that page, and now cannot seem to find it again. It's sort of off topic, but do you know how I can associate a Converter with a JavaBean globally? It looked something like below, but I can't be absolutely sure.


  |   <converter>
  |      <bean-class>com.foo.app.Subject</bean-class>
  |      <converter-class>com.foo.app.SubjectConverter</converter-class>
  |   </converter>
  | 

Thanks again for your help.

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001066



More information about the jboss-user mailing list