You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Anna Simbirtsev <as...@gmail.com> on 2010/07/12 16:36:27 UTC

refreshing fragment

Hi,

I have a listview inside a fragment. Listview has a text field comment.


Fragment f = new Fragment("fragment", "fragmentid", form2);
        f.setOutputMarkupId(true);
        form.add(f);

final ListView<Loan> lv = new ListView<Loan>("loans", data
                .getLoans()) {

            private static final long serialVersionUID = 1L;

            @Override
            protected void populateItem(ListItem<Loan> item)
            {
                finalLoan loan = (Loan) item.getModelObject();

                item.add(new Label("id", loan.getId()));

                final TextField<Loan> comment = new TextField<Loan>(
                        "comment", new PropertyModel<Loan>(loan, "comment")
);

                item.add(comment);

                item
                        .add(addLoanSubmitButton(loan));
            }
        };

        f.add(lv);

In onSubmit, I refresh data.getLoans() and try to refresh fragment using
target.addComponent(f);.
But it does not get refreshed.

Any ideas?

Thanks

Re: refreshing fragment

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Send me quickstart of your code so I can have a look martin.makundi /
koodaripalvelut.com

It's quite tiresome to try to figure it out from a post that doesn't
even compile ;]

Make it a junit test that fails at your bug.

**
Martin

2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> No, I don't think so.:(
>
> On Mon, Jul 12, 2010 at 11:15 AM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
>> No validation error?
>>
>> **
>> Martin
>>
>> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
>> > I took out the wicket enclosure, still does not work. The value in the
>> > textfield still stays the same, instead of being empty. Printing out
>> > loans.getComment(), prints an empty value.
>> >
>> > On Mon, Jul 12, 2010 at 11:01 AM, Martin Makundi <
>> > martin.makundi@koodaripalvelut.com> wrote:
>> >
>> >> Is your component visible in browser source when your refresh it ??
>> >>
>> >> Ajax cannot referesh invisible components ....
>> >>
>> >> **
>> >> Martin
>> >>
>> >> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
>> >> > <span wicket:id="fragment" class="results-table">fragments contents
>> come
>> >> > here</span>
>> >> >             <wicket:fragment wicket:id="fragmentid">
>> >> >                  <wicket:enclosure child="loans">
>> >> >                  <table id="results-table">
>> >> >                    <thead>
>> >> >                      <tr>
>> >> >                        <th scope="col">Loan ID</th>
>> >> >                        <th scope="col">Comment</th>
>> >> >                        <th></th>
>> >> >                      </tr>
>> >> >                    </thead>
>> >> >                    <tbody>
>> >> >                      <tr wicket:id="loans">
>> >> >                        <td wicket:id="id"></td>
>> >> >                        <td>
>> >> >                            <input wicket:id="comment" name="large"
>> >> > type="text" onfocus="this.className='';"/>
>> >> >                        </td>
>> >> >                        <td>
>> >> >                            <div class="submitarea"><a
>> wicket:id="rsubmit"
>> >> > href="#" class="button">SUBMIT</a></div>
>> >> >                        </td>
>> >> >
>> >> >                      </tr>
>> >> >                    </tbody>
>> >> >                  </table>
>> >> >                 </wicket:enclosure>
>> >> >           </wicket:fragment>
>> >> >
>> >> > On Mon, Jul 12, 2010 at 10:47 AM, Martin Makundi <
>> >> > martin.makundi@koodaripalvelut.com> wrote:
>> >> >
>> >> >> what is your fragment about ? <container> <div> does it have
>> markupid?
>> >> >>
>> >> >> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
>> >> >> > Hi,
>> >> >> >
>> >> >> > I have a listview inside a fragment. Listview has a text field
>> >> comment.
>> >> >> >
>> >> >> >
>> >> >> > Fragment f = new Fragment("fragment", "fragmentid", form2);
>> >> >> >        f.setOutputMarkupId(true);
>> >> >> >        form.add(f);
>> >> >> >
>> >> >> > final ListView<Loan> lv = new ListView<Loan>("loans", data
>> >> >> >                .getLoans()) {
>> >> >> >
>> >> >> >            private static final long serialVersionUID = 1L;
>> >> >> >
>> >> >> >            @Override
>> >> >> >            protected void populateItem(ListItem<Loan> item)
>> >> >> >            {
>> >> >> >                finalLoan loan = (Loan) item.getModelObject();
>> >> >> >
>> >> >> >                item.add(new Label("id", loan.getId()));
>> >> >> >
>> >> >> >                final TextField<Loan> comment = new TextField<Loan>(
>> >> >> >                        "comment", new PropertyModel<Loan>(loan,
>> >> >> "comment")
>> >> >> > );
>> >> >> >
>> >> >> >                item.add(comment);
>> >> >> >
>> >> >> >                item
>> >> >> >                        .add(addLoanSubmitButton(loan));
>> >> >> >            }
>> >> >> >        };
>> >> >> >
>> >> >> >        f.add(lv);
>> >> >> >
>> >> >> > In onSubmit, I refresh data.getLoans() and try to refresh fragment
>> >> using
>> >> >> > target.addComponent(f);.
>> >> >> > But it does not get refreshed.
>> >> >> >
>> >> >> > Any ideas?
>> >> >> >
>> >> >> > Thanks
>> >> >> >
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > Anna Simbirtsev
>> >> > (416) 729-7331
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Anna Simbirtsev
>> > (416) 729-7331
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Anna Simbirtsev
> (416) 729-7331
>

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


