Re: Page ... is not stateless ... but the stateless hint is set to true!

2013-02-11 Thread Martin Grigorov
Hi,


On Mon, Feb 11, 2013 at 1:34 AM, Tom Eicher t...@teicher.net wrote:


 Hello,

 I am receiving this message in the log

 01:27:01,006 WARN  [org.apache.wicket.Page] Page '[Page class =
 com.x.yy.components.**editor.Editor$EditorPage, id = 5, render
 count = 0]' is not stateless because it is not bookmarkable, but the
 stateless hint is set to true!


 and I have no idea why ;-) Actually, I never intended to be
 stateless (so far), so I thought I'd just give that stateless hint
 as false. But:

 setStatelessHint() cannot be called, since the warning is thrown
 directly from my page constructor's super()...

 And getStatelessHint() is final in Page and cannot be overridden...

 Stack (see: all my x calls are just super()s cascading up...)

 org.apache.wicket.Page.**isPageStateless(Page.java:445)
 org.apache.wicket.page.**AbstractPageManager.touchPage(**
 AbstractPageManager.java:130)
 org.apache.wicket.page.**PageManagerDecorator.**touchPage(**
 PageManagerDecorator.java:59)
 org.apache.wicket.page.**PageAccessSynchronizer$2.**touchPage(**
 PageAccessSynchronizer.java:**273)
 org.apache.wicket.Page.dirty(**Page.java:293)
 org.apache.wicket.markup.html.**WebPage.dirty(WebPage.java:**324)
 org.apache.wicket.Page.dirty(**Page.java:255)
 org.apache.wicket.Page.**componentStateChanging(Page.**java:934)
 org.apache.wicket.Component.**addStateChange(Component.java:**3518)
 org.apache.wicket.Behaviors.**add(Behaviors.java:61)
 org.apache.wicket.Component.**add(Component.java:4502)
 org.apache.wicket.devutils.**inspector.**RenderPerformanceListener.**
 onInstantiation(**RenderPerformanceListener.**java:52)
 org.apache.wicket.application.**ComponentInstantiationListener**
 Collection$1.notify(**ComponentInstantiationListener**Collection.java:38)
 org.apache.wicket.application.**ComponentInstantiationListener**
 Collection$1.notify(**ComponentInstantiationListener**Collection.java:34)
 org.apache.wicket.util.**listener.ListenerCollection.**
 notify(ListenerCollection.**java:80)
 org.apache.wicket.application.**ComponentInstantiationListener**
 Collection.onInstantiation(**ComponentInstantiationListener**
 Collection.java:33)
 org.apache.wicket.Component.**init(Component.java:683)
 org.apache.wicket.**MarkupContainer.init(**MarkupContainer.java:120)
 org.apache.wicket.Page.init(**Page.java:172)
 org.apache.wicket.Page.init(**Page.java:136)
 org.apache.wicket.markup.html.**WebPage.init(WebPage.java:**76)
 com.x.yy.base.**BasePage.init(BasePage.java:**31)
 com.x.yy.components.**editor.Editor$EditorPage.**
 init(Editor.java:97)
 com.x.yy.components.**editor.Editor$EditButtonPlain.**
 onClick(Editor.java:153)
 org.apache.wicket.markup.html.**link.Link.onLinkClicked(Link.**java:190)
 sun.reflect.**NativeMethodAccessorImpl.**invoke0(**
 NativeMethodAccessorImpl.java)
 sun.reflect.**NativeMethodAccessorImpl.**invoke(**
 NativeMethodAccessorImpl.java:**57)
 sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
 DelegatingMethodAccessorImpl.**java:43)
 java.lang.reflect.Method.**invoke(Method.java:601)
 org.apache.wicket.**RequestListenerInterface.**internalInvoke(**
 RequestListenerInterface.java:**258)
 org.apache.wicket.**RequestListenerInterface.**invoke(**
 RequestListenerInterface.java:**216)
 org.apache.wicket.core.**request.handler.**ListenerInterfaceRequestHandle*
 *r.invokeListener(**ListenerInterfaceRequestHandle**r.java:240)
 org.apache.wicket.core.**request.handler.**ListenerInterfaceRequestHandle*
 *r.respond(**ListenerInterfaceRequestHandle**r.java:226)
 org.apache.wicket.request.**cycle.RequestCycle$**HandlerExecutor.respond(*
 *RequestCycle.java:840)
 org.apache.wicket.request.**RequestHandlerStack.execute(**
 RequestHandlerStack.java:64)
 org.apache.wicket.request.**cycle.RequestCycle.execute(**
 RequestCycle.java:254)
 org.apache.wicket.request.**cycle.RequestCycle.**
 processRequest(RequestCycle.**java:211)
 org.apache.wicket.request.**cycle.RequestCycle.**processRequestAndDetach(*
 *RequestCycle.java:282)
 org.apache.wicket.protocol.**http.WicketFilter.**processRequestCycle(**
 WicketFilter.java:244)
 org.apache.wicket.protocol.**http.WicketFilter.**
 processRequest(WicketFilter.**java:188)
 org.apache.wicket.protocol.**http.WicketFilter.doFilter(**
 WicketFilter.java:267)
 org.apache.catalina.core.**ApplicationFilterChain.**internalDoFilter(**
 ApplicationFilterChain.java:**280)
 org.apache.catalina.core.**ApplicationFilterChain.**doFilter(**
 ApplicationFilterChain.java:**248)
 org.apache.catalina.core.**StandardWrapperValve.invoke(**
 StandardWrapperValve.java:275)
 org.apache.catalina.core.**StandardContextValve.invoke(**
 StandardContextValve.java:161)
 org.jboss.as.jpa.interceptor.**WebNonTxEmCloserValve.invoke(**
 WebNonTxEmCloserValve.java:50)
 org.jboss.as.web.security.**SecurityContextAssociationValv**e.invoke(**
 SecurityContextAssociationValv**e.java:153)
 org.apache.catalina.core.**StandardHostValve.invoke(**
 StandardHostValve.java:155)
 

Re: find html tag

2013-02-11 Thread Michael Jaruska

thanks, studied. but in my case not working. i don't know why, where is my 
mistake. try this code:

markup - base page:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
head
titlemy test page/title
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
/head
body
pmy test page/p
span wicket:id=myPanel[my test panel]/span
/body
/html

markup - my test panel:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
wicket:panel
   ul
  li
a href=./mypage.html?cid=menumy item/a
  /li
   /ul
/wicket:panel

java - base page:
public class PageBase extends WebPage{
public PageBase()
{
//my panel
this.add(new MyMenu(myPanel).setRenderBodyOnly(true));
}
}

java - panel:
ublic class MyMenu extends Panel{
public PanelMenu(String id)
{
super(id);
}

protected void onRender(MarkupStream markupStream){
while(markupStream.hasMore())
{
System.out.println(markupStream.next());
}
}
}


i expect on console printed whole html markup for panel, but nothing is 
displayed.

any ideas please?


On 10.2.2013 23:21, Sven Meier wrote:

See BorderBehavior#beforeRender(Component) on how to iterate over the markup.

Sven

On 02/10/2013 11:09 PM, Michael Jaruska wrote:

my quick test:
@Override
protected void onRender()
{
super.onRender();
System.out.println(this.getMarkup().toString());
}

get me just top-level tag in my panel, subtags isn't shown. how to get whole
markup for my panel?


On 10.2.2013 22:38, Sven Meier wrote:

Sure, with #getMarkup() you can get hold of the component's markup. With a 
MarkupStream you can iterate over it.

Sven

On 02/10/2013 10:23 PM, Michael Jaruska wrote:

again with my question: is it possible to get markup in onRender() of the 
component?
have found this article:
https://cwiki.apache.org/WICKET/component-rendering.html
but in onRender() section is just code snippet I'm not understand. is there more
detailed example how to get markup of the component in onRender()?

thanks, michael



On 23.1.2013 22:47, Martin Grigorov wrote:

You can use IMarkupFilter to manipulate the raw markup before being loaded
and used by the components.
See the implementations in Wicket to see what can be done with such filter.


On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska michael.jaru...@gmail.com

wrote:



Look at my original post. User clicks on a href=./mypage.html?cid=menu/*
*submenu/subsubmenu2**subsubmenu2/a, then
I have in String category (java code) value menu/submenu/subsubmenu2.
I need just to make 2 more steps:
1. in html code find anchor tag with href menu/submenu/subsubmenu2;
2. find li tag which is parent of the anchor from point 1;

When I have point 2 done, then I know how to put somethink into li tag...




On 23.1.2013 21:21, Bas Gooren wrote:


Ok, so you are indeed looking for a way to change a html attribute ;-)

Since you wrote (in your folluw-up e-mail) that you cannot generate the
html, there are some ways, but they mostly work outside of the normal
wicket way.

1) In the component which actually renders your static html override
onComponentTagBody and fiddle with the markup stream (e.g. look at
replaceComponentTagBody)

2) store the static html somewhere by itself, and create a custom model.
The model can then load the html and perform string replacement.
You can then add a label component which uses the model and has
setEscapeModelStrings(false) set.

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 23-1-2013 21:11, schreef Michael Jaruska:


I need to find the parent li tag of the anchor user clicks - I now
from PageParameters which anchor
has been clicked. Then I will put into this parent li specific
atribute (id=something). This attribute
will be then processed by JavaScript on the page.


On 23.1.2013 21:04, Bas Gooren wrote:


Sorry, I read too quickly.

What are you trying to accomplish? Let's say you are able to find the
appropriate html tag, what do you want to do with it?

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 23-1-2013 21:01, schreef Michael Jaruska:


And question is not how can I change html attribute but how can I
go through html structure and
find html tag with specific attribute :-)


On 23.1.2013 20:50, Bas Gooren wrote:


Hi!

What you want to accomplish (e.g. changing some html attributes) can
be done by adding an attributemodifier to each li component.

In pseudocode:

RepeatingView uls = ...
for_every_li:
WebMarkupContainer li = ...
uls.add(li);

now, you can do something like this:
li.add(new AttributeAppender(...) {
  isEnabled() {
  return true if you want to append a html attribute;
  }
});

Or alternatively:

WebMarkupContainer li = new WMC() {
  onComponentTag(ComponentTag tag) {
  super(tag);

  tag.put(my-html-attribute, value);
  }
}

Met 

Re: find html tag

2013-02-11 Thread Martin Grigorov
Hi,

What do you want to do with the markup ?
Maybe you don't need to bother with internals like MarkupStream for
something that may be solved much easier.


On Mon, Feb 11, 2013 at 10:01 AM, Michael Jaruska michael.jaru...@gmail.com
 wrote:

 thanks, studied. but in my case not working. i don't know why, where is my
 mistake. try this code:

 markup - base page:
 ?xml version=1.0 encoding=UTF-8 ?
 html xmlns:wicket
 head
 titlemy test page/title
 meta http-equiv=Content-Type content=text/html; charset=utf-8
 /
 /head
 body
 pmy test page/p
 span wicket:id=myPanel[my test panel]/span
 /body
 /html

 markup - my test panel:
 ?xml version=1.0 encoding=UTF-8 ?
 html xmlns:wicket
 wicket:panel
ul
   li
 a href=./mypage.html?cid=menu**my item/a
   /li
/ul
 /wicket:panel

 java - base page:
 public class PageBase extends WebPage{
 public PageBase()
 {
 //my panel
 this.add(new MyMenu(myPanel).**setRenderBodyOnly(true));
 }
 }

 java - panel:
 ublic class MyMenu extends Panel{
 public PanelMenu(String id)
 {
 super(id);
 }

 protected void onRender(MarkupStream markupStream){
 while(markupStream.hasMore())
 {
 System.out.println(**markupStream.next());
 }
 }
 }


 i expect on console printed whole html markup for panel, but nothing is
 displayed.

 any ideas please?



 On 10.2.2013 23:21, Sven Meier wrote:

 See BorderBehavior#beforeRender(**Component) on how to iterate over the
 markup.

 Sven

 On 02/10/2013 11:09 PM, Michael Jaruska wrote:

 my quick test:
 @Override
 protected void onRender()
 {
 super.onRender();
 System.out.println(this.**getMarkup().toString());
 }

 get me just top-level tag in my panel, subtags isn't shown. how to get
 whole
 markup for my panel?


 On 10.2.2013 22:38, Sven Meier wrote:

 Sure, with #getMarkup() you can get hold of the component's markup.
 With a MarkupStream you can iterate over it.

 Sven

 On 02/10/2013 10:23 PM, Michael Jaruska wrote:

 again with my question: is it possible to get markup in onRender() of
 the component?
 have found this article:
 https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html
 but in onRender() section is just code snippet I'm not understand. is
 there more
 detailed example how to get markup of the component in onRender()?

 thanks, michael



 On 23.1.2013 22:47, Martin Grigorov wrote:

 You can use IMarkupFilter to manipulate the raw markup before being
 loaded
 and used by the components.
 See the implementations in Wicket to see what can be done with such
 filter.


 On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska 
 michael.jaru...@gmail.com

 wrote:


  Look at my original post. User clicks on a
 href=./mypage.html?cid=menu/*
 *submenu/subsubmenu2subsubmenu2/a, then
 I have in String category (java code) value
 menu/submenu/subsubmenu2.
 I need just to make 2 more steps:
 1. in html code find anchor tag with href menu/submenu/subsubmenu2;
 2. find li tag which is parent of the anchor from point 1;

 When I have point 2 done, then I know how to put somethink into li
 tag...




 On 23.1.2013 21:21, Bas Gooren wrote:

  Ok, so you are indeed looking for a way to change a html attribute
 ;-)

 Since you wrote (in your folluw-up e-mail) that you cannot generate
 the
 html, there are some ways, but they mostly work outside of the
 normal
 wicket way.

 1) In the component which actually renders your static html override
 onComponentTagBody and fiddle with the markup stream (e.g. look at
 replaceComponentTagBody)

 2) store the static html somewhere by itself, and create a custom
 model.
 The model can then load the html and perform string replacement.
 You can then add a label component which uses the model and has
 setEscapeModelStrings(false) set.

 Met vriendelijke groet,
 Kind regards,

 Bas Gooren

 Op 23-1-2013 21:11, schreef Michael Jaruska:

  I need to find the parent li tag of the anchor user clicks - I
 now
 from PageParameters which anchor
 has been clicked. Then I will put into this parent li specific
 atribute (id=something). This attribute
 will be then processed by JavaScript on the page.


 On 23.1.2013 21:04, Bas Gooren wrote:

  Sorry, I read too quickly.

 What are you trying to accomplish? Let's say you are able to find
 the
 appropriate html tag, what do you want to do with it?

 Met vriendelijke groet,
 Kind regards,

 Bas Gooren

 Op 23-1-2013 21:01, schreef Michael Jaruska:

  And question is not how can I change html attribute but how
 can I
 go through html structure and
 find html tag with specific attribute :-)


 On 23.1.2013 20:50, Bas Gooren wrote:

  Hi!

 What you want to accomplish (e.g. changing some html
 attributes) can
 be done by adding an attributemodifier to each li 

Re: find html tag

2013-02-11 Thread Michael Jaruska

in fact, my panel is menu which is modified by javascript.
i need to keep track of the previous selected entry (to get know
javascript to disable element) and actual element to modify
(add class) for javascript.

javascript need to now at a moment page rendered where is
class which it is looking for.

so i need to modify html markup, modify it on client side by
javascript is not possible.

based on this article:
https://cwiki.apache.org/WICKET/component-rendering.html
it should be possible modify markup generated by component (my
panel).



On 11.2.2013 10:03, Martin Grigorov wrote:

Hi,

What do you want to do with the markup ?
Maybe you don't need to bother with internals like MarkupStream for
something that may be solved much easier.


On Mon, Feb 11, 2013 at 10:01 AM, Michael Jaruska michael.jaru...@gmail.com

wrote:



thanks, studied. but in my case not working. i don't know why, where is my
mistake. try this code:

markup - base page:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
 head
 titlemy test page/title
 meta http-equiv=Content-Type content=text/html; charset=utf-8
/
 /head
 body
 pmy test page/p
 span wicket:id=myPanel[my test panel]/span
 /body
/html

markup - my test panel:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
wicket:panel
ul
   li
 a href=./mypage.html?cid=menu**my item/a
   /li
/ul
/wicket:panel

java - base page:
public class PageBase extends WebPage{
 public PageBase()
 {
 //my panel
 this.add(new MyMenu(myPanel).**setRenderBodyOnly(true));
 }
}

java - panel:
ublic class MyMenu extends Panel{
 public PanelMenu(String id)
 {
 super(id);
 }

 protected void onRender(MarkupStream markupStream){
 while(markupStream.hasMore())
 {
 System.out.println(**markupStream.next());
 }
 }
}


i expect on console printed whole html markup for panel, but nothing is
displayed.

any ideas please?



On 10.2.2013 23:21, Sven Meier wrote:


See BorderBehavior#beforeRender(**Component) on how to iterate over the
markup.

Sven

On 02/10/2013 11:09 PM, Michael Jaruska wrote:


my quick test:
@Override
protected void onRender()
{
 super.onRender();
 System.out.println(this.**getMarkup().toString());
}

get me just top-level tag in my panel, subtags isn't shown. how to get
whole
markup for my panel?


On 10.2.2013 22:38, Sven Meier wrote:


Sure, with #getMarkup() you can get hold of the component's markup.
With a MarkupStream you can iterate over it.

Sven

On 02/10/2013 10:23 PM, Michael Jaruska wrote:


again with my question: is it possible to get markup in onRender() of
the component?
have found this article:
https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html
but in onRender() section is just code snippet I'm not understand. is
there more
detailed example how to get markup of the component in onRender()?

thanks, michael



On 23.1.2013 22:47, Martin Grigorov wrote:


You can use IMarkupFilter to manipulate the raw markup before being
loaded
and used by the components.
See the implementations in Wicket to see what can be done with such
filter.


On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska 
michael.jaru...@gmail.com


wrote:



  Look at my original post. User clicks on a

href=./mypage.html?cid=menu/*
*submenu/subsubmenu2subsubmenu2/a, then
I have in String category (java code) value
menu/submenu/subsubmenu2.
I need just to make 2 more steps:
1. in html code find anchor tag with href menu/submenu/subsubmenu2;
2. find li tag which is parent of the anchor from point 1;

When I have point 2 done, then I know how to put somethink into li
tag...




On 23.1.2013 21:21, Bas Gooren wrote:

  Ok, so you are indeed looking for a way to change a html attribute

;-)

Since you wrote (in your folluw-up e-mail) that you cannot generate
the
html, there are some ways, but they mostly work outside of the
normal
wicket way.

1) In the component which actually renders your static html override
onComponentTagBody and fiddle with the markup stream (e.g. look at
replaceComponentTagBody)

2) store the static html somewhere by itself, and create a custom
model.
The model can then load the html and perform string replacement.
You can then add a label component which uses the model and has
setEscapeModelStrings(false) set.

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 23-1-2013 21:11, schreef Michael Jaruska:

  I need to find the parent li tag of the anchor user clicks - I

now
from PageParameters which anchor
has been clicked. Then I will put into this parent li specific
atribute (id=something). This attribute
will be then processed by JavaScript on the page.


On 23.1.2013 21:04, Bas Gooren wrote:

  Sorry, I read too quickly.


What are you trying to 

Re: find html tag

2013-02-11 Thread Martin Grigorov
MarkupStream gives you the raw html that comes from the .html file, i.e.
from the template file.
It doesn't give you the html from the previous page render.

You need to send Ajax requests to update the server side state to be in
sync with the client side state (modified by your JS).

On Mon, Feb 11, 2013 at 11:22 AM, Michael Jaruska michael.jaru...@gmail.com
 wrote:

 in fact, my panel is menu which is modified by javascript.
 i need to keep track of the previous selected entry (to get know
 javascript to disable element) and actual element to modify
 (add class) for javascript.

 javascript need to now at a moment page rendered where is
 class which it is looking for.

 so i need to modify html markup, modify it on client side by
 javascript is not possible.

 based on this article:
 https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html
 it should be possible modify markup generated by component (my
 panel).




 On 11.2.2013 10:03, Martin Grigorov wrote:

 Hi,

 What do you want to do with the markup ?
 Maybe you don't need to bother with internals like MarkupStream for
 something that may be solved much easier.


 On Mon, Feb 11, 2013 at 10:01 AM, Michael Jaruska 
 michael.jaru...@gmail.com

 wrote:


  thanks, studied. but in my case not working. i don't know why, where is
 my
 mistake. try this code:

 markup - base page:
 ?xml version=1.0 encoding=UTF-8 ?
 html xmlns:wicket
  head
  titlemy test page/title
  meta http-equiv=Content-Type content=text/html;
 charset=utf-8
 /
  /head
  body
  pmy test page/p
  span wicket:id=myPanel[my test panel]/span
  /body
 /html

 markup - my test panel:
 ?xml version=1.0 encoding=UTF-8 ?
 html xmlns:wicket
 wicket:panel
 ul
li
  a href=./mypage.html?cid=menumy item/a

/li
 /ul
 /wicket:panel

 java - base page:
 public class PageBase extends WebPage{
  public PageBase()
  {
  //my panel
  this.add(new MyMenu(myPanel).
 setRenderBodyOnly(true));

  }
 }

 java - panel:
 ublic class MyMenu extends Panel{
  public PanelMenu(String id)
  {
  super(id);
  }

  protected void onRender(MarkupStream markupStream){
  while(markupStream.hasMore())
  {
  System.out.println(markupStream.next());

  }
  }
 }


 i expect on console printed whole html markup for panel, but nothing is
 displayed.

 any ideas please?



 On 10.2.2013 23:21, Sven Meier wrote:

  See BorderBehavior#beforeRender(Component) on how to iterate over
 the

 markup.

 Sven

 On 02/10/2013 11:09 PM, Michael Jaruska wrote:

  my quick test:
 @Override
 protected void onRender()
 {
  super.onRender();
  System.out.println(this.getMarkup().toString());

 }

 get me just top-level tag in my panel, subtags isn't shown. how to get
 whole
 markup for my panel?


 On 10.2.2013 22:38, Sven Meier wrote:

  Sure, with #getMarkup() you can get hold of the component's markup.
 With a MarkupStream you can iterate over it.

 Sven

 On 02/10/2013 10:23 PM, Michael Jaruska wrote:

  again with my question: is it possible to get markup in onRender() of
 the component?
 have found this article:
 https://cwiki.apache.org/WICKET/component-rendering.htmlhttps://cwiki.apache.org/**WICKET/component-rendering.**html
 https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html
 

 but in onRender() section is just code snippet I'm not understand. is
 there more
 detailed example how to get markup of the component in onRender()?

 thanks, michael



 On 23.1.2013 22:47, Martin Grigorov wrote:

  You can use IMarkupFilter to manipulate the raw markup before being
 loaded
 and used by the components.
 See the implementations in Wicket to see what can be done with such
 filter.


 On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska 
 michael.jaru...@gmail.com

  wrote:


   Look at my original post. User clicks on a

 href=./mypage.html?cid=menu/*
 *submenu/subsubmenu2**subsubmenu2/a, then

 I have in String category (java code) value
 menu/submenu/subsubmenu2.
 I need just to make 2 more steps:
 1. in html code find anchor tag with href
 menu/submenu/subsubmenu2;
 2. find li tag which is parent of the anchor from point 1;

 When I have point 2 done, then I know how to put somethink into
 li
 tag...




 On 23.1.2013 21:21, Bas Gooren wrote:

   Ok, so you are indeed looking for a way to change a html
 attribute

 ;-)

 Since you wrote (in your folluw-up e-mail) that you cannot
 generate
 the
 html, there are some ways, but they mostly work outside of the
 normal
 wicket way.

 1) In the component which actually renders your static html
 override
 onComponentTagBody and fiddle with the markup stream (e.g. look at
 

Re: Differences in HeaderResponses: Wicket 1.4 vs 6

2013-02-11 Thread Martin Grigorov
Hi Lawrence,

As far as I know this is not available out-of-the-box in Wicket 6. Sorry.
The good news is that the resource filtering and bundle-ing is much simpler
than in 1.4.x so I think you should be able to accomplish it.


On Sat, Feb 9, 2013 at 9:27 PM, Lawrence Gadban lgad...@gmail.com wrote:

 Hello,

 We are currently involved in a migration effort from Wicket 1.4 to Wicket
 6. As it currently stands, we are heavily leveraging the various
 DecoratingHeaderResponses available in Wicket 1.4 to inject resource
 dependencies, aggregate resources into collections of similar types, and to
 filter the resources into header and footer sections as appropriate.

 From what we can gather, the appropriate replacements in Wicket 6 would be:
 1. Dependencies can managed by setting the dependencies themselves on the
 ResourceReference
 2. Aggregation of resources can handled by the ResourceAggregator
 3. Filtering of header items can be handled by FilteringHeaderResponse

 However, we do see a gap in the logic of the two versions and would like to
 get opinions from the experts on this list. In Wicket 1.4, the
 AbstractResourceAggregatingHeaderResponse iterated through all resources
 rendered to it and would separate them into ResourceReferenceCollections.
 These collections would then be rendered as one to the markup.

 Wicket 6 seems to lack this functionality. We originally thought we could
 use ResourceBundles to achieve this but bundles seem to be more static
 whereas collections will differ per request. Since a specific resource can
 only be present in one bundle it seems that we could be caught rendering
 resources that were unnecessary due to the bundling.

 What we need is a way to gather all the resources to be rendered (and their
 dependencies), separate them into collections based only on the resources
 present, and then render each collection as one resource to the browser. We
 would like to stay as close to out-of-the-box Wicket as possible, so any
 guidance would be greatly appreciated.

 Thanks,
 Lawrence Gadban




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: find html tag

2013-02-11 Thread Michael Jaruska

yes, i need that raw html that comes from markup (my .html file which is my 
panel),
in java code i will modify it (one step for put new class) and send it to 
client :-)
as i thnik now i dont need to delete previous step because this modifying isn't 
in
markup. so i just need to modify markup in actual render - modify markup stream.


On 11.2.2013 11:26, Martin Grigorov wrote:

MarkupStream gives you the raw html that comes from the .html file, i.e.
from the template file.
It doesn't give you the html from the previous page render.

You need to send Ajax requests to update the server side state to be in
sync with the client side state (modified by your JS).

On Mon, Feb 11, 2013 at 11:22 AM, Michael Jaruska michael.jaru...@gmail.com

wrote:



in fact, my panel is menu which is modified by javascript.
i need to keep track of the previous selected entry (to get know
javascript to disable element) and actual element to modify
(add class) for javascript.

javascript need to now at a moment page rendered where is
class which it is looking for.

so i need to modify html markup, modify it on client side by
javascript is not possible.

based on this article:
https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html
it should be possible modify markup generated by component (my
panel).




On 11.2.2013 10:03, Martin Grigorov wrote:


Hi,

What do you want to do with the markup ?
Maybe you don't need to bother with internals like MarkupStream for
something that may be solved much easier.


On Mon, Feb 11, 2013 at 10:01 AM, Michael Jaruska 
michael.jaru...@gmail.com


wrote:



  thanks, studied. but in my case not working. i don't know why, where is

my
mistake. try this code:

markup - base page:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
  head
  titlemy test page/title
  meta http-equiv=Content-Type content=text/html;
charset=utf-8
/
  /head
  body
  pmy test page/p
  span wicket:id=myPanel[my test panel]/span
  /body
/html

markup - my test panel:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
wicket:panel
 ul
li
  a href=./mypage.html?cid=menumy item/a

/li
 /ul
/wicket:panel

java - base page:
public class PageBase extends WebPage{
  public PageBase()
  {
  //my panel
  this.add(new MyMenu(myPanel).
setRenderBodyOnly(true));

  }
}

java - panel:
ublic class MyMenu extends Panel{
  public PanelMenu(String id)
  {
  super(id);
  }

  protected void onRender(MarkupStream markupStream){
  while(markupStream.hasMore())
  {
  System.out.println(markupStream.next());

  }
  }
}


i expect on console printed whole html markup for panel, but nothing is
displayed.

any ideas please?



On 10.2.2013 23:21, Sven Meier wrote:

  See BorderBehavior#beforeRender(Component) on how to iterate over

the

markup.

Sven

On 02/10/2013 11:09 PM, Michael Jaruska wrote:

  my quick test:

@Override
protected void onRender()
{
  super.onRender();
  System.out.println(this.getMarkup().toString());

}

get me just top-level tag in my panel, subtags isn't shown. how to get
whole
markup for my panel?


On 10.2.2013 22:38, Sven Meier wrote:

  Sure, with #getMarkup() you can get hold of the component's markup.

With a MarkupStream you can iterate over it.

Sven

On 02/10/2013 10:23 PM, Michael Jaruska wrote:

  again with my question: is it possible to get markup in onRender() of

the component?
have found this article:
https://cwiki.apache.org/WICKET/component-rendering.htmlhttps://cwiki.apache.org/**WICKET/component-rendering.**html
https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html




but in onRender() section is just code snippet I'm not understand. is
there more
detailed example how to get markup of the component in onRender()?

thanks, michael



On 23.1.2013 22:47, Martin Grigorov wrote:

  You can use IMarkupFilter to manipulate the raw markup before being

loaded
and used by the components.
See the implementations in Wicket to see what can be done with such
filter.


On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska 
michael.jaru...@gmail.com

  wrote:




   Look at my original post. User clicks on a


href=./mypage.html?cid=menu/*
*submenu/subsubmenu2**subsubmenu2/a, then

I have in String category (java code) value
menu/submenu/subsubmenu2.
I need just to make 2 more steps:
1. in html code find anchor tag with href
menu/submenu/subsubmenu2;
2. find li tag which is parent of the anchor from point 1;

When I have point 2 done, then I know how to put somethink into
li
tag...




On 23.1.2013 21:21, Bas Gooren wrote:

   Ok, so you are indeed looking for a way to change a html
attribute



Re: find html tag

2013-02-11 Thread Michael Jaruska

based on this article:
https://cwiki.apache.org/WICKET/component-rendering.html in section onRender()
it should be possible to modify markup which is going from wicket (e.g. from 
.html file)
and modyfied it send to client.


On 11.2.2013 11:34, Michael Jaruska wrote:

yes, i need that raw html that comes from markup (my .html file which is my 
panel),
in java code i will modify it (one step for put new class) and send it to 
client :-)
as i thnik now i dont need to delete previous step because this modifying isn't 
in
markup. so i just need to modify markup in actual render - modify markup stream.


On 11.2.2013 11:26, Martin Grigorov wrote:

MarkupStream gives you the raw html that comes from the .html file, i.e.
from the template file.
It doesn't give you the html from the previous page render.

You need to send Ajax requests to update the server side state to be in
sync with the client side state (modified by your JS).

On Mon, Feb 11, 2013 at 11:22 AM, Michael Jaruska michael.jaru...@gmail.com

wrote:



in fact, my panel is menu which is modified by javascript.
i need to keep track of the previous selected entry (to get know
javascript to disable element) and actual element to modify
(add class) for javascript.

javascript need to now at a moment page rendered where is
class which it is looking for.

so i need to modify html markup, modify it on client side by
javascript is not possible.

based on this article:
https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html
it should be possible modify markup generated by component (my
panel).




On 11.2.2013 10:03, Martin Grigorov wrote:


Hi,

What do you want to do with the markup ?
Maybe you don't need to bother with internals like MarkupStream for
something that may be solved much easier.


On Mon, Feb 11, 2013 at 10:01 AM, Michael Jaruska 
michael.jaru...@gmail.com


wrote:



  thanks, studied. but in my case not working. i don't know why, where is

my
mistake. try this code:

markup - base page:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
  head
  titlemy test page/title
  meta http-equiv=Content-Type content=text/html;
charset=utf-8
/
  /head
  body
  pmy test page/p
  span wicket:id=myPanel[my test panel]/span
  /body
/html

markup - my test panel:
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket
wicket:panel
 ul
li
  a href=./mypage.html?cid=menumy item/a

/li
 /ul
/wicket:panel

java - base page:
public class PageBase extends WebPage{
  public PageBase()
  {
  //my panel
  this.add(new MyMenu(myPanel).
setRenderBodyOnly(true));

  }
}

java - panel:
ublic class MyMenu extends Panel{
  public PanelMenu(String id)
  {
  super(id);
  }

  protected void onRender(MarkupStream markupStream){
  while(markupStream.hasMore())
  {
  System.out.println(markupStream.next());

  }
  }
}


i expect on console printed whole html markup for panel, but nothing is
displayed.

any ideas please?



On 10.2.2013 23:21, Sven Meier wrote:

  See BorderBehavior#beforeRender(Component) on how to iterate over

the

markup.

Sven

On 02/10/2013 11:09 PM, Michael Jaruska wrote:

  my quick test:

@Override
protected void onRender()
{
  super.onRender();
  System.out.println(this.getMarkup().toString());

}

get me just top-level tag in my panel, subtags isn't shown. how to get
whole
markup for my panel?


On 10.2.2013 22:38, Sven Meier wrote:

  Sure, with #getMarkup() you can get hold of the component's markup.

With a MarkupStream you can iterate over it.

Sven

On 02/10/2013 10:23 PM, Michael Jaruska wrote:

  again with my question: is it possible to get markup in onRender() of

the component?
have found this article:
https://cwiki.apache.org/WICKET/component-rendering.htmlhttps://cwiki.apache.org/**WICKET/component-rendering.**html
https://cwiki.apache.org/**WICKET/component-rendering.**htmlhttps://cwiki.apache.org/WICKET/component-rendering.html




but in onRender() section is just code snippet I'm not understand. is
there more
detailed example how to get markup of the component in onRender()?

thanks, michael



On 23.1.2013 22:47, Martin Grigorov wrote:

  You can use IMarkupFilter to manipulate the raw markup before being

loaded
and used by the components.
See the implementations in Wicket to see what can be done with such
filter.


On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska 
michael.jaru...@gmail.com

  wrote:




   Look at my original post. User clicks on a


href=./mypage.html?cid=menu/*
*submenu/subsubmenu2**subsubmenu2/a, then

I have in String category (java code) value
menu/submenu/subsubmenu2.
I need just to make 2 more steps:
1. in html code find anchor tag with href

Wicket + WebLogic problem

2013-02-11 Thread mitziuro
we have the following page that renders a pdf:

public BillPdf(PageParameters pageParameters) {

...
public BillPdf(PageParameters pageParameters) {
getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceRequestHandler(new 
ByteArrayResource(MIME_PDF) {

private static final long 
serialVersionUID = -6932336945497418950L;
private byte[] pdfData = null;

 @Override
 protected  byte[]  
getData(IResource.Attributes attributes){
 ...
 return pdfData;
 }
 
 @Override
 protected void 
configureResponse(AbstractResource.ResourceResponse
response, IResource.Attributes attributes) {
 
response.setContentDisposition(ContentDisposition.INLINE);
 
response.setContentType(MIME_PDF);
 
response.setContentLength(pdfData.length);
 }
 

}, pageParameters));
}
}

and from time to time for some pdfs we have: 

java.lang.IllegalStateException: Response already committed
 at
weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java:1651)
 at
weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:871)
 at
weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:867)
 at
org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:268)
 at
org.apache.wicket.protocol.http.HeaderBufferingWebResponse.sendRedirect(HeaderBufferingWebResponse.java:117)
 at
org.apache.wicket.request.handler.render.WebPageRenderer.redirectTo(WebPageRenderer.java:150)
 at
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:286)
 at
org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
 at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:840)
 at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at
org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:303)
 at
org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:312)
 at
org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:312)
 at
org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:312)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:226)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
 at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
 at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
 at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:267)
 at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
 at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3288)
 at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3254)
 at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
 at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
 at
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2163)
 at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2089)
 at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2074)
 at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1513)
 at
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Any related treads or ideas?

We're using wicket 6.0 but we've tried even with 6.5.
The problem is in HeaderBufferingWebResponse

...
@Override
 public void setDateHeader(String name, Time date)
 {
  Args.notNull(date, date);
  *checkHeader();*
  bufferedResponse.setDateHeader(name, 

Re: Wicket + WebLogic problem

2013-02-11 Thread Martin Grigorov
Hi,

From the stacktrace we can see that a redirect is attempted.

org.apache.wicket.request.handler.render.WebPageRenderer.redirectTo(
WebPageRenderer.java:150)
means that a page is being rendered. And this page url is different from
the url of the previous page, so a redirect is issued.

I think your PDF request handler is not releted to the problem.


On Mon, Feb 11, 2013 at 3:25 PM, mitziuro mitzi...@gmail.com wrote:

 we have the following page that renders a pdf:

 public BillPdf(PageParameters pageParameters) {

 ...
 public BillPdf(PageParameters pageParameters) {
 getRequestCycle().scheduleRequestHandlerAfterCurrent(
 new ResourceRequestHandler(new
 ByteArrayResource(MIME_PDF) {

 private static final long
 serialVersionUID = -6932336945497418950L;
 private byte[] pdfData = null;

  @Override
  protected  byte[]
  getData(IResource.Attributes attributes){
  ...
  return pdfData;
  }

  @Override
  protected void
 configureResponse(AbstractResource.ResourceResponse
 response, IResource.Attributes attributes) {

  response.setContentDisposition(ContentDisposition.INLINE);

  response.setContentType(MIME_PDF);

  response.setContentLength(pdfData.length);
  }


 }, pageParameters));
 }
 }

 and from time to time for some pdfs we have:

 java.lang.IllegalStateException: Response already committed
  at

 weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java:1651)
  at

 weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:871)
  at

 weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:867)
  at

 org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:268)
  at

 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.sendRedirect(HeaderBufferingWebResponse.java:117)
  at

 org.apache.wicket.request.handler.render.WebPageRenderer.redirectTo(WebPageRenderer.java:150)
  at

 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:286)
  at

 org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
  at

 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:840)
  at

 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at

 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:303)
  at

 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:312)
  at

 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:312)
  at

 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:312)
  at

 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:226)
  at

 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
  at

 org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
  at

 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at

 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:267)
  at
 weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
  at

 weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3288)
  at

 weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3254)
  at

 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
  at
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
  at
 weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
  at

 weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2163)
  at

 weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2089)
  at

 weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2074)
  at

 weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1513)
  at

 weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
  at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

 Any related treads or ideas?

 We're using wicket 6.0 but we've 

IE DropDown onChange behavior not triggered on first time

2013-02-11 Thread divad91
Hi,
I have a strange behavior on dropdowns with Internet Explorer and wicket
onchange behavior.

I have a basic DropDownChoice with a basic onchange
AjaxFormComponentUpdatingBehavior.

The first time I enter the page, the onchange event will not be triggered on
first click.
To make the onchange trigger, I need to select a value in the drop down and
click anywhere else on the page. This behavior occurs only on the first page
access. 

I found a work around by adding an hidden ajax link in the page and binding
the onchange event via jQuery.

I was just wondering if anyone else had this problem ?

Thanks
Dav



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IE-DropDown-onChange-behavior-not-triggered-on-first-time-tp4656237.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: Wicket + WebLogic problem

2013-02-11 Thread mitziuro
More details:

*I have this html code*

embed id=Pdf wicket:id=bill_pdf width=1090px type=application/pdf
scrolling=no

*related to*

add(new Label(bill_pdf) {

   @Override
protected void onComponentTag(final ComponentTag tag){
super.onComponentTag(tag);

PageParameters pageParameters = new PageParameters();
pageParameters.add(Constants.ID_BILL_PARAM, bill.getId());

   tag.put(src, urlFor(BillPdf.class, pageParameters) +
NO_ADOBE_MENU_DISPLAY);
}

}

the url points to BillPdf (@see previous code).

About the issue.
I can't reproduce it on my computer. My colleague can.
*It happens only in IE8 kiosk-mode.
On ff, chrome, ie9, ie8 (non-kiosk-mode) works fine*
In production we have that error (and the pdf it's not delivered) from time
to time and not on all stations(3 out of 10.

I've noticed that wicket has some browser specific code in some classes.
If someone knows any reported bug about this (on IE) or I'm using wicket in
a wrong way, please tell me.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-WebLogic-problem-tp4656235p4656238.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: IE DropDown onChange behavior not triggered on first time

2013-02-11 Thread Paul Bors
Well, are you using Wicket 1.5.x or Wicket 6.x?
Wicket 6.x comes with jQuery already so you might have a conflict between
those two libraries? (I'm not sure about this, never run into it)
Btw, in IE on onChange is preatty much equivalent to an onBlur since the
onChange dosen't bubble:
http://msdn.microsoft.com/en-us/library/ms536912%28VS.85,loband%29.aspx
Are you changing the value of the select programatically (updating the
value via JS)?
http://social.msdn.microsoft.com/Forums/pl/iewebdevelopment/thread/3f6a7ea0-0779-441f-ad58-7a0b974643ea
~ Thank you,
Paul Bors

On Mon, Feb 11, 2013 at 10:45 AM, divad91 diva...@hotmail.com wrote:

 Hi,
 I have a strange behavior on dropdowns with Internet Explorer and wicket
 onchange behavior.

 I have a basic DropDownChoice with a basic onchange
 AjaxFormComponentUpdatingBehavior.

 The first time I enter the page, the onchange event will not be triggered
 on
 first click.
 To make the onchange trigger, I need to select a value in the drop down and
 click anywhere else on the page. This behavior occurs only on the first
 page
 access.

 I found a work around by adding an hidden ajax link in the page and binding
 the onchange event via jQuery.

 I was just wondering if anyone else had this problem ?

 Thanks
 Dav



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/IE-DropDown-onChange-behavior-not-triggered-on-first-time-tp4656237.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: Same Panel, but Formatted in 2 Different Ways (Diff. Presentation)

2013-02-11 Thread eugenebalt
Thanks, Variants worked.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Same-Panel-but-Formatted-in-2-Different-Ways-Diff-Presentation-tp4656063p4656240.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: IE DropDown onChange behavior not triggered on first time

2013-02-11 Thread divad91
Sorry, i am using wicket 1.4.21.

My onchange behavior does not change the value. My behavior only prepend
javascript only for a specific value. 

I am not changing the value programatically. On first page acces, if I
select any option in the drowndown, the onchange event will not be trigger
except if I click anywhere else on the page.
If I come back in the same page, the same scenario will work without
clicking anywhere else in the page.

Thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IE-DropDown-onChange-behavior-not-triggered-on-first-time-tp4656237p4656241.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: IE DropDown onChange behavior not triggered on first time

2013-02-11 Thread Paul Bors
I'm on Wicket 1.5.x w/ IE 9 and the following behavior attached to a
DropDownChoice works just fine for me:

new AjaxEventBehavior(onchange) {
  private static final long serialVersionUID = 1L;
  @Override
  protected void onEvent(AjaxRequestTarget target) {
System.out.println(onchange of:  + getComponent().getId());
  }
}
~ Thank you,
   Paul Bors

On Mon, Feb 11, 2013 at 11:21 AM, divad91 diva...@hotmail.com wrote:

 Sorry, i am using wicket 1.4.21.

 My onchange behavior does not change the value. My behavior only prepend
 javascript only for a specific value.

 I am not changing the value programatically. On first page acces, if I
 select any option in the drowndown, the onchange event will not be trigger
 except if I click anywhere else on the page.
 If I come back in the same page, the same scenario will work without
 clicking anywhere else in the page.

 Thanks




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/IE-DropDown-onChange-behavior-not-triggered-on-first-time-tp4656237p4656241.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




AjaxButton and a HiddenField

2013-02-11 Thread Entropy
I have a javascript component that updates a HiddenField.  Then I want to
submit to the server via an AjaxButton.  It all works fine until I try to
get the value of the hiddenField which evidently did NOT hitch a ride on the
Ajax request.  How do I get the hiddenfield to join the ajax request?

Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxButton-and-a-HiddenField-tp4656246.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: Page ... is not stateless ... but the stateless hint is set to true!

2013-02-11 Thread Tom Eicher


Hello Martin,

 Put a breakpoint at Page#setStatelessHint() and see where it is called
 with value == true.

It is not being called. That is, not before the warn message appears
in the log. statelesshint=true must be the deafult...?

My BasePage ist just
...
public class BasePage extends WebPage {

@Inject Logger log;

public BasePage() { //this is line 31 from the stack trace below
YYSession session = (YYSession)getSession();
...

so I feel rather innocent about the message...

Cheers, Tom.





Hello,

I am receiving this message in the log

01:27:01,006 WARN  [org.apache.wicket.Page] Page '[Page class =
com.x.yy.components.__editor.Editor$EditorPage, id = 5,
render count = 0]' is not stateless because it is not bookmarkable,
but the stateless hint is set to true!


and I have no idea why ;-) Actually, I never intended to be
stateless (so far), so I thought I'd just give that stateless hint
as false. But:

setStatelessHint() cannot be called, since the warning is thrown
directly from my page constructor's super()...

And getStatelessHint() is final in Page and cannot be overridden...

Stack (see: all my x calls are just super()s cascading up...)

org.apache.wicket.Page.__isPageStateless(Page.java:445)

org.apache.wicket.page.__AbstractPageManager.touchPage(__AbstractPageManager.java:130)

org.apache.wicket.page.__PageManagerDecorator.__touchPage(__PageManagerDecorator.java:59)

org.apache.wicket.page.__PageAccessSynchronizer$2.__touchPage(__PageAccessSynchronizer.java:__273)
org.apache.wicket.Page.dirty(__Page.java:293)
org.apache.wicket.markup.html.__WebPage.dirty(WebPage.java:__324)
org.apache.wicket.Page.dirty(__Page.java:255)
org.apache.wicket.Page.__componentStateChanging(Page.__java:934)
org.apache.wicket.Component.__addStateChange(Component.java:__3518)
org.apache.wicket.Behaviors.__add(Behaviors.java:61)
org.apache.wicket.Component.__add(Component.java:4502)

org.apache.wicket.devutils.__inspector.__RenderPerformanceListener.__onInstantiation(__RenderPerformanceListener.__java:52)

org.apache.wicket.application.__ComponentInstantiationListener__Collection$1.notify(__ComponentInstantiationListener__Collection.java:38)

org.apache.wicket.application.__ComponentInstantiationListener__Collection$1.notify(__ComponentInstantiationListener__Collection.java:34)

org.apache.wicket.util.__listener.ListenerCollection.__notify(ListenerCollection.__java:80)

org.apache.wicket.application.__ComponentInstantiationListener__Collection.onInstantiation(__ComponentInstantiationListener__Collection.java:33)
org.apache.wicket.Component.__init(Component.java:683)
org.apache.wicket.__MarkupContainer.init(__MarkupContainer.java:120)
org.apache.wicket.Page.init(__Page.java:172)
org.apache.wicket.Page.init(__Page.java:136)
org.apache.wicket.markup.html.__WebPage.init(WebPage.java:__76)
com.x.yy.base.__BasePage.init(BasePage.java:__31)

com.x.yy.components.__editor.Editor$EditorPage.__init(Editor.java:97)

com.x.yy.components.__editor.Editor$EditButtonPlain.__onClick(Editor.java:153)
org.apache.wicket.markup.html.__link.Link.onLinkClicked(Link.__java:190)

sun.reflect.__NativeMethodAccessorImpl.__invoke0(__NativeMethodAccessorImpl.java)

sun.reflect.__NativeMethodAccessorImpl.__invoke(__NativeMethodAccessorImpl.java:__57)

sun.reflect.__DelegatingMethodAccessorImpl.__invoke(__DelegatingMethodAccessorImpl.__java:43)
java.lang.reflect.Method.__invoke(Method.java:601)

org.apache.wicket.__RequestListenerInterface.__internalInvoke(__RequestListenerInterface.java:__258)

org.apache.wicket.__RequestListenerInterface.__invoke(__RequestListenerInterface.java:__216)

org.apache.wicket.core.__request.handler.__ListenerInterfaceRequestHandle__r.invokeListener(__ListenerInterfaceRequestHandle__r.java:240)

org.apache.wicket.core.__request.handler.__ListenerInterfaceRequestHandle__r.respond(__ListenerInterfaceRequestHandle__r.java:226)

org.apache.wicket.request.__cycle.RequestCycle$__HandlerExecutor.respond(__RequestCycle.java:840)

org.apache.wicket.request.__RequestHandlerStack.execute(__RequestHandlerStack.java:64)

org.apache.wicket.request.__cycle.RequestCycle.execute(__RequestCycle.java:254)

org.apache.wicket.request.__cycle.RequestCycle.__processRequest(RequestCycle.__java:211)

org.apache.wicket.request.__cycle.RequestCycle.__processRequestAndDetach(__RequestCycle.java:282)

org.apache.wicket.protocol.__http.WicketFilter.__processRequestCycle(__WicketFilter.java:244)

org.apache.wicket.protocol.__http.WicketFilter.__processRequest(WicketFilter.__java:188)

org.apache.wicket.protocol.__http.WicketFilter.doFilter(__WicketFilter.java:267)


Re: AjaxButton and a HiddenField

2013-02-11 Thread Paul Bors
You turn your hidden field into a Wicket FormComponent and then add it to
your button's ajax request target :)

Just because is hidden, it doesn't have to be treated any different. But
don't confuse a hidden field with a Wicket visible field.

~ Thak you,
   Paul Bors

On Mon, Feb 11, 2013 at 3:25 PM, Entropy blmulholl...@gmail.com wrote:

 I have a javascript component that updates a HiddenField.  Then I want to
 submit to the server via an AjaxButton.  It all works fine until I try to
 get the value of the hiddenField which evidently did NOT hitch a ride on
 the
 Ajax request.  How do I get the hiddenfield to join the ajax request?

 Thanks.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxButton-and-a-HiddenField-tp4656246.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: ptint the whole markup of a Calendar

2013-02-11 Thread Paul Bors
Try the View Source option in your browser, also turn on the development
mode for your webapp to see the Ajax debug toolbar.
Consider adding the DebugToolbar to your root parent page.

~ Thank you,
   Paul Bors

On Mon, Feb 11, 2013 at 1:57 PM, grazia grazia.russolass...@gmail.comwrote:

 How can I print the whole markup of a
 com.googlecode.wicket.jquery.ui.calendar.Calendar ?





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ptint-the-whole-markup-of-a-Calendar-tp4656244.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: [Building Sakai] Charts Wicket Sakai

2013-02-11 Thread Steve Swinsburg
Looks like your dependencies are wrong. Check the 1.5 migration guide, it
should list the correct Maven coordinates to use.


On Fri, Feb 8, 2013 at 7:51 AM, Antonio muñoz alonso 
antoniovalenciasp...@hotmail.com wrote:

 When I change the version from 1.5 wicket gives me an error.

 You can use the examples of http://www.highcharts.com/demo/(javascritp) and
 pass data from wicket and invoke the example.¿?

 --
 CC: users@wicket.apache.org; sakai-...@collab.sakaiproject.org;
 tom.hombe...@gmail.com
 From: steve.swinsb...@gmail.com

 Subject: Re: [Building Sakai] Charts Wicket Sakai
 Date: Fri, 8 Feb 2013 07:04:21 +1100
 To: antoniovalenciasp...@hotmail.com


 Change the poms to list the correct dependencies for what you need, then
 adjust any compilation issues since things have changed between wicket 1.4
 and 1.5 or 6.

 By patch I mean send the differences in the code produced by the archetype
 and what you change so I can update the archetype.

 Gesendent von meinem iPhone

 On 07/02/2013, at 2:05, Antonio muñoz alonso 
 antoniovalenciasp...@hotmail.com wrote:

 Hi.

 Yes, I Use
 https://confluence.sakaiproject.org/display/BOOT/Sakai+Wicket+Maven+Archetype
 .
 but not update it, I have changed the repositories of pom.xml to 1.5 but
 it gives me error.

 What do you mean with patch???.

 I'm trying to run this: 
 ://code.google.com/p/wicked-charts/https://code.google.com/p/wicked-charts/
  , http://wicked-charts.appspot.com//start/?0
 fails to execute me, guess it will be the version of wicket.

 My wicket version is 1.4.17 and this repository use:

 Wicket 6.x

 dependency
   groupIdcom.googlecode.wicked-charts/groupId
   artifactIdwicked-charts-wicket6/artifactId
   version1.4.2/version
 /dependency

 Wicket 1.5.x

 dependency
   groupIdcom.googlecode.wicked-charts/groupId
   artifactIdwicked-charts-wicket15/artifactId
   version1.4.2/version
 /dependency





 Thanks.








 --
 Date: Wed, 6 Feb 2013 10:51:49 +1100
 From: steve.swinsb...@gmail.com
 To: users@wicket.apache.org; sakai-...@collab.sakaiproject.org
 Subject: Re: [Building Sakai] Charts Wicket Sakai

 Hi,

 I wrote the Sakai Wicket Maven Archetype:

 https://confluence.sakaiproject.org/display/BOOT/Sakai+Wicket+Maven+Archetype

 Yes, you can upgrade the version of Wicket, but you'll need to adjust code
 as per the 1.5 or 1.6 upgrade guide for Wicket:
 https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
 https://cwiki.apache.org/WICKET/migration-to-wicket-60.html

 If you do it, please send a patch and I'll update the archetype.

 cheers,
 Steve


 On Wed, Feb 6, 2013 at 10:42 AM, Paul Bors p...@bors.ws wrote:

 I'm not sure whick Sakai Archetype you're reffering to.
 Perhaps you can provide the maven coordinates you're using or tyring to
 use?

 However, if you're interested in charts and wicket take a look at the
 following or google for more:

 Open Flash:
 https://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html

 jqPlot:

 https://github.com/wicketstuff/core/tree/core-1.5.x/jdk-1.5-parent/jqplot-parent

 Or if you can afford the license for HighCharts then try Wicked-Charts
 https://code.google.com/p/wicked-charts/

 ~ Thank you,
Paul Bors

 On Tue, Feb 5, 2013 at 6:05 PM, Antonio muñoz alonso 
 antoniovalenciasp...@hotmail.com wrote:

  Hi.
  I use Sakai Archetype based in wicket 1.4.17.I can update the version of
  wicket??
  I need to use charts, and most API are from 1.5 or 6
  Someone I can help?
 
  thanks.



 ___ sakai-dev mailing list
 sakai-...@collab.sakaiproject.org
 http://collab.sakaiproject.org/mailman/listinfo/sakai-dev TO UNSUBSCRIBE:
 send email to sakai-dev-unsubscr...@collab.sakaiproject.org with a
 subject of unsubscribe




Using tomcat server in wicket application

2013-02-11 Thread kshitiz
Hi,

I have a wicket application running fine using Jetty server. But I need to
deploy the application in tomcat server. As tomcat is not able to find
appropiate resources, how to configure my application to make it compatible
for tomcat? 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-tomcat-server-in-wicket-application-tp4656251.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: Using tomcat server in wicket application

2013-02-11 Thread Francois Meillet
what do you mean by not able to find appropriate resource ?


Francois Meillet
AtomicThread 
Formation  Développement Wicket 



Le 12 févr. 2013 à 07:37, kshitiz k.agarw...@gmail.com a écrit :

 Hi,
 
 I have a wicket application running fine using Jetty server. But I need to
 deploy the application in tomcat server. As tomcat is not able to find
 appropiate resources, how to configure my application to make it compatible
 for tomcat? 
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Using-tomcat-server-in-wicket-application-tp4656251.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: Using tomcat server in wicket application

2013-02-11 Thread Francois Meillet
1) You neeed to insert this lines in your web.xml

 filter
filter-nameWicketFilter/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name
param-valueyourpackages.WicketApplication/param-value
/init-param
/filter

filter-mapping
filter-nameWicketFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping


2) in your applicationClassName, here yourpackages.WicketApplication, you need 
to override getHomePage()

public Class? extends Page getHomePage() {
return HomePage.class;
}



Francois Meillet
Formation  Développement Wicket 




Le 12 févr. 2013 à 08:01, kshitiz k.agarw...@gmail.com a écrit :

 I mean when I run application using run as tomcat server, the server is not
 able find the first page it should look for. Now in wicket,
 WicketApplication class carries a method where we describes the first page
 and jetty server takes up that but not tomcat server.
 
 I just want to understand how to run wicket application (which has been
 created using commands in wicket site) on tomcat server? How to configure it
 for the giver purpose?
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Using-tomcat-server-in-wicket-application-tp4656251p4656253.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