Re: get page instance in AtmosphereRequestHandler

2014-02-24 Thread Martin Grigorov
Hi,

You should have started a page before sending websocket requests to it, as
in the real usage.
By using tester.startPage(thePage) Wicket will store the page in
MockPageManager and later you can find it by its id.

Martin Grigorov
Wicket Training and Consulting


On Sat, Feb 22, 2014 at 5:13 PM, Pierre Goupil goupilpie...@gmail.comwrote:

 Hi,

 In fact, it is this code:

 Session.get().getPageManager().getPage(pageId);

 (excerpt from DefaultMapperContext#getPageInstance(final int pageId))

 which returns null: the Session.get().getPageManager() contains no pages
 when I'm in my Atmosphere context.

 Any thoughts, please?

 Kind regards,
 Pierre





 On Sat, Feb 22, 2014 at 2:17 AM, Pierre Goupil goupilpie...@gmail.com
 wrote:

  Good evening,
 
  I'm trying to implement the unit test functionality of Wicket-Atmosphere.
  I'm stuck on a silly thing.
 
  I have this code in the class AtmosphereRequestHandler:
 
  @Override
  public void respond(final IRequestCycle requestCycle)
  {
  final Page page = (Page)Application.get().getMapperContext()
  .getPageInstance(this.pageKey.getPageId());
  final AjaxRequestTarget target =
  WebApplication.get().newAjaxRequestTarget(page);
  this.executeHandlers(target, page);
  }
 
  The page is always null, so I got an exception at the target creation,
  saying page can not be null. But I'm sure the pageId I provide is OK.
 
  Any idea?
 
  Regards,
 
  Pierre
 



 --
 Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
 mal.
 Alors frappez-moi de musique !
 Frappez-moi de musique, maintenant !

 (Bob Marley : Trenchtown Rock)



Re: bug or new feature

2014-02-24 Thread Martin Grigorov
Hi Ernesto,


On Sat, Feb 22, 2014 at 8:46 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 On Wicket 6.13.0 following code

 script type=text/template id=message-template
 div class=sender pull-left
 div class=icon
 img src=img/2.jpg class=img-circle alt=/
 /div
 div class=time
 just now
 /div
 /div
 div class=chat-message-body
 span class=arrow/span
 div class=senderTikhon Laninga/div
 div class=text
 %- text %


The problem should be here.
Wicket's XmlPullParser is XML parser, not HTML parser, and it doesn't know
that the content in script tags should be read as plain text.
% is invalid XML tag name.

Solutions:

1) replace % % with different delimiters.
I am not sure which templating library you use but I know few JS libs that
support this.

2) wrap the content of the script in CDATA

3) adding a new wicket:xyz attribute that will tell Wicket to not process
the children of script


 /div
 /div
 /script

 was parsed OK. On Wicket 6.14.0 I get

 ==

 2014-02-22 07:42:48,618 [qtp757902664-22] ERROR
 [org.apache.wicket.DefaultExceptionMapper] - Unexpected error occurred
 org.apache.wicket.markup.MarkupException: Malformed tag (line 73, column
 17)
 at

 org.apache.wicket.markup.AbstractMarkupParser.parseMarkup(AbstractMarkupParser.java:301)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:183)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at
 org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.getBaseMarkup(InheritedMarkupMarkupLoader.java:99)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:68)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at
 org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:405)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.Component.getMarkup(Component.java:728)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.Component.internalRender(Component.java:2346)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.Component.render(Component.java:2309)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at org.apache.wicket.Page.renderPage(Page.java:1024)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:121)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:274)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
 ~[wicket-core-6.14.0.jar:6.14.0]
 at

 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 ~[wicket-request-6.14.0.jar:6.14.0]
 at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
 

Translate wicket app to new domain

2014-02-24 Thread Tron Walseth
Hi all

We have made a wicket app for a very specific domain (animal tracking)

Now we have multiple customer requests for completely different domains, but 
the functionality is mainly the same.

Is there an easy way of translating our web pages to new solution domains?

Tron


Re: Translate wicket app to new domain

2014-02-24 Thread Martin Grigorov
Hi,