Re: refreshing fragment

Posted by Anna Simbirtsev <as...@gmail.com>.
No, I don't think so.:(

On Mon, Jul 12, 2010 at 11:15 AM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:

> No validation error?
>
> **
> Martin
>
> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> > I took out the wicket enclosure, still does not work. The value in the
> > textfield still stays the same, instead of being empty. Printing out
> > loans.getComment(), prints an empty value.
> >
> > On Mon, Jul 12, 2010 at 11:01 AM, Martin Makundi <
> > martin.makundi@koodaripalvelut.com> wrote:
> >
> >> Is your component visible in browser source when your refresh it ??
> >>
> >> Ajax cannot referesh invisible components ....
> >>
> >> **
> >> Martin
> >>
> >> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> >> > <span wicket:id="fragment" class="results-table">fragments contents
> come
> >> > here</span>
> >> >             <wicket:fragment wicket:id="fragmentid">
> >> >                  <wicket:enclosure child="loans">
> >> >                  <table id="results-table">
> >> >                    <thead>
> >> >                      <tr>
> >> >                        <th scope="col">Loan ID</th>
> >> >                        <th scope="col">Comment</th>
> >> >                        <th></th>
> >> >                      </tr>
> >> >                    </thead>
> >> >                    <tbody>
> >> >                      <tr wicket:id="loans">
> >> >                        <td wicket:id="id"></td>
> >> >                        <td>
> >> >                            <input wicket:id="comment" name="large"
> >> > type="text" onfocus="this.className='';"/>
> >> >                        </td>
> >> >                        <td>
> >> >                            <div class="submitarea"><a
> wicket:id="rsubmit"
> >> > href="#" class="button">SUBMIT</a></div>
> >> >                        </td>
> >> >
> >> >                      </tr>
> >> >                    </tbody>
> >> >                  </table>
> >> >                 </wicket:enclosure>
> >> >           </wicket:fragment>
> >> >
> >> > On Mon, Jul 12, 2010 at 10:47 AM, Martin Makundi <
> >> > martin.makundi@koodaripalvelut.com> wrote:
> >> >
> >> >> what is your fragment about ? <container> <div> does it have
> markupid?
> >> >>
> >> >> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> >> >> > Hi,
> >> >> >
> >> >> > I have a listview inside a fragment. Listview has a text field
> >> comment.
> >> >> >
> >> >> >
> >> >> > Fragment f = new Fragment("fragment", "fragmentid", form2);
> >> >> >        f.setOutputMarkupId(true);
> >> >> >        form.add(f);
> >> >> >
> >> >> > final ListView<Loan> lv = new ListView<Loan>("loans", data
> >> >> >                .getLoans()) {
> >> >> >
> >> >> >            private static final long serialVersionUID = 1L;
> >> >> >
> >> >> >            @Override
> >> >> >            protected void populateItem(ListItem<Loan> item)
> >> >> >            {
> >> >> >                finalLoan loan = (Loan) item.getModelObject();
> >> >> >
> >> >> >                item.add(new Label("id", loan.getId()));
> >> >> >
> >> >> >                final TextField<Loan> comment = new TextField<Loan>(
> >> >> >                        "comment", new PropertyModel<Loan>(loan,
> >> >> "comment")
> >> >> > );
> >> >> >
> >> >> >                item.add(comment);
> >> >> >
> >> >> >                item
> >> >> >                        .add(addLoanSubmitButton(loan));
> >> >> >            }
> >> >> >        };
> >> >> >
> >> >> >        f.add(lv);
> >> >> >
> >> >> > In onSubmit, I refresh data.getLoans() and try to refresh fragment
> >> using
> >> >> > target.addComponent(f);.
> >> >> > But it does not get refreshed.
> >> >> >
> >> >> > Any ideas?
> >> >> >
> >> >> > Thanks
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> >> For additional commands, e-mail: users-help@wicket.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Anna Simbirtsev
> >> > (416) 729-7331
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Anna Simbirtsev
> > (416) 729-7331
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Anna Simbirtsev
(416) 729-7331

