RE: How to extends repeater.data.table.HeadersToolbar (How to resolve CssAttributeBehavior) ?

2016-04-25 Thread andre seame
Thanks, 

But it no so easy, because the idea is to modify the populateItem of 
refreshingView.

Thanks,
PHL.


De : Sven Meier 
Envoyé : lundi 25 avril 2016 07:22
À : users@wicket.apache.org
Objet : Re: How to extends repeater.data.table.HeadersToolbar (How to resolve 
CssAttributeBehavior) ?

Hi,

HeadersToolbar already creates a RefreshingView in its constructor, you should 
not repeat that.
The following should do:

 public  THHeadersToolbar(final DataTable table, final 
ISortStateLocator stateLocator)
 {
 // inherited stuff
 super(table);

 // ... do custom stuff
 }

Have fun
Sven



On 25.04.2016 00:45, andre seame wrote:
> I would like to modify
>
> org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.html
>  and 
> org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.java.
>
>
> So I would to create myHeadersToolbar that extends 
> org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.
>
>
> But, I have a problem :
>
>
> public  THHeadersToolbar(final DataTable table, final 
> ISortStateLocator stateLocator)
>   {
>  super(table);
>
>  RefreshingView> headers = new 
> RefreshingView>("headers")
>  { 
>
>
>@Override
>  protected void populateItem(Item> item)
>  {  ...
>  if (column instanceof IStyledColumn)
>  {
>
>CssAttributeBehavior cssAttributeBehavior = new 
> DataTable.CssAttributeBehavior() ...
>
>
> Therefore, Eclipse propose to
>
> import 
> org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable.CssAttributeBehavior;
>
>
> But this fails :
>
>
> Eclipse says : CssAttributeBehavior cannot be resolved to a type
>
>
> And Eclipse is right :
>
>
> public class DataTable extends Panel implements IPageableItems
> {
>  static abstract class CssAttributeBehavior extends Behavior
>
>
> How to modify the HeadersToolbar ? Is "extends" the good idea ? Other 
> Solution ?
>
>
> Thanks,
>
> PHL.
>
>
>


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


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



Re: Panel.this always giving previous version of the object but not the modified one.

2016-04-25 Thread Martin Grigorov
Hi,

You need:

Page openerPage = getPageReference().getPage();
openerPage.send(openerPage, Broadcast.BREADTH, new
GridValueChangeEvent(target, selectedRow));

Then any component inside 'openerPage' will receive this event and can read
and store the selected row from it.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Apr 25, 2016 at 4:53 PM, durairaj t  wrote:

>  Please refer the below formatted code snippet.
>
> I'm setting selectedRow value in page creator and expecting the same
> in window close call back (Line number 24), I tried with the Inter
> component communication examples as you suggested. But I don't know how to
> update the selectedRow in line #24 with onEven(IEvent event).
>
>
>
> Paste Bin URL: http://pastebin.com/Y2KA2LNn
>
>
>
>1.
>2. public class FieldSearchTextField  extends MaskedTextField{
>3.ResultRow selectedRow;
>4.
>5./* other business code here*/
>6.
>7./*   page creator */
>8.   modalWindow.setPageCreator (new ModalWindow.PageCreator() {
>9.  public Page createPage() {
>10.  FieldSearchModalPage casePartyModalPage = new
> FieldSearchModalPage(searchOption, modalWindow){
>11.@Override
>12.  public void updateValue(ResultRow row, AjaxRequestTarget
>target) {
>13.   selectedRow = row; /* selectedRow is not null here*/
>14.   getPageReference().getPage().send( getPage(),
>Broadcast.BREADTH,new   GridValueChangeEvent(target));
>15.}
>16.  }
>17.}
>18.  }
>19.
>20./* window close call back*/
>21. modalWindow.setWindowClosedCallback(new
>ModalWindow.WindowClosedCallback()  {
>22.  @Override
>23.  public void onClose(AjaxRequestTarget target){
>24. /* how to get the selectedRow value here? */
>25.  onFieldSearchWindowClose(selectedRow, target);*// selectedRow
>is null here.*
>26.   }
>27.  }
>28.
>29.  /*onEvent implementation*/
>30. @Override
>31. public void onEvent(IEvent event) {
>32. super.onEvent(event);
>33. if(event.getPayload() instanceof GridValueChangeEvent) {
>34. GridValueChangeEvent gridValueChangeEvent =
>((GridValueChangeEvent) event.
>35. getPayload());
>36. gridValueChangeEvent.getTarget().add(this);
>37. }
>38. }
>39.   /* Grid value change event class*/
>40.public class GridValueChangeEvent {
>41. private final AjaxRequestTarget target;
>42.
>43. public GridValueChangeEvent(AjaxRequestTarget target) {
>44. this.target = target;
>45. }
>46. public AjaxRequestTarget getTarget() {
>47. return target;
>48. }
>49.  }
>50.
>51.   }
>
>
> On Fri, Apr 22, 2016 at 4:53 PM, Martin Grigorov 
> wrote:
>
> > Please use some pastebin service.
> > It is hard to read and follow this code.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Apr 22, 2016 at 10:43 PM, durairaj t 
> > wrote:
> >
> > > Thank you Martin. I tried with examples but those are not working in my
> > > case. I don't know how to call the onEvent in line number 19 in the
> below
> > > code snippet. Please share me if you have any examples.
> > >
> > >
> > > 1. public class FieldSearchTextField  extends MaskedTextField{
> > > 2.  ResultRow selectedRow;
> > > 3. /*   page creator */
> > > 4.   modalWindow.setPageCreator (new ModalWindow.PageCreator() {
> > > 5.public Page createPage() {
> > > 6. FieldSearchModalPage casePartyModalPage = new
> > >  FieldSearchModalPage(searchOption, modalWindow){
> > > 7. @Override
> > > 8.public void updateValue(ResultRow row, AjaxRequestTarget target)
> {
> > > 9. selectedRow = row;* //selectedRow is not null here*
> > > 10. getPageReference().getPage().send( getPage(), Broadcast.BREADTH,new
> > >  GridValueChangeEvent(target));
> > > 11. }
> > > 12.}
> > > 13.   }
> > > 14.  }
> > > 15.  /* window close call back*/
> > > 16.modalWindow.setWindowClosedCallback(new
> > >  ModalWindow.WindowClosedCallback()  {
> > > 17.@Override
> > > 18.public void onClose(AjaxRequestTarget target){
> > > 19. *??*
> > > 20. onFieldSearchWindowClose(selectedRow, target);*// selectedRow
> is
> > > null here.*
> > > 21.}
> > > 22.   }
> > > 23.  @Override
> > > 24. public void onEvent(IEvent event) {
> > > 25. if(event.getPayload() instanceof GridValueChangeEvent) {
> > > 26. GridValueChangeEvent gridValueChangeEvent = ((GridValueChangeEvent)
> > > event.getPayload());
> > > 27.}
> > > 28. }
> > > 29.  }
> > > 30.
> > >
> > >
> > > On 

Re: Panel.this always giving previous version of the object but not the modified one.

2016-04-25 Thread durairaj t
 Please refer the below formatted code snippet.

I'm setting selectedRow value in page creator and expecting the same
in window close call back (Line number 24), I tried with the Inter
component communication examples as you suggested. But I don't know how to
update the selectedRow in line #24 with onEven(IEvent event).



Paste Bin URL: http://pastebin.com/Y2KA2LNn



   1.
   2. public class FieldSearchTextField  extends MaskedTextField{
   3.ResultRow selectedRow;
   4.
   5./* other business code here*/
   6.
   7./*   page creator */
   8.   modalWindow.setPageCreator (new ModalWindow.PageCreator() {
   9.  public Page createPage() {
   10.  FieldSearchModalPage casePartyModalPage = new
FieldSearchModalPage(searchOption, modalWindow){
   11.@Override
   12.  public void updateValue(ResultRow row, AjaxRequestTarget
   target) {
   13.   selectedRow = row; /* selectedRow is not null here*/
   14.   getPageReference().getPage().send( getPage(),
   Broadcast.BREADTH,new   GridValueChangeEvent(target));
   15.}
   16.  }
   17.}
   18.  }
   19.
   20./* window close call back*/
   21. modalWindow.setWindowClosedCallback(new
   ModalWindow.WindowClosedCallback()  {
   22.  @Override
   23.  public void onClose(AjaxRequestTarget target){
   24. /* how to get the selectedRow value here? */
   25.  onFieldSearchWindowClose(selectedRow, target);*// selectedRow
   is null here.*
   26.   }
   27.  }
   28.
   29.  /*onEvent implementation*/
   30. @Override
   31. public void onEvent(IEvent event) {
   32. super.onEvent(event);
   33. if(event.getPayload() instanceof GridValueChangeEvent) {
   34. GridValueChangeEvent gridValueChangeEvent =
   ((GridValueChangeEvent) event.
   35. getPayload());
   36. gridValueChangeEvent.getTarget().add(this);
   37. }
   38. }
   39.   /* Grid value change event class*/
   40.public class GridValueChangeEvent {
   41. private final AjaxRequestTarget target;
   42.
   43. public GridValueChangeEvent(AjaxRequestTarget target) {
   44. this.target = target;
   45. }
   46. public AjaxRequestTarget getTarget() {
   47. return target;
   48. }
   49.  }
   50.
   51.   }


On Fri, Apr 22, 2016 at 4:53 PM, Martin Grigorov 
wrote:

> Please use some pastebin service.
> It is hard to read and follow this code.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Apr 22, 2016 at 10:43 PM, durairaj t 
> wrote:
>
> > Thank you Martin. I tried with examples but those are not working in my
> > case. I don't know how to call the onEvent in line number 19 in the below
> > code snippet. Please share me if you have any examples.
> >
> >
> > 1. public class FieldSearchTextField  extends MaskedTextField{
> > 2.  ResultRow selectedRow;
> > 3. /*   page creator */
> > 4.   modalWindow.setPageCreator (new ModalWindow.PageCreator() {
> > 5.public Page createPage() {
> > 6. FieldSearchModalPage casePartyModalPage = new
> >  FieldSearchModalPage(searchOption, modalWindow){
> > 7. @Override
> > 8.public void updateValue(ResultRow row, AjaxRequestTarget target) {
> > 9. selectedRow = row;* //selectedRow is not null here*
> > 10. getPageReference().getPage().send( getPage(), Broadcast.BREADTH,new
> >  GridValueChangeEvent(target));
> > 11. }
> > 12.}
> > 13.   }
> > 14.  }
> > 15.  /* window close call back*/
> > 16.modalWindow.setWindowClosedCallback(new
> >  ModalWindow.WindowClosedCallback()  {
> > 17.@Override
> > 18.public void onClose(AjaxRequestTarget target){
> > 19. *??*
> > 20. onFieldSearchWindowClose(selectedRow, target);*// selectedRow is
> > null here.*
> > 21.}
> > 22.   }
> > 23.  @Override
> > 24. public void onEvent(IEvent event) {
> > 25. if(event.getPayload() instanceof GridValueChangeEvent) {
> > 26. GridValueChangeEvent gridValueChangeEvent = ((GridValueChangeEvent)
> > event.getPayload());
> > 27.}
> > 28. }
> > 29.  }
> > 30.
> >
> >
> > On Sat, Apr 16, 2016 at 3:03 PM, Martin Grigorov 
> > wrote:
> >
> > > Hi,
> > >
> > > The problem is the same.
> > > In your first question you were asking for MyPanel.this, now you ask
> for
> > > TextField.this.
> > >
> > > If you cannot use Panel backed ModalWindow then use
> > > pageRef.getPage().send(pageRef.getPage(), Broadcast.BREADTH, new
> > > MyModalClosedEvent()) and listen for this event in all components which
> > > should be repainted.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Fri, Apr 15, 2016 at 4:01 PM, durairaj t 
> > > wrote:
> > >
> > 

Re: open connection to async servlet and initiate wicket ajax request, results ComponentNotFoundException

2016-04-25 Thread fachhoch
Yes, Thank you .  I will try websocket.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/open-connection-to-async-servlet-and-initiate-wicket-ajax-request-results-ComponentNotFoundException-tp4674357p4674416.html
Sent from the Users forum mailing list archive at Nabble.com.

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



[wicketstuff-restannotations] How to automatically generate Swagger definitions.

2016-04-25 Thread Fabio Fioretti
Hi all,

I have been successfully using wicketstuff-restannotations to create some
REST web services in my Wicket 6.22.0 application - thanks for that, very
straightforward.

Now that my REST resources and methods are complete and correctly
annotated, I would need to generate the related Swagger definitions.

Is there an easy way to do so?

Many thanks,
Fabio


Re: open connection to async servlet and initiate wicket ajax request, results ComponentNotFoundException

2016-04-25 Thread Martin Grigorov
On Mon, Apr 25, 2016 at 3:27 PM, fachhoch  wrote:

> Hi Martin,
> Before adding the new request I find the previous request and call complete
> on that and if user closes browser or logs out , the request times out and
> gets closed. There will be just one request per user at any given time.
>
>
>
> asyncContexts.stream().filter(as->as.getRequest().getParameter("name").equals(name)).collect(Collectors.toList()).forEach(ac->ac.complete());
>

There is no need to collect. You could use Stream#forEach(Consumer)


>
> I tried   wicket-atmosphere sometime before  faced issues with tomcat and
> wicket version, websocket I saw the wicket example , It shows use container
> specific filter which causes issues with portability.
>

Wicket Native WebSocket also has -javax module which uses JSR-356 and is
tested on Tomcat 7/8/8.5/9, Jetty 9 and WildFly 8/9/10


>
> Async serevlet, long polling javascript  is simple, plain.
>

True!


>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/open-connection-to-async-servlet-and-initiate-wicket-ajax-request-results-ComponentNotFoundException-tp4674357p4674413.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: open connection to async servlet and initiate wicket ajax request, results ComponentNotFoundException

2016-04-25 Thread fachhoch
Hi Martin,
Before adding the new request I find the previous request and call complete
on that and if user closes browser or logs out , the request times out and
gets closed. There will be just one request per user at any given time.


asyncContexts.stream().filter(as->as.getRequest().getParameter("name").equals(name)).collect(Collectors.toList()).forEach(ac->ac.complete());
 

I tried   wicket-atmosphere sometime before  faced issues with tomcat and
wicket version, websocket I saw the wicket example , It shows use container
specific filter which causes issues with portability.

Async serevlet, long polling javascript  is simple, plain.  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/open-connection-to-async-servlet-and-initiate-wicket-ajax-request-results-ComponentNotFoundException-tp4674357p4674413.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to extends repeater.data.table.HeadersToolbar (How to resolve CssAttributeBehavior) ?

2016-04-25 Thread Sven Meier

Hi,

HeadersToolbar already creates a RefreshingView in its constructor, you should 
not repeat that.
The following should do:

public  THHeadersToolbar(final DataTable table, final 
ISortStateLocator stateLocator)
{
// inherited stuff
super(table);

// ... do custom stuff
}

Have fun
Sven



On 25.04.2016 00:45, andre seame wrote:

I would like to modify

org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.html
 and 
org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.java.


So I would to create myHeadersToolbar that extends 
org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar.


But, I have a problem :


public  THHeadersToolbar(final DataTable table, final 
ISortStateLocator stateLocator)
  {
 super(table);

 RefreshingView> headers = new RefreshingView>("headers")
 { 


   @Override
 protected void populateItem(Item> item)
 {  ...
 if (column instanceof IStyledColumn)
 {

   CssAttributeBehavior cssAttributeBehavior = new 
DataTable.CssAttributeBehavior() ...


Therefore, Eclipse propose to

import 
org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable.CssAttributeBehavior;


But this fails :


Eclipse says : CssAttributeBehavior cannot be resolved to a type


And Eclipse is right :


public class DataTable extends Panel implements IPageableItems
{
 static abstract class CssAttributeBehavior extends Behavior


How to modify the HeadersToolbar ? Is "extends" the good idea ? Other Solution ?


Thanks,

PHL.






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