What's the actual class of the returned from "item.getModelObject()"?

On Fri, May 30, 2008 at 5:16 PM, David Nedrow <[EMAIL PROTECTED]> wrote:

> I'm getting a cast exception when I attempt to pull a list element from the
> model. I may be mishandling how I'm using the model, but this is basically
> based on several tutorials I've looked at.
>
> (Note, as people have pointed out here, I use the "old fashioned" naming
> style for my interfaces and DAOs.)
>
> Anyone see a problem with the below code?
>
> public class ShowProtocolsPanel extends Panel {
>    @SpringBean(name="ProtocolDAO")
>    private IProtocolDAO dao;
>
>    public ShowProtocolsPanel(String id) {
>        super(id);
>
>        IModel protocolsModel = new LoadableDetachableModel() {
>            protected Object load() {
>                return dao.findAll();
>            }
>        };
>
>        add(new PropertyListView("eachItem", protocolsModel) {
>            @Override
>            protected void populateItem(ListItem item) {
>                Protocol protocol = (Protocol) item.getModelObject();
>
>                item.add(new Label("keyword", protocol.getKeyword()));
>                item.add(new Label("description",
> protocol.getDescription()));
>            }
>        });
>    }
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to