Re: refreshing fragment

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
No validation error?

**
Martin

2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> I took out the wicket enclosure, still does not work. The value in the
> textfield still stays the same, instead of being empty. Printing out
> loans.getComment(), prints an empty value.
>
> On Mon, Jul 12, 2010 at 11:01 AM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
>> Is your component visible in browser source when your refresh it ??
>>
>> Ajax cannot referesh invisible components ....
>>
>> **
>> Martin
>>
>> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
>> > <span wicket:id="fragment" class="results-table">fragments contents come
>> > here</span>
>> >             <wicket:fragment wicket:id="fragmentid">
>> >                  <wicket:enclosure child="loans">
>> >                  <table id="results-table">
>> >                    <thead>
>> >                      <tr>
>> >                        <th scope="col">Loan ID</th>
>> >                        <th scope="col">Comment</th>
>> >                        <th></th>
>> >                      </tr>
>> >                    </thead>
>> >                    <tbody>
>> >                      <tr wicket:id="loans">
>> >                        <td wicket:id="id"></td>
>> >                        <td>
>> >                            <input wicket:id="comment" name="large"
>> > type="text" onfocus="this.className='';"/>
>> >                        </td>
>> >                        <td>
>> >                            <div class="submitarea"><a wicket:id="rsubmit"
>> > href="#" class="button">SUBMIT</a></div>
>> >                        </td>
>> >
>> >                      </tr>
>> >                    </tbody>
>> >                  </table>
>> >                 </wicket:enclosure>
>> >           </wicket:fragment>
>> >
>> > On Mon, Jul 12, 2010 at 10:47 AM, Martin Makundi <
>> > martin.makundi@koodaripalvelut.com> wrote:
>> >
>> >> what is your fragment about ? <container> <div> does it have markupid?
>> >>
>> >> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
>> >> > Hi,
>> >> >
>> >> > I have a listview inside a fragment. Listview has a text field
>> comment.
>> >> >
>> >> >
>> >> > Fragment f = new Fragment("fragment", "fragmentid", form2);
>> >> >        f.setOutputMarkupId(true);
>> >> >        form.add(f);
>> >> >
>> >> > final ListView<Loan> lv = new ListView<Loan>("loans", data
>> >> >                .getLoans()) {
>> >> >
>> >> >            private static final long serialVersionUID = 1L;
>> >> >
>> >> >            @Override
>> >> >            protected void populateItem(ListItem<Loan> item)
>> >> >            {
>> >> >                finalLoan loan = (Loan) item.getModelObject();
>> >> >
>> >> >                item.add(new Label("id", loan.getId()));
>> >> >
>> >> >                final TextField<Loan> comment = new TextField<Loan>(
>> >> >                        "comment", new PropertyModel<Loan>(loan,
>> >> "comment")
>> >> > );
>> >> >
>> >> >                item.add(comment);
>> >> >
>> >> >                item
>> >> >                        .add(addLoanSubmitButton(loan));
>> >> >            }
>> >> >        };
>> >> >
>> >> >        f.add(lv);
>> >> >
>> >> > In onSubmit, I refresh data.getLoans() and try to refresh fragment
>> using
>> >> > target.addComponent(f);.
>> >> > But it does not get refreshed.
>> >> >
>> >> > Any ideas?
>> >> >
>> >> > Thanks
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Anna Simbirtsev
>> > (416) 729-7331
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Anna Simbirtsev
> (416) 729-7331
>

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


