You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Zbynek Vavros <zb...@gmail.com> on 2020/01/21 21:31:05 UTC

StringResourceModel parameter and AJAX update

Hi,

just simple use-case but I can't figure it out.

I have DropDownChoice that selects User and Label having
StringResourceModel where the parameter (new
StringResourceModel(...).setParameter(selectedUser)) is the selected user.
How do I update the Label's model so that it reflects User selected via
AJAX?

Thanks,
Zbynek

Re: StringResourceModel parameter and AJAX update

Posted by Zbynek Vavros <zb...@gmail.com>.
Thats it, silly me, thanks!

ZV

On Wed, Jan 22, 2020 at 5:42 AM Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Hi,
>
> Instead of passing as parameter selectedUser try passing
>
> new IModel<User> {
>     getObject() {
>         return selectedUser;
>     }
> }
>
> as parameter. If you are using wicket 7.x then instead of IModel you could
> use an AbstractReadonlyModel
>
> On Tue, Jan 21, 2020 at 11:31 PM Zbynek Vavros <zb...@gmail.com>
> wrote:
>
> > Hi,
> >
> > just simple use-case but I can't figure it out.
> >
> > I have DropDownChoice that selects User and Label having
> > StringResourceModel where the parameter (new
> > StringResourceModel(...).setParameter(selectedUser)) is the selected
> user.
> > How do I update the Label's model so that it reflects User selected via
> > AJAX?
> >
> > Thanks,
> > Zbynek
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: StringResourceModel parameter and AJAX update

Posted by Zbynek Vavros <zb...@gmail.com>.
Hey,

AbstractReadOnlyModel seems better but you pointed me the right direction,
thanks!

Zbynek

On Wed, Jan 22, 2020 at 5:42 AM Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Hi,
>
> Instead of passing as parameter selectedUser try passing
>
> new IModel<User> {
>     getObject() {
>         return selectedUser;
>     }
> }
>
> as parameter. If you are using wicket 7.x then instead of IModel you could
> use an AbstractReadonlyModel
>
> On Tue, Jan 21, 2020 at 11:31 PM Zbynek Vavros <zb...@gmail.com>
> wrote:
>
> > Hi,
> >
> > just simple use-case but I can't figure it out.
> >
> > I have DropDownChoice that selects User and Label having
> > StringResourceModel where the parameter (new
> > StringResourceModel(...).setParameter(selectedUser)) is the selected
> user.
> > How do I update the Label's model so that it reflects User selected via
> > AJAX?
> >
> > Thanks,
> > Zbynek
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: StringResourceModel parameter and AJAX update

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,

Instead of passing as parameter selectedUser try passing

new IModel<User> {
    getObject() {
        return selectedUser;
    }
}

as parameter. If you are using wicket 7.x then instead of IModel you could
use an AbstractReadonlyModel

On Tue, Jan 21, 2020 at 11:31 PM Zbynek Vavros <zb...@gmail.com>
wrote:

> Hi,
>
> just simple use-case but I can't figure it out.
>
> I have DropDownChoice that selects User and Label having
> StringResourceModel where the parameter (new
> StringResourceModel(...).setParameter(selectedUser)) is the selected user.
> How do I update the Label's model so that it reflects User selected via
> AJAX?
>
> Thanks,
> Zbynek
>


-- 
Regards - Ernesto Reinaldo Barreiro