Is this helpful - http://wicket.apache.org/guide/guide/i18n.html ?

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 24, 2014 at 10:56 AM, Tron Walseth t...@telespor.no wrote:

 Hi all

 We have made a wicket app for a very specific domain (animal tracking)

 Now we have multiple customer requests for completely different domains,
 but the functionality is mainly the same.

 Is there an easy way of translating our web pages to new solution domains?

 Tron



Re: get page instance in AtmosphereRequestHandler

2014-02-24 Thread Pierre Goupil
Well, that's what I did, indeed. But it wasn't enough. I've found a way, I
need more deep testing of it, but for the moment it looks OK.

Regards,

Pierre



On Mon, Feb 24, 2014 at 9:07 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 You should have started a page before sending websocket requests to it, as
 in the real usage.
 By using tester.startPage(thePage) Wicket will store the page in
 MockPageManager and later you can find it by its id.

 Martin Grigorov
 Wicket Training and Consulting


 On Sat, Feb 22, 2014 at 5:13 PM, Pierre Goupil goupilpie...@gmail.com
 wrote:

  Hi,
 
  In fact, it is this code:
 
  Session.get().getPageManager().getPage(pageId);
 
  (excerpt from DefaultMapperContext#getPageInstance(final int pageId))
 
  which returns null: the Session.get().getPageManager() contains no pages
  when I'm in my Atmosphere context.
 
  Any thoughts, please?
 
  Kind regards,
  Pierre
 
 
 
 
 
  On Sat, Feb 22, 2014 at 2:17 AM, Pierre Goupil goupilpie...@gmail.com
  wrote:
 
   Good evening,
  
   I'm trying to implement the unit test functionality of
 Wicket-Atmosphere.
   I'm stuck on a silly thing.
  
   I have this code in the class AtmosphereRequestHandler:
  
   @Override
   public void respond(final IRequestCycle requestCycle)
   {
   final Page page = (Page)Application.get().getMapperContext()
   .getPageInstance(this.pageKey.getPageId());
   final AjaxRequestTarget target =
   WebApplication.get().newAjaxRequestTarget(page);
   this.executeHandlers(target, page);
   }
  
   The page is always null, so I got an exception at the target creation,
   saying page can not be null. But I'm sure the pageId I provide is OK.
  
   Any idea?
  
   Regards,
  
   Pierre
  
 
 
 
  --
  Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as
 pas
  mal.
  Alors frappez-moi de musique !
  Frappez-moi de musique, maintenant !
 
  (Bob Marley : Trenchtown Rock)
 




-- 
Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
mal.
Alors frappez-moi de musique !
Frappez-moi de musique, maintenant !

(Bob Marley : Trenchtown Rock)


Re: bug or new feature

2014-02-24 Thread Ernesto Reinaldo Barreiro
3) was what i have suggested in issue... wicket:nosacan=true but for
backward compatibility it would be nice if it the other way around.
wicket:scan='true'


On Mon, Feb 24, 2014 at 9:11 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi Ernesto,


 On Sat, Feb 22, 2014 at 8:46 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  On Wicket 6.13.0 following code
 
  script type=text/template id=message-template
  div class=sender pull-left
  div class=icon
  img src=img/2.jpg class=img-circle alt=/
  /div
  div class=time
  just now
  /div
  /div
  div class=chat-message-body
  span class=arrow/span
  div class=senderTikhon Laninga/div
  div class=text
  %- text %
 

 The problem should be here.
 Wicket's XmlPullParser is XML parser, not HTML parser, and it doesn't know
 that the content in script tags should be read as plain text.
 % is invalid XML tag name.

 Solutions:

 1) replace % % with different delimiters.
 I am not sure which templating library you use but I know few JS libs that
 support this.

 2) wrap the content of the script in CDATA

 3) adding a new wicket:xyz attribute that will tell Wicket to not process
 the children of script


  /div
  /div
  /script
 
  was parsed OK. On Wicket 6.14.0 I get
 
  ==
 
  2014-02-22 07:42:48,618 [qtp757902664-22] ERROR
  [org.apache.wicket.DefaultExceptionMapper] - Unexpected error occurred
  org.apache.wicket.markup.MarkupException: Malformed tag (line 73, column
  17)
  at
 
 
 org.apache.wicket.markup.AbstractMarkupParser.parseMarkup(AbstractMarkupParser.java:301)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:183)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
  org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.getBaseMarkup(InheritedMarkupMarkupLoader.java:99)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:68)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
  org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:405)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.Component.getMarkup(Component.java:728)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.Component.internalRender(Component.java:2346)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.Component.render(Component.java:2309)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at org.apache.wicket.Page.renderPage(Page.java:1024)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:121)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:274)
  ~[wicket-core-6.14.0.jar:6.14.0]
  at
 
 
 

