--Andrew
On 10/21/05, Chantal Ackermann <[EMAIL PROTECTED]> wrote:
Hello all,
thanks for this nice framework.
My project is an interface to insert the data of a questionnaire into a
database. The pages are mostly forms forms forms...
Now i want to have on one page something like an editable combo box (at
least that would be the widget of choice in Swing) (in fact several of
them - there are several similar blocks on that page). So i put a combo
box on the page and a textfield with a button there. All of them are
part of a bigger form so that i have to use a wicket button inside a
wicket form for it (imho). It should be possible to change the combo
boxes by typing into the textfields and hitting the button next to it.
My page class is structured like:
Constructor() - add the BigForm instance
private class BigForm - add the blocks (for several questions of the
questionnaire) through several calls to the method addModule()
- addModule() adds a textarea, the combobox, the textfield and
the button
private class MyButton - overwrites onSubmit to make the textfield
value persistent (Dao, Hibernate etc.) and to reload the appropriate
Combobox (using combobox.updateModel())
My class uses a CompoundPropertyModel which is backed by the Pojo that
represents all the properties set by the BigForm instance - except of
course the textfield which in fact is just a helper for the user to add
new values to the comboboxes more quickly. Thus, the textfield has no
property neither in the model nor in the backing pojo.
I tried to use a PropertyModel just for the Textfield and use that
again inside the button class to get hold of the textfield value. But
this obviously does not work? do i have to add the textfield directly
to my page not to the BigForm instance?
I'd appreciate any help or enlightment on the handling of the models.
I'm a Java Swing developer and rather poor on the html side.
I attach the class and the html template to this mail as it might help
to look at the code. (Don't wonder about the names - i used some simple
names in the mail. The actual names are different.)
Thanks in advance,
Chantal
