Announcement Announcement Module
No announcement yet.
How to get model data into view Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get model data into view

    I want to show some data retrieved from the server side in a form contained within a view. The current manual only describes how to configure a view via Spring context and invoke it via ShowViewCommand. But what is the recommended way to feed my data into the view? This should be added to the manual as well. I saw the "viewProperties" map of the DefaultViewDescriptor, but i dont want to set this statically via configuration as my view data is retrieved dynamically. This should be a pretty standard usecase though...

    Thanks for any help!

  • #2
    I found the solution by myself.

    Application.instance().getActiveWindow.getPage().s howView("myview",myDataObject);

    allows me to pass in some data into my view. To process the data inside the view class i needed to override the setInput(Object input) method.

    You also need to be careful about state because the views createControl() method gets called BEFORE setInput() from the framework.

    Would be nice if this could be added to the manual. Or give me SVN access and i would volunteer for that

    Best regards,