Re: refreshing fragment

Posted by Anna Simbirtsev <as...@gmail.com>.
I took out the wicket enclosure, still does not work. The value in the
textfield still stays the same, instead of being empty. Printing out
loans.getComment(), prints an empty value.

On Mon, Jul 12, 2010 at 11:01 AM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:

> Is your component visible in browser source when your refresh it ??
>
> Ajax cannot referesh invisible components ....
>
> **
> Martin
>
> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> > <span wicket:id="fragment" class="results-table">fragments contents come
> > here</span>
> >             <wicket:fragment wicket:id="fragmentid">
> >                  <wicket:enclosure child="loans">
> >                  <table id="results-table">
> >                    <thead>
> >                      <tr>
> >                        <th scope="col">Loan ID</th>
> >                        <th scope="col">Comment</th>
> >                        <th></th>
> >                      </tr>
> >                    </thead>
> >                    <tbody>
> >                      <tr wicket:id="loans">
> >                        <td wicket:id="id"></td>
> >                        <td>
> >                            <input wicket:id="comment" name="large"
> > type="text" onfocus="this.className='';"/>
> >                        </td>
> >                        <td>
> >                            <div class="submitarea"><a wicket:id="rsubmit"
> > href="#" class="button">SUBMIT</a></div>
> >                        </td>
> >
> >                      </tr>
> >                    </tbody>
> >                  </table>
> >                 </wicket:enclosure>
> >           </wicket:fragment>
> >
> > On Mon, Jul 12, 2010 at 10:47 AM, Martin Makundi <
> > martin.makundi@koodaripalvelut.com> wrote:
> >
> >> what is your fragment about ? <container> <div> does it have markupid?
> >>
> >> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> >> > Hi,
> >> >
> >> > I have a listview inside a fragment. Listview has a text field
> comment.
> >> >
> >> >
> >> > Fragment f = new Fragment("fragment", "fragmentid", form2);
> >> >        f.setOutputMarkupId(true);
> >> >        form.add(f);
> >> >
> >> > final ListView<Loan> lv = new ListView<Loan>("loans", data
> >> >                .getLoans()) {
> >> >
> >> >            private static final long serialVersionUID = 1L;
> >> >
> >> >            @Override
> >> >            protected void populateItem(ListItem<Loan> item)
> >> >            {
> >> >                finalLoan loan = (Loan) item.getModelObject();
> >> >
> >> >                item.add(new Label("id", loan.getId()));
> >> >
> >> >                final TextField<Loan> comment = new TextField<Loan>(
> >> >                        "comment", new PropertyModel<Loan>(loan,
> >> "comment")
> >> > );
> >> >
> >> >                item.add(comment);
> >> >
> >> >                item
> >> >                        .add(addLoanSubmitButton(loan));
> >> >            }
> >> >        };
> >> >
> >> >        f.add(lv);
> >> >
> >> > In onSubmit, I refresh data.getLoans() and try to refresh fragment
> using
> >> > target.addComponent(f);.
> >> > But it does not get refreshed.
> >> >
> >> > Any ideas?
> >> >
> >> > Thanks
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Anna Simbirtsev
> > (416) 729-7331
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Anna Simbirtsev
(416) 729-7331

