You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kshitiz <k....@gmail.com> on 2012/04/30 13:10:43 UTC
Passing parameter to a portion of a page
Hi,
Lets say there are many forms in a page and in every form, there is drop
down choice with onselectionchange feature. Is it possible to pass a
parameter to any one of the form only rather than entire page? Will it be
done through Ajax?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887.html
Sent from the Users forum 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: Passing parameter to a portion of a page
Posted by Carl-Eric Menzel <cm...@wicketbuch.de>.
On Mon, 30 Apr 2012 10:05:46 -0700 (PDT)
kshitiz <k....@gmail.com> wrote:
> Thanks for the reply Dan...now consider a situation:
>
> You have 5 drop downs, each with onselectionchange enabled. When you
> change the choice of any one drop down, the chosen value should be
> passed as parameter to that drop down only, so that it will display
> new value. Rest drop downs should not get changed. How will you do
> that?
I very much recommend looking at wicket-examples, they show very well
how Wicket components and pages work together. For most usecases, your
components will not have to look directly at page parameters *at all*,
and certainly not at other components' parameters.
> On way would be to allocate each drop down a unique id and then,
> associate each parameter being passed to the same page with that id.
> This will help to judge the coming parameter belongs to which drop
> down. But is there any more efficient way?
Your components need a unique id in Wicket anyway. You don't have to
handle those parameters yourself though. Simply override
DropDownChoice#wantOnSelectionChangedNotifications() to return true,
and then #onSelectionChanged will be called *for this component only*
when a new value is selected.
Carl-Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Passing parameter to a portion of a page
Posted by Dan Retzlaff <dr...@gmail.com>.
What you describe sounds like Wicket's default behavior. It knows which
widgets correspond to which Java components, and routes data accordingly
when submitted.
On Mon, Apr 30, 2012 at 10:05 AM, kshitiz <k....@gmail.com> wrote:
> Thanks for the reply Dan...now consider a situation:
>
> You have 5 drop downs, each with onselectionchange enabled. When you change
> the choice of any one drop down, the chosen value should be passed as
> parameter to that drop down only, so that it will display new value. Rest
> drop downs should not get changed. How will you do that?
>
> On way would be to allocate each drop down a unique id and then, associate
> each parameter being passed to the same page with that id. This will help
> to
> judge the coming parameter belongs to which drop down. But is there any
> more
> efficient way?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887p4598758.html
> Sent from the Users forum 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: Passing parameter to a portion of a page
Posted by kshitiz <k....@gmail.com>.
Thanks for the reply Dan...now consider a situation:
You have 5 drop downs, each with onselectionchange enabled. When you change
the choice of any one drop down, the chosen value should be passed as
parameter to that drop down only, so that it will display new value. Rest
drop downs should not get changed. How will you do that?
On way would be to allocate each drop down a unique id and then, associate
each parameter being passed to the same page with that id. This will help to
judge the coming parameter belongs to which drop down. But is there any more
efficient way?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887p4598758.html
Sent from the Users forum 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: Passing parameter to a portion of a page
Posted by Dan Retzlaff <dr...@gmail.com>.
I'm not sure what you mean by "passing a parameter"-- you control the
forms' construction, so you can pass anything you'd like.
If your goal is to make bookmarkable construction parameters available to
all forms, getPage().getPageParameters() would help. (That doesn't change
with AJAX, though, so probably not what you meant.) If your goal is to
share the same IModel among all instances, you might consider stashing it
in metadata on the page (getPage().setMetaData(...)), and having your forms
grab it from there.
Hope that helps,
Dan
On Mon, Apr 30, 2012 at 4:10 AM, kshitiz <k....@gmail.com> wrote:
> Hi,
>
> Lets say there are many forms in a page and in every form, there is drop
> down choice with onselectionchange feature. Is it possible to pass a
> parameter to any one of the form only rather than entire page? Will it be
> done through Ajax?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887.html
> Sent from the Users forum 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
>
>