[jboss-user] [JBoss Seam] - Converter behavior PROBLEM

urosmil do-not-reply at jboss.com
Wed Sep 12 09:52:53 EDT 2007


Hi,

I'm having problem with jsf converter behavior. 
This is converter code:

public class OfferPriceConvertor implements Converter{
  | 
  | 	public Object getAsObject(FacesContext arg0, UIComponent arg1, String string) {
  | 		BigDecimal price = null;
  | 		try {
  | 			price = new BigDecimal( string );
  | 		} catch (Exception e) {
  | 			price = new BigDecimal(0);
  | 		}
  | 		return price;
  | 	}
  | 
  | 	public String getAsString(FacesContext arg0, UIComponent arg1, Object object) {
  | 		BigDecimal price = (BigDecimal) object;
  | 		BigDecimal minPrice = null;
  | 		try {
  | 			minPrice = new BigDecimal( GlobalProperties.getStaticData("minimum_offer_price") );
  | 		} catch (Exception e) {
  | 			minPrice = new BigDecimal(0);
  | 		}
  | 		return ((price != null && price.doubleValue() > 0) ? price.toPlainString() : minPrice.toPlainString());
  | 	}
  | 
  | }

Converter works ok when page is rendered. 
Problem appears when page is submitted.  Function "getAsObject" is executed BUT instead of entering action method I got same page displayed again.
There are probably some problem inside jsf lifecycle but I don't see anything in console.

These anyone had same problem?
I am interested in any suggestion.

Thanks,
Uros.

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

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



More information about the jboss-user mailing list