-
1. Re: Converter Issue
rvkishore Nov 29, 2007 12:40 PM (in response to rvkishore)Going through some other postings I believe that s:selectitems is going to have a "itemValue" attribute soon. Any idea when that is going to be out? In the meanwhile is there any workaround for this issue
-
2. Re: Converter Issue
rvkishore Nov 29, 2007 2:03 PM (in response to rvkishore)It works fine after I added a categoryConverter.
-
3. Re: Converter Issue
pmuir Nov 30, 2007 5:49 AM (in response to rvkishore)In 2.0.1, out very soon now.
-
4. Re: Converter Issue
igx89 Nov 30, 2007 1:11 PM (in response to rvkishore)"very soon" likely being ~4 weeks, based on the rate of bugfixing since 2.0.0.GA a month ago :)
-
5. Re: Converter Issue
xshuang Nov 30, 2007 1:27 PM (in response to rvkishore)Good afternoon rvkishore,
Could you post your categoryConverter so that I can have a temporary workaround also?
Thanks a lot,
Sheng -
6. Re: Converter Issue
pmuir Dec 1, 2007 6:33 PM (in response to rvkishore)Probably much less than 4 weeks :) Yes, we are deliberately vague about release schedules so that we can release when we feel ready rather than look stupid when the date slips.
But very soon means within a week or two. -
7. Re: Converter Issue
igx89 Dec 1, 2007 8:14 PM (in response to rvkishore)Good to hear! Can't wait to be able to use itemValue, along with all the other changes that have been/will be done :)
-
8. Re: Converter Issue
rvkishore Dec 2, 2007 7:39 PM (in response to rvkishore)xshuang,
below is the code for my CategoryConverter.import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.ConverterException; import org.jboss.seam.Component; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.faces.Converter; import com.datalette.actions.CategoryIntf; import com.datalette.model.Category; @Name("categoryConverter") @Converter public class CategoryConverter implements javax.faces.convert.Converter { public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException { Integer i = new Integer(value); CategoryIntf categoryAction = (CategoryIntf)Component.getInstance("categoryAction"); return categoryAction.getCategory(i); } public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException { return ((Category)value).getId().toString(); } }
-
9. Re: Converter Issue
xshuang Dec 3, 2007 8:54 AM (in response to rvkishore)Good morning rvkishore,
Thanks a lot for your reply. It seems that reference objects retrieved using <framework:entity-query> and using entityManager.createQuery() are different, possibly due to different memory location.
An equals() method of the reference class also helps to solve the "value is invalid" error. Basically it check the Id and returns true if ids of two reference objects are the same.
Have a nice day!
Best regards,
Sheng