You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by grazia <Gr...@gmail.com> on 2013/02/14 19:01:17 UTC

Overriding onEvent to update choices side of Palette

I just would like to add to the choices side of the palette the selection
made by the user (in my case through an autocomplete textfield). 
This all exectutes fine, but nothing gets added. 
Is my ...add(this.getChoicesComponent()) the correct way to accomplish what
I need ?


( I am overriding the onEvent of the Palette)
@Override
	public void onEvent(IEvent<?> event) {
		
		super.onEvent(event);
		
		if (event.getPayload() instanceof MyAutoCompleteUpdate){
			MyAutoCompleteUpdate update = (MyAutoCompleteUpdate)event.getPayload();
			
			update.getTarget().add(this.getChoicesComponent());
			
			
			
		}
		
	}



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376.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: Overriding onEvent to update choices side of Palette

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

On Fri, Feb 15, 2013 at 12:39 PM, grazia <Gr...@gmail.com>wrote:

> Let me give you more context:
>
> my page consists of:
> - a lazy loading autocompletetextfield
> - a form containing the palette
>
> By selecting an option in the autocomplete, the left side of the palette
> (choices side) should display that selection made in the autocomplete.
>
> So, I have so far managed to add a AjaxFormUpdatingBehavior to the
> autocomplete, which sends the event to the palette ( using
> Component.*send<
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#send%28org.apache.wicket.event.IEventSink,%20org.apache.wicket.event.Broadcast,%20T%29
> >
> *(IEventSink<
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/event/IEventSink.html
> >
> sink,
> Broadcast<
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/event/Broadcast.html
> >
> type,
> T payload) ). For the palette to receive the event, I override the onEvent
> method I showed you.
>
>
I guess you have add those new "choices" to the palette before "repainting
it"...



> Now, the onEvent receives the AjaxRequestTarget, but
> target.add(this) (where "this" is the palettte) does not do anything.
> I tried:
> target.add(this.getChoicesComponent()) and does not anything either.
>
> "Why not use the event triggered by the ART directly. " could you please
> explain ?
>
>
What I mean AJAX request target (ART) will trigger an event with ART as
payload. See AjaxRequestHandler#respond...

page.send(app, Broadcast.BREADTH, this);

you could place a flag of RequestCycle to identify AjaxFormUpdatingBehavior
was triggered and  use that event do the repainting.


> On Thu, Feb 14, 2013 at 11:52 PM, Ernesto Reinaldo Barreiro-4 [via Apache
> Wicket] <ml...@n4.nabble.com> wrote:
>
> > Hi,
> >
> > It is difficult to understand what you are doing... Are you in the middle
> > of an AjaxRequestTarget(ART)? If that what
> >
> >   update.getTarget().add(this.getChoicesComponent());
> >
> > means? Why not use the event triggered by the ART directly.
> >
> >
> > On Thu, Feb 14, 2013 at 10:34 PM, grazia <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656381&i=0>>wrote:
> >
> >
> > > Nobody has any idea ? I am stuck
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656380.html
> > > Sent from the Users forum mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656381&i=1>
> > > For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656381&i=2>
> > >
> > >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> > Antilia Soft
> > http://antiliasoft.com/ <http://antiliasoft.com/antilia>
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656381.html
> >  To unsubscribe from Overriding onEvent to update choices side of
> Palette, click
> > here<
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656376&code=R3JhemlhLlJ1c3NvTGFzc25lckBnbWFpbC5jb218NDY1NjM3NnwyMjY4MDg1NDM=
> >
> > .
> > NAML<
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656397.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>

Re: Overriding onEvent to update choices side of Palette

Posted by grazia <Gr...@gmail.com>.
Let me give you more context:

my page consists of:
- a lazy loading autocompletetextfield
- a form containing the palette

By selecting an option in the autocomplete, the left side of the palette
(choices side) should display that selection made in the autocomplete.

So, I have so far managed to add a AjaxFormUpdatingBehavior to the
autocomplete, which sends the event to the palette ( using
Component.*send<http://wicket.apache.org/apidocs/1.5/org/apache/wicket/Component.html#send%28org.apache.wicket.event.IEventSink,%20org.apache.wicket.event.Broadcast,%20T%29>
*(IEventSink<http://wicket.apache.org/apidocs/1.5/org/apache/wicket/event/IEventSink.html>
sink,
Broadcast<http://wicket.apache.org/apidocs/1.5/org/apache/wicket/event/Broadcast.html>
type,
T payload) ). For the palette to receive the event, I override the onEvent
method I showed you.

Now, the onEvent receives the AjaxRequestTarget, but
target.add(this) (where "this" is the palettte) does not do anything.
I tried:
target.add(this.getChoicesComponent()) and does not anything either.

"Why not use the event triggered by the ART directly. " could you please
explain ?


On Thu, Feb 14, 2013 at 11:52 PM, Ernesto Reinaldo Barreiro-4 [via Apache
Wicket] <ml...@n4.nabble.com> wrote:

> Hi,
>
> It is difficult to understand what you are doing... Are you in the middle
> of an AjaxRequestTarget(ART)? If that what
>
>   update.getTarget().add(this.getChoicesComponent());
>
> means? Why not use the event triggered by the ART directly.
>
>
> On Thu, Feb 14, 2013 at 10:34 PM, grazia <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656381&i=0>>wrote:
>
>
> > Nobody has any idea ? I am stuck
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656380.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4656381&i=1>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4656381&i=2>
> >
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ <http://antiliasoft.com/antilia>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656381.html
>  To unsubscribe from Overriding onEvent to update choices side of Palette, click
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656376&code=R3JhemlhLlJ1c3NvTGFzc25lckBnbWFpbC5jb218NDY1NjM3NnwyMjY4MDg1NDM=>
> .
> NAML<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656397.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: Overriding onEvent to update choices side of Palette

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

It is difficult to understand what you are doing... Are you in the middle
of an AjaxRequestTarget(ART)? If that what

  update.getTarget().add(this.getChoicesComponent());

means? Why not use the event triggered by the ART directly.


On Thu, Feb 14, 2013 at 10:34 PM, grazia <Gr...@gmail.com>wrote:

> Nobody has any idea ? I am stuck
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656380.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>

Re: Overriding onEvent to update choices side of Palette

Posted by grazia <Gr...@gmail.com>.
Nobody has any idea ? I am stuck



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Overriding-onEvent-to-update-choices-side-of-Palette-tp4656376p4656380.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