Re: Problem getting data from a 'CharSequenceResource'

2014-09-10 Thread manumoreno
Martin Grigorov-4 wrote
 Hi,
 
 The 

  element has two JavaScript event listeners for 'click' event - one
 by Wicket's AjaxFallbackLink and another by (Knockout.js ?!) data-bind
 attribute.
 The order of their execution is not determined.
 If Wicket's listener is called first then it will get the old value: 
 null,
 click1, click2, etc.
 While data-bind's listener will get: click1, click2, click3, etc.
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

Ough!, yes, there are two event listeners for click,. (Knockout, good
guess!), I think I'll try to make two components separately or use different
events. 

Do you think is feasible use two events in the same
component  ?, for example,. an 'event: {onfocus}' from Knockout and the
AjaxFallbacklink?

Thanks a lot Martin,. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-getting-data-from-a-CharSequenceResource-tp4667434p4667443.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 logs

2014-09-10 Thread dharmendra pandey
Hi Martin,


We are getting the below logs, Even our application server running in
deployment mode still we are getting the below logs.


Sep 8, 2014 7:17:25 AM org.apache.catalina.core.StandardWrapperValve invoke
INFO: 07:17:15.671 [http-nio-9001-exec-45] DEBUG
o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
from: context path '/root', filterPrefix 'test/', uri
'/root/test/TestListView'
07:17:15.671 [http-nio-9001-exec-45] DEBUG
o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
from: context path '/root', filterPrefix 'test/', uri
'/root/test/TestListView'
07:17:15.671 [http-nio-9001-exec-45] DEBUG
o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
from: context path '/root', filterPrefix 'test/', uri
'/root/test/TestListView'
07:17:15.671 [http-nio-9001-exec-45] DEBUG
o.a.w.r.mapper.CompoundRequestMapper - One compatible mapper found for URL
'TestListView?suiteKey=ApparelAcceleratoremxSuiteDirectory=faoStringResourceFileId=emxApparelAcceleratorStringResource'
- 'Mapper: org.apache.wicket.core.request.mapper.MountedMapper; Score: 2'
07:17:15.671 [http-nio-9001-exec-45] DEBUG
o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
from: context path '/root', filterPrefix 'test/', uri
'/root/test/TestListView'
07:17:15.671 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add title to [Page class = com.hm.pdm.web.test.test.listview.TestListView,
id = 0, render count = 0]
07:17:15.671 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add feedbackul to [JQueryFeedbackPanel [Component id = feedback]]
07:17:15.671 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add messages to [WebMarkupContainer [Component id = feedbackul]]
07:17:15.671 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add feedback to [Page class =
com.hm.pdm.web.test.test.listview.TestListView, id = 0, render count = 0]
07:17:15.671 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add samplesLink to [Page class =
com.hm.pdm.web.test.test.listview.TestListView, id = 0, render count = 0]
07:17:15.671 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add testsLink to [Page class =
com.hm.pdm.web.test.test.listview.TestListView, id = 0, render count = 0]
07:17:15.702 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add value to [InputFragment [Component id = fvalue]]
07:17:15.702 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add flabel to [WebMarkupContainer [Component id = 1]]
07:17:15.702 [http-nio-9001-exec-45] DEBUG org.apache.wicket.MarkupContainer
- Add fvalue to [WebMarkupContainer [Component id = 1]]


Regards
Dharmendra Pandey

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-logs-tp4667415p4667444.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 logs

2014-09-10 Thread Martin Grigorov
Hi,

The logging level is controlled by Log4j/Logback/... config files. Wicket's
configuration mode doesn't affect the logging by any means.
Edit your src/main/resources/(log4j.properties|logback.xml)

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


