I am writing a (simple?) database CRUD app where I have multiple tab
panels that encapsulate the different tables in the database.  On a
panel there's a dropdownchoice which lists the existing records for that
table.  There's also create, delete and edit buttons (and and edit panel
with save and cancel buttons).  When I create, edit or delete any of the
records, the dropdownchoice list doesn't reflect the changes until I
open a new session.  So my question is how to reload the list after one
of these actions is done?

Currently my dropdownchoice model is set like this:

    MyRecord selectedRecord;
    ...
    form.add(new DropDownChoice<MyRecord>("records",
        new PropertyModel<MyRecord>(this, "selectedRecord"),
        getMyRecords(), // method that retrieves from the database (via
JPA)
        new MyRecordRenderer()).setNullValid(false)); // used to return
the display attribute of MyRecord

I am trying to understand if using a LoadableDetachableModel will do the
reload that I want. Also, I don't know how to set the selectedRecord
using that type of model or if it's even possible.

Any advice?

Thanks!

Shelli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to