Re: bug or new feature

2014-02-24 Thread Martin Grigorov
On Mon, Feb 24, 2014 at 11:56 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 3) was what i have suggested in issue... wicket:nosacan=true but for
 backward compatibility it would be nice if it the other way around.
 wicket:scan='true'


The question is: is it really needed ? I'd like to avoid adding more custom
attributes if there is a way to avoid it.
does 1) or 2) solve the issue ?




 On Mon, Feb 24, 2014 at 9:11 AM, Martin Grigorov mgrigo...@apache.org
 wrote:

  Hi Ernesto,
 
 
  On Sat, Feb 22, 2014 at 8:46 AM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
   On Wicket 6.13.0 following code
  
   script type=text/template id=message-template
   div class=sender pull-left
   div class=icon
   img src=img/2.jpg class=img-circle alt=/
   /div
   div class=time
   just now
   /div
   /div
   div class=chat-message-body
   span class=arrow/span
   div class=senderTikhon Laninga/div
   div class=text
   %- text %
  
 
  The problem should be here.
  Wicket's XmlPullParser is XML parser, not HTML parser, and it doesn't
 know
  that the content in script tags should be read as plain text.
  % is invalid XML tag name.
 
  Solutions:
 
  1) replace % % with different delimiters.
  I am not sure which templating library you use but I know few JS libs
 that
  support this.
 
  2) wrap the content of the script in CDATA
 
  3) adding a new wicket:xyz attribute that will tell Wicket to not process
  the children of script
 
 
   /div
   /div
   /script
  
   was parsed OK. On Wicket 6.14.0 I get
  
   ==
  
   2014-02-22 07:42:48,618 [qtp757902664-22] ERROR
   [org.apache.wicket.DefaultExceptionMapper] - Unexpected error occurred
   org.apache.wicket.markup.MarkupException: Malformed tag (line 73,
 column
   17)
   at
  
  
 
 org.apache.wicket.markup.AbstractMarkupParser.parseMarkup(AbstractMarkupParser.java:301)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:183)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
 org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
 org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.getBaseMarkup(InheritedMarkupMarkupLoader.java:99)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:68)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
 org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
 org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at
  
  
 
 org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:405)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at org.apache.wicket.Component.getMarkup(Component.java:728)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at org.apache.wicket.Component.internalRender(Component.java:2346)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at org.apache.wicket.Component.render(Component.java:2309)
   ~[wicket-core-6.14.0.jar:6.14.0]
   at org.apache.wicket.Page.renderPage(Page.java:1024)
   

Re: bug or new feature

2014-02-24 Thread Ernesto Reinaldo Barreiro
Well I have not tried adding a CDATA but I do not see why it should not
work... My point is backward compatibility. As a user this is an
unexpected change: I just upgrade my application and it suddenly stops
working.


On Mon, Feb 24, 2014 at 10:59 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 On Mon, Feb 24, 2014 at 11:56 AM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

  3) was what i have suggested in issue... wicket:nosacan=true but
 for
  backward compatibility it would be nice if it the other way around.
  wicket:scan='true'
 

 The question is: is it really needed ? I'd like to avoid adding more custom
 attributes if there is a way to avoid it.
 does 1) or 2) solve the issue ?


 
 
  On Mon, Feb 24, 2014 at 9:11 AM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   Hi Ernesto,
  
  
   On Sat, Feb 22, 2014 at 8:46 AM, Ernesto Reinaldo Barreiro 
   reier...@gmail.com wrote:
  
On Wicket 6.13.0 following code
   
script type=text/template id=message-template
div class=sender pull-left
div class=icon
img src=img/2.jpg class=img-circle alt=/
/div
div class=time
just now
/div
/div
div class=chat-message-body
span class=arrow/span
div class=senderTikhon Laninga/div
div class=text
%- text %
   
  
   The problem should be here.
   Wicket's XmlPullParser is XML parser, not HTML parser, and it doesn't
  know
   that the content in script tags should be read as plain text.
   % is invalid XML tag name.
  
   Solutions:
  
   1) replace % % with different delimiters.
   I am not sure which templating library you use but I know few JS libs
  that
   support this.
  
   2) wrap the content of the script in CDATA
  
   3) adding a new wicket:xyz attribute that will tell Wicket to not
 process
   the children of script
  
  