On Wed, Sep 10, 2014 at 10:07 AM, dharmendra pandey 
dharmendra.pan...@gmail.com wrote:

 Hi Martin,


 We are getting the below logs, Even our application server running in
 deployment mode still we are getting the below logs.


 Sep 8, 2014 7:17:25 AM org.apache.catalina.core.StandardWrapperValve invoke
 INFO: 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
 from: context path '/root', filterPrefix 'test/', uri
 '/root/test/TestListView'
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
 from: context path '/root', filterPrefix 'test/', uri
 '/root/test/TestListView'
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
 from: context path '/root', filterPrefix 'test/', uri
 '/root/test/TestListView'
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 o.a.w.r.mapper.CompoundRequestMapper - One compatible mapper found for URL

 'TestListView?suiteKey=ApparelAcceleratoremxSuiteDirectory=faoStringResourceFileId=emxApparelAcceleratorStringResource'
 - 'Mapper: org.apache.wicket.core.request.mapper.MountedMapper; Score: 2'
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 o.a.w.p.h.servlet.ServletWebRequest - Calculating context relative path
 from: context path '/root', filterPrefix 'test/', uri
 '/root/test/TestListView'
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add title to [Page class =
 com.hm.pdm.web.test.test.listview.TestListView,
 id = 0, render count = 0]
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add feedbackul to [JQueryFeedbackPanel [Component id = feedback]]
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add messages to [WebMarkupContainer [Component id = feedbackul]]
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add feedback to [Page class =
 com.hm.pdm.web.test.test.listview.TestListView, id = 0, render count = 0]
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add samplesLink to [Page class =
 com.hm.pdm.web.test.test.listview.TestListView, id = 0, render count = 0]
 07:17:15.671 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add testsLink to [Page class =
 com.hm.pdm.web.test.test.listview.TestListView, id = 0, render count = 0]
 07:17:15.702 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add value to [InputFragment [Component id = fvalue]]
 07:17:15.702 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add flabel to [WebMarkupContainer [Component id = 1]]
 07:17:15.702 [http-nio-9001-exec-45] DEBUG
 org.apache.wicket.MarkupContainer
 - Add fvalue to [WebMarkupContainer [Component id = 1]]


 Regards
 Dharmendra Pandey

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-logs-tp4667415p4667444.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: [ANNOUNCE] Apache Wicket 6.17.0 released

2014-09-10 Thread Guillaume Smet
On Tue, Sep 9, 2014 at 9:08 AM, Guillaume Smet guillaume.s...@gmail.com wrote:
 I reported it to Sonatype:
 https://getsatisfaction.com/sonatype/topics/wicket-6-17-0-in-central-but-not-on-search-maven-org

Joel fixed it.

-- 
Guillaume

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



Re: AuthenticatedWebSession.authenticate() not being called

2014-09-10 Thread Lucio Crusca
 Hi all,

 in a webapp that worked until yesterday (and that has worked for the last
 2 years), the AuthenticatedWebSession.authenticate() method is not being
 called anymore. I have MySession class that extends
 AuthenticatedWebSession. The MySession constructor gets called correctly.
 I use a standard SignInPanel: when I click Sign in the page reloads but
 the code execution doesn't reach the breakpoint at the first line of
 authenticate() in MySession. The authenticate() method does have the
 @Override annotation, so I'm sure it has the correct signature.

 Changes I've made since yesterday are only to the css, some HTML, a few
 new initParameters in web.xml, but nothing directly related to the login
 process... any clue about what could be causing that behavior? What should
 I check first?


I've made some progress in trying to understand what's going on, but I
still haven't found a solution.

When I click Sign in, wicket creates a new instance of my
SalixSignInPage.java using the default constructor: it is a simple page
that contains only the SignInPanel. No error messages reported. I'm using
wicket 6.16.

Here is the call stack:

SalixSignInPage.init:30
NativeConstructorAccessorImpl.newInstance0
NativeConstructorAccessorImpl.newInstance:62
DelegatingConstructorAccessorImpl.newInstance:45
Constructor.newInstance:408
DefaultPageFactory.newPage:175
DefaultPageFactory.newPage:67
DefaultMapperContext.newPageInstance:133
PageProvider.resolvePageInstance:268
PageProvider.getPageInstance:166
ListenerInterfaceRequestHandler.getPage:96
ListenerInterfaceRequestHandler.respond:157
RequestCycle$HandlerExecutor.respond:862
RequestHandlerStack.execute:64
RequestCycle.execute:261
RequestCycle.processRequest:218
RequestCycle.processRequestAndDetach:289
WicketFilter.processRequestCycle:259
WicketFilter.processRequest:201
WicketFilter.doFilter:282
[...]