Re: refreshing fragment

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Is your component visible in browser source when your refresh it ??

Ajax cannot referesh invisible components ....

**
Martin

2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> <span wicket:id="fragment" class="results-table">fragments contents come
> here</span>
>             <wicket:fragment wicket:id="fragmentid">
>                  <wicket:enclosure child="loans">
>                  <table id="results-table">
>                    <thead>
>                      <tr>
>                        <th scope="col">Loan ID</th>
>                        <th scope="col">Comment</th>
>                        <th></th>
>                      </tr>
>                    </thead>
>                    <tbody>
>                      <tr wicket:id="loans">
>                        <td wicket:id="id"></td>
>                        <td>
>                            <input wicket:id="comment" name="large"
> type="text" onfocus="this.className='';"/>
>                        </td>
>                        <td>
>                            <div class="submitarea"><a wicket:id="rsubmit"
> href="#" class="button">SUBMIT</a></div>
>                        </td>
>
>                      </tr>
>                    </tbody>
>                  </table>
>                 </wicket:enclosure>
>           </wicket:fragment>
>
> On Mon, Jul 12, 2010 at 10:47 AM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
>> what is your fragment about ? <container> <div> does it have markupid?
>>
>> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
>> > Hi,
>> >
>> > I have a listview inside a fragment. Listview has a text field comment.
>> >
>> >
>> > Fragment f = new Fragment("fragment", "fragmentid", form2);
>> >        f.setOutputMarkupId(true);
>> >        form.add(f);
>> >
>> > final ListView<Loan> lv = new ListView<Loan>("loans", data
>> >                .getLoans()) {
>> >
>> >            private static final long serialVersionUID = 1L;
>> >
>> >            @Override
>> >            protected void populateItem(ListItem<Loan> item)
>> >            {
>> >                finalLoan loan = (Loan) item.getModelObject();
>> >
>> >                item.add(new Label("id", loan.getId()));
>> >
>> >                final TextField<Loan> comment = new TextField<Loan>(
>> >                        "comment", new PropertyModel<Loan>(loan,
>> "comment")
>> > );
>> >
>> >                item.add(comment);
>> >
>> >                item
>> >                        .add(addLoanSubmitButton(loan));
>> >            }
>> >        };
>> >
>> >        f.add(lv);
>> >
>> > In onSubmit, I refresh data.getLoans() and try to refresh fragment using
>> > target.addComponent(f);.
>> > But it does not get refreshed.
>> >
>> > Any ideas?
>> >
>> > Thanks
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Anna Simbirtsev
> (416) 729-7331
>

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


Re: refreshing fragment

Posted by Anna Simbirtsev <as...@gmail.com>.
<span wicket:id="fragment" class="results-table">fragments contents come
here</span>
             <wicket:fragment wicket:id="fragmentid">
                  <wicket:enclosure child="loans">
                  <table id="results-table">
                    <thead>
                      <tr>
                        <th scope="col">Loan ID</th>
                        <th scope="col">Comment</th>
                        <th></th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr wicket:id="loans">
                        <td wicket:id="id"></td>
                        <td>
                            <input wicket:id="comment" name="large"
type="text" onfocus="this.className='';"/>
                        </td>
                        <td>
                            <div class="submitarea"><a wicket:id="rsubmit"
href="#" class="button">SUBMIT</a></div>
                        </td>

                      </tr>
                    </tbody>
                  </table>
                 </wicket:enclosure>
           </wicket:fragment>

On Mon, Jul 12, 2010 at 10:47 AM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:

