Another question regarding tapestry programming style.
Imagine I have a read-only property of some object which I need to include in
a hidden field in a form so that the value is still there after posting the
form. Since tapestry does not support read-only properties in forms, I need a
second read-write property which takes care of storing the value after post.
What I have done (inside a component class) looks like this:
// my read only property which I want to include in the form
@Parameter()
public abstract Object getReadOnlyValue();
// the property used for the form hidden field
public Object getHiddenFormValue() {return getReadOnlyValue();}
public void setHiddenFormValue(Object o) {setSomeOtherProperty(o);}
// the property where tapestry can store the hidden field value
// when submitting the form
public abstract Object getSomeOtherProperty();
public abstract void setSomeOtherProperty(Object o);
// my form submit listener
public void listener()
{
Object o = getSomeOtherProperty(); // allright, here is my value again
}
OK, it works, but IMO it is quite confusing and does not look so nice...
Question: Are there better solutions for this problem?
--
Bastian Voigt
Neumünstersche Straße 4
20251 Hamburg
telefon 040/67957171
mobil 0179/4826359
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]