Does this shed some light?


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



Custom http error pages

2014-09-10 Thread Alberto Brosich

Hi,

I'm using the latest version of wicket.
I'm trying to write custom pages for http errors. The standard way,
using web.xml, is not useful for me because I would print custom
messages too.
I tried to write a RequestCycleListener extending
AbstractRequestCycleListener class, but it seems that
AbortWithHttpErrorCodeException exceptions do not trigger onException
method of the listener or they have been already consumed.

Which are the best way to do that?

Best regards.

Alberto


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



Re: Custom http error pages

2014-09-10 Thread Martin Grigorov
Hi,

Instead of throwing AbortWithHttpErrorCodeException you can just use
RestartResponseException/setResponsePage().
But using the standard way (web.xml) should be fine too. I think the
message set by #setError(code, message) is stored as request attribute.

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


On Wed, Sep 10, 2014 at 11:09 AM, Alberto Brosich abros...@ogs.trieste.it
wrote:


 Hi,

 I'm using the latest version of wicket.
 I'm trying to write custom pages for http errors. The standard way,
 using web.xml, is not useful for me because I would print custom
 messages too.
 I tried to write a RequestCycleListener extending
 AbstractRequestCycleListener class, but it seems that
 AbortWithHttpErrorCodeException exceptions do not trigger onException
 method of the listener or they have been already consumed.

 Which are the best way to do that?

 Best regards.

 Alberto


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




Re: CouldNotLockPageException while trying 'inspect' option of Debug bar

2014-09-10 Thread Rakesh A
Hi,

After some debugging  investigation, It turned out to be a
'AjaxEventBehavior' for 'load' event [page onload event], which was added to
page was causing this lock, removing this behavior solved the page locking
issue.

Thanks,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CouldNotLockPageException-while-trying-inspect-option-of-Debug-bar-tp4667405p4667450.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: CouldNotLockPageException while trying 'inspect' option of Debug bar

2014-09-10 Thread Rakesh A
Forgot to mention, an anonymous class implementation was done for the
AjaxEventBehavior, and the #onEvent(..) method access' Page properties in
it.

Regards,
Rakesh.A

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CouldNotLockPageException-while-trying-inspect-option-of-Debug-bar-tp4667405p4667451.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



How to add checkboxes with AJAX?

2014-09-10 Thread brushmate
Hi,

I am trying to write a FormComponentPanel that displays a list of
checkboxes, a textfield and a button. It shall return the selected values. I
want to use the textfield and the button to add new checkboxes dynamically
using AJAX.

I used a CheckGroup together with a ListView to render the checkboxes. Below
the checkboxes I placed a TextField and an AjaxButton. Now I want to be able
to enter a value into the textfield and after a click on the button the
entered value shall be added to the list. How can I accomplish this?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-checkboxes-with-AJAX-tp4667452.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to add checkboxes with AJAX?

2014-09-10 Thread brushmate
This is what it should look like:

http://apache-wicket.1842946.n4.nabble.com/file/n4667453/formcomponentpanel1.png
 
http://apache-wicket.1842946.n4.nabble.com/file/n4667453/formcomponentpanel2.png
 
http://apache-wicket.1842946.n4.nabble.com/file/n4667453/formcomponentpanel3.png
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-checkboxes-with-AJAX-tp4667452p4667453.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to add checkboxes with AJAX?

2014-09-10 Thread Martin Grigorov
Check
http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/

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