> what is your fragment about ? <container> <div> does it have markupid?
>
> 2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> > Hi,
> >
> > I have a listview inside a fragment. Listview has a text field comment.
> >
> >
> > Fragment f = new Fragment("fragment", "fragmentid", form2);
> >        f.setOutputMarkupId(true);
> >        form.add(f);
> >
> > final ListView<Loan> lv = new ListView<Loan>("loans", data
> >                .getLoans()) {
> >
> >            private static final long serialVersionUID = 1L;
> >
> >            @Override
> >            protected void populateItem(ListItem<Loan> item)
> >            {
> >                finalLoan loan = (Loan) item.getModelObject();
> >
> >                item.add(new Label("id", loan.getId()));
> >
> >                final TextField<Loan> comment = new TextField<Loan>(
> >                        "comment", new PropertyModel<Loan>(loan,
> "comment")
> > );
> >
> >                item.add(comment);
> >
> >                item
> >                        .add(addLoanSubmitButton(loan));
> >            }
> >        };
> >
> >        f.add(lv);
> >
> > In onSubmit, I refresh data.getLoans() and try to refresh fragment using
> > target.addComponent(f);.
> > But it does not get refreshed.
> >
> > Any ideas?
> >
> > Thanks
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Anna Simbirtsev
(416) 729-7331

Re: refreshing fragment

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
what is your fragment about ? <container> <div> does it have markupid?

2010/7/12 Anna Simbirtsev <as...@gmail.com>:
> Hi,
>
> I have a listview inside a fragment. Listview has a text field comment.
>
>
> Fragment f = new Fragment("fragment", "fragmentid", form2);
>        f.setOutputMarkupId(true);
>        form.add(f);
>
> final ListView<Loan> lv = new ListView<Loan>("loans", data
>                .getLoans()) {
>
>            private static final long serialVersionUID = 1L;
>
>            @Override
>            protected void populateItem(ListItem<Loan> item)
>            {
>                finalLoan loan = (Loan) item.getModelObject();
>
>                item.add(new Label("id", loan.getId()));
>
>                final TextField<Loan> comment = new TextField<Loan>(
>                        "comment", new PropertyModel<Loan>(loan, "comment")
> );
>
>                item.add(comment);
>
>                item
>                        .add(addLoanSubmitButton(loan));
>            }
>        };
>
>        f.add(lv);
>
> In onSubmit, I refresh data.getLoans() and try to refresh fragment using
> target.addComponent(f);.
> But it does not get refreshed.
>
> Any ideas?
>
> Thanks
>

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


Re: refreshing fragment

Posted by jsinai <js...@yahoo.com>.
I have filed https://issues.apache.org/jira/browse/WICKET-2973 with a patch,
which fixes the issue for me.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/refreshing-fragment-tp2286189p2315477.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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


Re: refreshing fragment

Posted by jsinai <js...@yahoo.com>.

jsinai wrote:
> 
> I have the same problem with refreshing fragments via ajax. The problem
> does not exist in 1.4.0 and earlier. It started in 1.4.1+, I believe.
> 

I have downloaded the source for 1.4.9 and made the change below in
AjaxRequestTarget.java, which fixed the problem for me. The change is
commenting out the check "if (!containsAncestorFor(component))".

I verified that this change was made between 1.4.0 and 1.4.1, although the
release notes make no mention of it. We make heavy use of fragments, so this
is a big problem for us.

	private void respondComponents(WebResponse response)
	{

		// TODO: We might need to call prepareRender on all components upfront

		// process component markup
		Iterator<Map.Entry<String, Component>> it =
markupIdToComponent.entrySet().iterator();
		while (it.hasNext())
		{
			final Map.Entry<String, Component> entry = it.next();
			final Component component = entry.getValue();
			final String markupId = entry.getKey();

// if (!containsAncestorFor(component))
// {
			respondComponent(response, markupId, component);
// }
		}
	}

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/refreshing-fragment-tp2286189p2315451.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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


Re: refreshing fragment

Posted by jsinai <js...@yahoo.com>.
I have the same problem with refreshing fragments via ajax. The problem does
not exist in 1.4.0 and earlier. It started in 1.4.1+, I believe.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/refreshing-fragment-tp2286189p2315381.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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