/div
/div
/script
   
was parsed OK. On Wicket 6.14.0 I get
   
==
   
2014-02-22 07:42:48,618 [qtp757902664-22] ERROR
[org.apache.wicket.DefaultExceptionMapper] - Unexpected error
 occurred
org.apache.wicket.markup.MarkupException: Malformed tag (line 73,
  column
17)
at
   
   
  
 
 org.apache.wicket.markup.AbstractMarkupParser.parseMarkup(AbstractMarkupParser.java:301)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:183)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
  org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
~[wicket-core-6.14.0.jar:6.14.0]
at
  org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
~[wicket-core-6.14.0.jar:6.14.0]
at
 org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
~[wicket-core-6.14.0.jar:6.14.0]
at
  
 org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.getBaseMarkup(InheritedMarkupMarkupLoader.java:99)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:68)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
  org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
~[wicket-core-6.14.0.jar:6.14.0]
at
  org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
~[wicket-core-6.14.0.jar:6.14.0]
at
 org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
~[wicket-core-6.14.0.jar:6.14.0]
at
  
 org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
~[wicket-core-6.14.0.jar:6.14.0]
at
  
 org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
~[wicket-core-6.14.0.jar:6.14.0]
at
   
   
  
 
 

Re: Translate wicket app to new domain

2014-02-24 Thread haiko

Hi Tron,

If you mean a new domain on a object level, you could try to create an  
abstract level of your domain which fits animals and the other domains  
and have wicket components and models use that.


Regards,

Haiko

Tron Walseth t...@telespor.no schreef:


Hi all

We have made a wicket app for a very specific domain (animal tracking)

Now we have multiple customer requests for completely different  
domains, but the functionality is mainly the same.


Is there an easy way of translating our web pages to new solution domains?

Tron






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



Re: Problem with FormTester and EJB Injection

2014-02-24 Thread Martin Grigorov
I'd bet that

@Override
public void init() {
super.init();

try {
new CdiConfiguration(CDI.current().getBeanManager()).configure(this);
} catch (IllegalStateException e) {

}

}

fails when running in unit test environment.
Fix it.

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 24, 2014 at 12:41 PM, Stefan Lorenz stefan.lor...@persis.dewrote:

 Hi,

 here is a quickstart app with the failing unit test.
 I know it's because of the Inject on the target page, but I don't know the
 right way to handle it in the tests.

 And this is the StrackTrace:

 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor 'public
 com.mycompany.TargetPage(org.apache.wicket.request.mapper.parameter.PageParameters)'
 and argument ''. An exception has been thrown during construction!
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76)
 at
 org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:133)
 at
 org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:268)
 at
 org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
 at
 org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
 at
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:269)
 at
 org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider$1.respond(BaseWicketTester.java:2657)
 at
 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
 at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
 at
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
 at
 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:654)
 at
 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:712)
 at
 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:593)
 at
 org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:565)
 at
 org.apache.wicket.util.tester.BaseWicketTester.submitForm(BaseWicketTester.java:1959)
 at
 org.apache.wicket.util.tester.FormTester.submit(FormTester.java:706)
 at
 com.mycompany.TestHomePage.homepageSubmitSuccessfully(TestHomePage.java:34)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
 at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
 at
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at
 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
 at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
 at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
 at
 org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
 at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at
 

Re: double type text field - auto roundsoff

2014-02-24 Thread nazeem
Today i noticed the same behaviour in another text field of type double. But
on refresh the issue was not repeating. So.. any clue to trouble shoot this
issue in this form ? where it is consistently reproduced.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/double-type-text-field-auto-roundsoff-tp4664628p4664650.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: double type text field - auto roundsoff

2014-02-24 Thread Sven Meier

Are you using HTML5's type=number?

Sven

On 02/24/2014 02:43 PM, nazeem wrote:

Today i noticed the same behaviour in another text field of type double. But
on refresh the issue was not repeating. So.. any clue to trouble shoot this
issue in this form ? where it is consistently reproduced.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/double-type-text-field-auto-roundsoff-tp4664628p4664650.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




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