On Wed, Sep 10, 2014 at 12:41 PM, brushmate brushm...@gmail.com wrote:

 This is what it should look like:

 
 http://apache-wicket.1842946.n4.nabble.com/file/n4667453/formcomponentpanel1.png
 
 
 http://apache-wicket.1842946.n4.nabble.com/file/n4667453/formcomponentpanel2.png
 
 
 http://apache-wicket.1842946.n4.nabble.com/file/n4667453/formcomponentpanel3.png
 

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-add-checkboxes-with-AJAX-tp4667452p4667453.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: AuthenticatedWebSession.authenticate() not being called

2014-09-10 Thread Lucio Crusca
While debugging the problem I first moved to Wicket 6.17 and then set a
breakpoint in SignInPanel.java (Wicket sources) at line 310, which is the
first line of the onSubmit() method of the SignInForm Wicket class.

That breakpoint does not get hit: Wicket, in response to the HTTP request
generated by the SignInForm submit button, creates a new SalixSignInPage
and does not call onSubmit() on the existing form.

Puzzled. I try to create a quickstart, but the real problem is that I'm
pretty sure the quickstart will work perfectly. Even my code has worked
perfectly for the last 2 years...


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



Re: Global Ajax Event Handler

2014-09-10 Thread Martin Grigorov
Tobias sent me a quickstart app.

TestPage is stateless and thus never stored in the storages.
Just add setStatelessHint(false) to its constructor and the problem
disappears.

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


On Tue, Sep 9, 2014 at 10:10 PM, Tobias Soloschenko 
tobiassolosche...@googlemail.com wrote:

 The usecase requires it :-) I send an example to you.

 I hope this will be possible because then you are also able to do ajax
 requests from embedded jsp files. :-D

 thanks anyway!

  Am 09.09.2014 um 16:29 schrieb Richter, Marvin 
 marvin.rich...@freenetdigital.com:
 
  That definitely sounds like a really odd use case or am I wrong?
 
  Do you really want to generate the URL outside from the Wicket context?
  I mean this is something which is heavily tied to wicket anyway so why
 not generating it inside it's context?
  And where do you need/use the final generated URL? I guess inside the
 Wicket context ...
 
  Maybe you should rethinking your use case, I bet the problem you're
 trying to solve can be solved much, much easier!
 
  Anyway .. wish you luck ;)
 
  -Original Message-
  From: Tobias Soloschenko [mailto:tobiassolosche...@googlemail.com]
  Sent: Tuesday, September 09, 2014 2:58 PM
  To: users@wicket.apache.org
  Subject: Re: Global Ajax Event Handler
 
  Thats the point. It is not used within a Component / Behavior - so I
 cant use getPage() ...
 
  Am 09.09.2014 um 14:50 schrieb Martin Grigorov mgrigo...@apache.org:
 
  The UrlGenerator class is used somewhere where the Page is available,
 no ?
  In SomeComponent/SomeBehavior:
 
  UrlGenerator generator = new UrlGenerator(); Url url =
  generator.generate(getPage().getPageId());
 
  Session.get().getPageManager().getPage(exisingAndNonExpiredPageId) is
  the way to get a reference to the page.
  Wicket uses this API internally every time you click a link or button.
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
 
  On Tue, Sep 9, 2014 at 3:45 PM, Tobias Soloschenko 
  tobiassolosche...@googlemail.com wrote:
 
  And thats the question I was looking for - how do I get the current
  page id within the class that generates the url which is no component
  and the second question was how do I get the page to that id, because
  (Page)
  WebSession.get().getPageManager().getPage(i.get()) returns null for
  int i 0-10, event if I cleared the browsers cache / restarted the
 server.
 
  kind regards and big thanks for all the help!
 
  Tobias
 
  2014-09-09 14:28 GMT+02:00 Martin Grigorov mgrigo...@apache.org:
 
  Session#pageId is a counter that is used to give an id to the next
  created
  page.
  It is not the id of the currently used page!
 
  You will need to provide the pageId somehow to the class that
  generates
  the
  url.
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
 
  On Tue, Sep 9, 2014 at 3:13 PM, Tobias Soloschenko 
  tobiassolosche...@googlemail.com wrote:
 
  The method getPage() is not available at the place where I'm
  building
  the
  link - I'm not within a component and I try to get the page by
  content
  of
  the session. :-)
 
  I didn't modified the Session - the pageId is stored in
  org.apache.wicket.Session.pageId which is an AtomicInteger
 
 
  2014-09-09 14:06 GMT+02:00 Martin Grigorov mgrigo...@apache.org:
 
  Pass the pageId as a query string parameter.
 
  PageParameters params = new PageParameters(); params.set(pageId,
  getPage().getPageId()); theUrlToTheReference =
  requestCycle.urlFor(yourResRef, params);
 
  Then in the IResource (better extend AbstractResource) just read
  it
  from
  the request parameters.
 
  Storing the pageId in the session is not OK because the user may
  open
  two
  different pages in separate tabs/windows and this will break.
 
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
 
  On Tue, Sep 9, 2014 at 3:01 PM, Tobias Soloschenko 
  tobiassolosche...@googlemail.com wrote:
 
  Thanks again for the fast answer. My code now looks this way:
 
