try
ListView l = new ListVIew(.., new propertymodel(this, "listViewElements"));
-igor
On Tue, Feb 26, 2008 at 9:41 PM, Martin Makundi
<[EMAIL PROTECTED]> wrote:
> > your listview model is probably caching the old list, and
> > thus when it redraws you dont see the new items. paste your code and
> > we can help you more.
>
> This is exactly what is happening. The listView is populated at the
> Page constructor. If the page is reloaded after onSubmit, the
> constructor is not called again because the page is already
> instantiated. Code is trivial:
>
> public class MyPage extends WebPage {
>
> public MyPage() {
> Form f = new MyForm();
> listViewElements = new LinkedList();
> ListView l = new ListVIew(.., listViewElements);
> }
>
> class MyForm() {
> onSubmit() {
> listViewElements.add(new CustomElement());
> info("Successful.");
> // here I would like to acknowledge that the listView
> // should be repainted to include the new element; otherwise
> the old listView is shown
>
>
> }
> }
> }
>
> >
> > -igor
> >
> >
> >
> > On Tue, Feb 26, 2008 at 8:50 PM, Martin Makundi
> > <[EMAIL PROTECTED]> wrote:
> > > Hi!
> > >
> > > Is it possible to refresh a listView during a form onSubmit event,
> > > without using ajax? Is there any way (apart from ajax) to do it than
> > > by explicitly reloading the page?
> > >
> > > If I reload the page I must store the feedback messages elsewhere
> > > (session-scope feedback messages) and re-initialize all the components
> > > "manually". Or is there maybe something like listView.repaint() or
> > > page.refresh() which can be called from Form.onSubmit()?
> > >
> > > This is what I have:
> > >
> > > <feedback messages here/>
> > > Item: [ ] (textfield) ["Add" Submit-button]
> > >
> > > <table>
> > > <tr>previously added item</tr>
> > > <tr>previously added item</tr>
> > > <tr>previously added item</tr>
> > > </table>
> > >
> > > This is what I want:
> > >
> > > When the "Add" -button is pressed, the form.onSubmit() is called and a
> > > new element is added into the list of elements (used as the source for
> > > the listView pupulating the table). I would then like to "reload" the
> > > page and show a success message in the feedback panel.
> > >
> > > I know this can be maneuvered by actually reloading the page and using
> > > session-scope feedback messages, but is there some "soft reload",
> > > which sort-of shortcuts using session-scope feedback messages?
> > >
> > > Technically the difference is small, but conceptually I find "soft
> > > refresh" more intuitive.
> > >
> > > **
> > > Martin
> > >
> >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]