|
|
@ -2,7 +2,7 @@ package info.bukova.isspst.ui;
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.zkoss.bind.SimpleForm;
|
|
|
|
import org.zkoss.bind.SimpleForm;
|
|
|
@ -34,12 +34,32 @@ public class BindingForm<T> extends SimpleForm {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void bindTo(T object) {
|
|
|
|
public void bindTo(T object) {
|
|
|
|
for (String key : getFieldNames()) {
|
|
|
|
for (String key : getFieldNames()) {
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
BeanUtils.setProperty(object, key, getField(key));
|
|
|
|
// BeanUtils.setProperty(object, key, getField(key));
|
|
|
|
} catch (IllegalAccessException e) {
|
|
|
|
//
|
|
|
|
|
|
|
|
// } catch (IllegalAccessException e) {
|
|
|
|
|
|
|
|
// logger.warn("Cannot bind value", e);
|
|
|
|
|
|
|
|
// } catch (InvocationTargetException e) {
|
|
|
|
|
|
|
|
// logger.warn("Cannot bind value", e);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PropertyUtils.setProperty(object, key, getField(key));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (NoSuchMethodException e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logger.warn("Cannot bind value " + key + " (" + e.getMessage() + ")");
|
|
|
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (IllegalAccessException e)
|
|
|
|
|
|
|
|
{
|
|
|
|
logger.warn("Cannot bind value", e);
|
|
|
|
logger.warn("Cannot bind value", e);
|
|
|
|
} catch (InvocationTargetException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (InvocationTargetException e)
|
|
|
|
|
|
|
|
{
|
|
|
|
logger.warn("Cannot bind value", e);
|
|
|
|
logger.warn("Cannot bind value", e);
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|