Field declaredField =
  WebSession.get().getClass().getSuperclass()
.getDeclaredField(pageId);
 
declaredField.setAccessible(true);
AtomicInteger i = (AtomicInteger)
  declaredField.get(WebSession.get());
Page page = (Page) WebSession.get().getPageManager()
.getPage(i.get());
 
AjaxRequestTarget newAjaxRequestTarget =
  ((WebApplication)
  Application.get())
.newAjaxRequestTarget(page);
 
RequestCycle.get().scheduleRequestHandlerAfterCurrent(
newAjaxRequestTarget);
 
  I dont know how to get the current pageId but from the Session.
  The
  page
  at
  this place is null. :-(
 
 
 
  2014-09-09 13:53 GMT+02:00 Martin Grigorov mgrigo...@apache.org:
 
  On Tue, Sep 9, 2014 at 2:05 PM, Tobias Soloschenko 
  tobiassolosche...@googlemail.com wrote:
 

Re: Problem getting data from a 'CharSequenceResource'

2014-09-10 Thread Martin Grigorov
On Wed, Sep 10, 2014 at 9:40 AM, manumoreno weddoes2...@gmail.com wrote:

 Martin Grigorov-4 wrote
  Hi,
 
  The

   element has two JavaScript event listeners for 'click' event - one
  by Wicket's AjaxFallbackLink and another by (Knockout.js ?!) data-bind
  attribute.
  The order of their execution is not determined.
  If Wicket's listener is called first then it will get the old value:
  null,
  click1, click2, etc.
  While data-bind's listener will get: click1, click2, click3, etc.
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov

 Ough!, yes, there are two event listeners for click,. (Knockout, good
 guess!), I think I'll try to make two components separately or use
 different
 events.

 Do you think is feasible use two events in the same
 component  ?, for example,. an 'event: {onfocus}' from Knockout and the
 AjaxFallbacklink?


It is OK (if you know what you are doing!).



 Thanks a lot Martin,.


Welcome!





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Problem-getting-data-from-a-CharSequenceResource-tp4667434p4667443.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: Global Ajax Event Handler

2014-09-10 Thread Tobias Soloschenko
Oh NO

This completely solved my problem

Now all is working like expected...

Now I'm able to render a Javascript-Callback-Function with a custom
EL-Function within a JSP and if I use this Javascript-Function in a link
for example I can update component on the current page. Example:

wicket:jsp file=/TestPage.jsp /

In JSP:

a href=# onClick=${wicket:createAjaxCallback()}Update/a

In WebPage with setStatelassHint(false):

@Override
public void onEvent(IEvent? event) {
if (event.getPayload() instanceof GlobalAjaxEvent) {
AjaxRequestTarget ajaxRequestTarget =
((GlobalAjaxEvent)event.getPayload()).getAjaxRequestTarget();
label.setDefaultModelObject(updated panel);
ajaxRequestTarget.add(label);
}
 }

and in Application's init method:

GlobalAjaxResource.configure(this);

I will try out to make this call also available to forms or other html
elements within jsps and then I'm going to publish it on wicketstuff minis.
:-)

