Take a look at LibraryUser persistent object now:
public class LibraryUser extends DBPersistentObject implements Listable {
    public void define() {
        addField("FirstName"new VarcharField(50));
        addField("LastName"new VarcharField(50));
        addField("Age"new IntField());
        addField("Address"new VarcharField(100));
    }

    public Pair[] getRenderableFields(int presentation) {
        CompositeActionUrl actions = new CompositeActionUrl();
        StringBuffer sb = new StringBuffer();
        sb.append("main?");
        sb.append("panel=UserPanel");
        sb.append("&next_panel=LibraryAdminPanel");
        sb.append("&objectID=");
        actions.addActionUrl(new ActionUrl("Manage", sb.toString()));
        return new Pair[]{
            new Pair("FirstName""First Name"),
            new Pair("LastName""Last Name"),
            new Pair("Age""Age"),
            new Pair("Address""Address"),
            new Pair(actions, "Action")
        };
    }
}

If you supposed that the list of users will be a bit different now - you were absolutely right :-)
URLs in the Action column were generated in the getRenderableFields() method. Every URL points to the same panel - UserPanel, but user's ID is sent as parameter. It's time to make UserPanel now.

Previous page Tree of contents Next page