That's strange. Your PropertyConduit implementation and use looks correct
to me. Could you post the full stack trace please? The datatype is defined
by the DataTypeAnalyzer service, and its configuration provided by
Tapestry alread maps BigDecimal to the "number" datatype.
On Thu, 24 Feb 2011 14:02:14 -0300, Stephan Windmüller
<stephan.windmuel...@tu-dortmund.de> wrote:
On Thu, 24. Feb 2011, Thiago H. de Paula Figueiredo wrote:
The resulting model contains properties with a null datatype.
That surely looks like something you shouldn't do. How can the component
know how edit an value which hasn't a data type? In this case, you
either
define a custom datatype and provide edition and viewing blocks for them
or you don't add this property to the bean model.
It's a simple number. Okay, not simple, but BigDecimal.
However, I did not set/change the datatype myself, as you can see in the
posted code.
If you need more information like how I build the PropertyConduit,
please let me know.
Please post it.
private void addPropertyConduitsToBeanModel(BeanModel<TreatmentModel>
model) {
for (final ValueType valueTypes : dao.getValueTypes()) {
PropertyConduit propertyConduit = new PropertyConduit() {
public Object get(Object instance) {
MyObject myObject = (MyObject) instance;
return model.getValue(valueType);
}
public void set(Object instance, Object value) {
MyObject myObject = (MyObject) instance;
BigDecimal myValue = (BigDecimal) value;
myObject.setValue(valueType, value);
}
public Class getPropertyType() {
return BigDecimal.class;
}
public <T extends Annotation> T getAnnotation(Class<T>
annotationClass) {
return null;
}
};
String propertyName = valueType.getName();
model.add(propertyName, propertyConduit);
}
}
- Stephan
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com
Ênfase em Java da Faculdade Pitágoras
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org