Thanks a lot for all the help and time you spend by solving this problem!

kind regards

Tobias



2014-09-10 12:16 GMT+02:00 Martin Grigorov mgrigo...@apache.org:

 Tobias sent me a quickstart app.

 TestPage is stateless and thus never stored in the storages.
 Just add setStatelessHint(false) to its constructor and the problem
 disappears.

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


 On Tue, Sep 9, 2014 at 10:10 PM, Tobias Soloschenko 
 tobiassolosche...@googlemail.com wrote:

  The usecase requires it :-) I send an example to you.
 
  I hope this will be possible because then you are also able to do ajax
  requests from embedded jsp files. :-D
 
  thanks anyway!
 
   Am 09.09.2014 um 16:29 schrieb Richter, Marvin 
  marvin.rich...@freenetdigital.com:
  
   That definitely sounds like a really odd use case or am I wrong?
  
   Do you really want to generate the URL outside from the Wicket context?
   I mean this is something which is heavily tied to wicket anyway so why
  not generating it inside it's context?
   And where do you need/use the final generated URL? I guess inside the
  Wicket context ...
  
   Maybe you should rethinking your use case, I bet the problem you're
  trying to solve can be solved much, much easier!
  
   Anyway .. wish you luck ;)
  
   -Original Message-
   From: Tobias Soloschenko [mailto:tobiassolosche...@googlemail.com]
   Sent: Tuesday, September 09, 2014 2:58 PM
   To: users@wicket.apache.org
   Subject: Re: Global Ajax Event Handler
  
   Thats the point. It is not used within a Component / Behavior - so I
  cant use getPage() ...
  
   Am 09.09.2014 um 14:50 schrieb Martin Grigorov mgrigo...@apache.org
 :
  
   The UrlGenerator class is used somewhere where the Page is available,
  no ?
   In SomeComponent/SomeBehavior:
  
   UrlGenerator generator = new UrlGenerator(); Url url =
   generator.generate(getPage().getPageId());
  
   Session.get().getPageManager().getPage(exisingAndNonExpiredPageId) is
   the way to get a reference to the page.
   Wicket uses this API internally every time you click a link or button.
  
   Martin Grigorov
   Wicket Training and Consulting
   https://twitter.com/mtgrigorov
  
  
   On Tue, Sep 9, 2014 at 3:45 PM, Tobias Soloschenko 
   tobiassolosche...@googlemail.com wrote:
  
   And thats the question I was looking for - how do I get the current
   page id within the class that generates the url which is no component
   and the second question was how do I get the page to that id, because
   (Page)
   WebSession.get().getPageManager().getPage(i.get()) returns null for
   int i 0-10, event if I cleared the browsers cache / restarted the
  server.
  
   kind regards and big thanks for all the help!
  
   Tobias
  
   2014-09-09 14:28 GMT+02:00 Martin Grigorov mgrigo...@apache.org:
  
   Session#pageId is a counter that is used to give an id to the next
   created
   page.
   It is not the id of the currently used page!
  
   You will need to provide the pageId somehow to the class that
   generates
   the
   url.
  
   Martin Grigorov
   Wicket Training and Consulting
   https://twitter.com/mtgrigorov
  
  
   On Tue, Sep 9, 2014 at 3:13 PM, Tobias Soloschenko 
   tobiassolosche...@googlemail.com wrote:
  
   The method getPage() is not available at the place where I'm
   building
   the
   link - I'm not within a component and I try to get the page by
   content
   of
   the session. :-)
  
   I didn't modified the Session - the pageId is stored in
   org.apache.wicket.Session.pageId which is an AtomicInteger
  
  
   2014-09-09 14:06 GMT+02:00 Martin Grigorov mgrigo...@apache.org:
  
   Pass the pageId as a query string parameter.
  
   PageParameters params = new PageParameters(); params.set(pageId,
   getPage().getPageId()); theUrlToTheReference =
   requestCycle.urlFor(yourResRef, params);
  
   Then in the IResource (better extend AbstractResource) just read
   it
   from
   the request parameters.
  
   Storing the pageId in 