Re: double type text field - auto roundsoff

2014-02-24 Thread Martin Grigorov
Hi,

What type attribute do you use for the input ?
Maybe the rounding happens at the client side.

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 24, 2014 at 3:43 PM, nazeem md.naz...@gmail.com wrote:

 Today i noticed the same behaviour in another text field of type double.
 But
 on refresh the issue was not repeating. So.. any clue to trouble shoot this
 issue in this form ? where it is consistently reproduced.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/double-type-text-field-auto-roundsoff-tp4664628p4664650.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




Forwarding to 404 Page

2014-02-24 Thread Tom Norton
Let's say I have a detail page with url /widgets/${id}.  If there is no
widget for the given id, how would I redirect the user to the 404 page?
 I'm using wicket 1.5.

Thanks,
Tom


Re: Forwarding to 404 Page

2014-02-24 Thread Martin Grigorov
Hi,

Since the application code reads the value of 'id' parameter and checks the
DB for an item with this id it is in your control to do:
setResponsePage(My404.class)

Another way is to define a page for 404 in web.xml and just throw
AbortWithHttpErrorCodeException(404). The rest will be handled by the web
container.

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 24, 2014 at 9:41 PM, Tom Norton 
tomwnorton.mailing.li...@gmail.com wrote:

 Let's say I have a detail page with url /widgets/${id}.  If there is no
 widget for the given id, how would I redirect the user to the 404 page?
  I'm using wicket 1.5.

 Thanks,
 Tom



[ANNOUNCE] WicketStuff 6.14.0 is released

2014-02-24 Thread Martin Grigorov
Hi,

WicketStuff core 6.14.0 based on Apache Wicket 6.14.0 is released and will
be available in Maven Central soon.

The changelog for this release is:

Rob Sonke (10):
  Compile against wicket 6.14
  Rewrote the fitBounds functionality partially to let it work in a non
ajax environment too Added an example application to demonstrate
fitbounds
  Removed commented old code
  Prevent npe in case of not using fitbounds
  Added Marker Clustering support
  Merge branch 'master' of https://github.com/wicketstuff/core into
wicketstuff-master
  Returning this from setter methods. Corrected whitespacing.
  Added null check for setMarkerCluster parameter. Corrected
whitespacing.
  Corrected whitespacing.
  Added check to avoid adding the JS file multiple times to the header.

Martin Tzvetanov Grigorov (5):
  Upgrade maven-javadoc-plugin to 2.9.1 (Fixes CVE)
  [datastores][common] Install/deploy -tests.jar for the mini testing
framework
  [gmap3] Fix code format - use spaces instead of tabs
  [scala] Update library versions
  Release 6.14.0

Emond Papegaaij (2):
  Fix warnings related to deprecated IPageLink
  license header

Martin Grigorov (2):
  Merge pull request #286 from robsonke/master
  Merge pull request #287 from robsonke/master

Maxim Solodovnik (2):
  Poster property is added to video tag
  isEmpty is used instead of string manipulations

svenmeier (2):
  special handling for list indices: return null when out of bounds
  safely handle classes with empty simpleName.

Michael Mosmann (1):
  serializer-ui module added

robsonke (1):
  Merge pull request #1 from wicketstuff/master


The WicketStuff team


Re: double type text field - auto roundsoff

2014-02-24 Thread nazeem
Here is the generated html

input type=text id=txInput209
name=forceForm_body:plannedQty:txfCntr:txInput value=1 class=full-width


On inspecting the DOM i see the set range text property set to 
setRangeText : setRangeText() 

If i remove the on blur event , the value remains as decimal, but I can't do
validations without onBlur. 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/double-type-text-field-auto-roundsoff-tp4664628p4664659.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: Generating Dynamic PDF using AjaxFallbackButton

2014-02-24 Thread Abigail
HI there
In modern enterprise's document management system, people often need to
process and handle large volumes of multi-page PDF document files.
Therefore, a professional  PDF document page processing
http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/   utility
will bring much convenience for users to manipulate and manage those PDF
files, especially when they are processing some PDF document files that have
over 500+ pages.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Generating-Dynamic-PDF-using-AjaxFallbackButton-tp4272343p4664660.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