respond with 404 page while keeping original URL

2014-09-10 Thread Thibault Kruse
Hi,

we have a page for some resource mounted at /resource/id
When users enter an invalid ID, we want to render a 404 page.
However, we would like the resulting page not have the original url
with the invalid id (but http status 404).

Is there any obvious easy way to achieve this? Because it seems the
general way in wicket tutorials on 404 pages seem to rely on
redirecting to a mounted 404 resource, which means the browser will
not display the original invalid URL.

cheers,
  Thibault

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



Re: respond with 404 page while keeping original URL

2014-09-10 Thread Martin Grigorov
Just throw AbortWithHttpErrorCodeException.
The url will remain the same.

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

On Wed, Sep 10, 2014 at 3:43 PM, Thibault Kruse tibokr...@googlemail.com
wrote:

 Hi,

 we have a page for some resource mounted at /resource/id
 When users enter an invalid ID, we want to render a 404 page.
 However, we would like the resulting page not have the original url
 with the invalid id (but http status 404).

 Is there any obvious easy way to achieve this? Because it seems the
 general way in wicket tutorials on 404 pages seem to rely on
 redirecting to a mounted 404 resource, which means the browser will
 not display the original invalid URL.

 cheers,
   Thibault

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




Re: Custom http error pages

2014-09-10 Thread Alberto Brosich
On Wed, 2014-09-10 at 11:21 +0300, Martin Grigorov wrote:
 Hi,
 
 Instead of throwing AbortWithHttpErrorCodeException you can just use
 RestartResponseException/setResponsePage().
 But using the standard way (web.xml) should be fine too. I think the
 message set by #setError(code, message) is stored as request attribute.
 

Hi Martin,

I used the second one and it works fine.

Many thanks

Alberto

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 
 On Wed, Sep 10, 2014 at 11:09 AM, Alberto Brosich abros...@ogs.trieste.it
 wrote:
 
 
  Hi,
 
  I'm using the latest version of wicket.
  I'm trying to write custom pages for http errors. The standard way,
  using web.xml, is not useful for me because I would print custom
  messages too.
  I tried to write a RequestCycleListener extending
  AbstractRequestCycleListener class, but it seems that
  AbortWithHttpErrorCodeException exceptions do not trigger onException
  method of the listener or they have been already consumed.
 
  Which are the best way to do that?
 
  Best regards.
 
  Alberto
 
 
  -
  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: Problem getting data from a 'CharSequenceResource'

2014-09-10 Thread manumoreno
Martin Grigorov-4 wrote
 Do you think is feasible use two events in the same
 component  ?, for example,. an 'event: {onfocus}' from Knockout and the
 AjaxFallbacklink?

 
 It is OK (if you know what you are doing!).

Thx a lot, everything worked fine with two different events. 





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-getting-data-from-a-CharSequenceResource-tp4667434p4667464.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



Handling page refresh or redirect when the server reboots

2014-09-10 Thread msalman
So we have this feature of online server upgrade in which the user can start
an upgrade on the server while still logged into the (wicket) web app.  This
starts some scripts in the bacground which bring the  jboss server down,
upgrade the db, upgrade the ear file, etc., and then restart the jboss
server.  When the server comes back up we would like the user to be
redirected to the login page of the app automatically.  The last part does
not work.  At this time we just have a message telling the user to refresh
the page and when everything is ready he will be sent to the login page.

Is there a good robust way to make sure that the page is automatically
refreshed and the login page is presented?  Is it even possible to do it? 
Personally I don't think this is not a good idea but this feature is a
requirement and I want to explore it as much as possible.


Appreciate any help.

Thanks.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Handling-page-refresh-or-redirect-when-the-server-reboots-tp4667465.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