Re: Problem getting data from a 'CharSequenceResource'

2014-09-09 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

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
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" > : > > That definitely sounds like a really odd use case or am

Re: Referencing DataTable rows within the table column header

2014-09-09 Thread Paul Bors
Another piece of advice, Avoid unnecessary casts (Wicket 6 supports generics) and try not to use code to navigate the wicket component tree unnecessary like this line of code: WebMarkupContainer container = ((WebMarkupContainer) dropDownChoice.findParent(DataTable.class).get(1)); Get familiar wi

Re: Referencing DataTable rows within the table column header

2014-09-09 Thread Paul Bors
Hey Ephraim, At Knoa for the console code I created an API around those components. You don't have to re-invent the wheel, all you have to do is get familiar with the console commons and which DropDown component to use. Remember wicket is a component driven framework similar to Swing. I would re

RE: Referencing DataTable rows within the table column header

2014-09-09 Thread Ephraim Rosenfeld
Hi Martin: Thank you for your quick response. I was initially updating the entire table, but that was causing me to lose focus from the drop-down menu in which I made the selection. Also, my hope was that I could update as few row items/components as possible, thereby expediting the table-

Re: Problem getting data from a 'CharSequenceResource'

2014-09-09 Thread Martin Grigorov
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,

Re: Referencing DataTable rows within the table column header

2014-09-09 Thread Martin Grigorov
Hi, Why don't you update the table itself ? This will update all its children components too. Otherwise I'd use Wicket's Event system to send a notification to all interested parties. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Sep 9, 2014 at 7:01 PM,

Problem getting data from a 'CharSequenceResource'

2014-09-09 Thread manumoreno
Hi, I need some advice to get data from a CharSequenceResource: The Resource: The request is provided by an asynchronous ajax request (from JQuery) to a url like 'http:///getjson' and that is mounted as: The component is an tag, binded in wicket,. The 'click: save

Referencing DataTable rows within the table column header

2014-09-09 Thread Ephraim Rosenfeld
Hello All, I am creating a table with a DropDownChoice component in the header of one of the columns. When a selection is made in the drop down in the column header, I want to update all of the rows in the table. Would the following snippet be the best approach to reference each row Item compo

New chapter in the user guide

2014-09-09 Thread Andrea Del Bene
Hi, I just updated the user guide with a new chapter for "internals" topics. I've started porting wiki page at https://cwiki.apache.org/confluence/display/WICKET/Page+Storage. Bye! - To unsubscribe, e-mail: users-unsubscr...

RE: Global Ajax Event Handler

2014-09-09 Thread Richter, Marvin
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?

Re: Wicket meet-and-greet at JavaOne 2014?

2014-09-09 Thread Shawn McKinney
On 09/08/2014 06:17 PM, Garret Wilson wrote: Hi, all. I'm traveling at the moment, but I plan to be back in San Francisco around the start of JavaOne. Do any Wicket users plan on being in town for the conference? Would you like me to organize a meet-and-greet at a local restaurant or even (depe

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
Ok the id is now generated right - but the code to get the page by the given page id is still returning null if the ajax call is made. Tobias > Am 09.09.2014 um 15:11 schrieb Martin Grigorov : > > Yes. > This should be OK. > > Martin Grigorov > Wicket Training and Consulting > https://twitter

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
Yes. This should be OK. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Sep 9, 2014 at 4:09 PM, Tobias Soloschenko < tobiassolosche...@googlemail.com> wrote: > PageRequestHandlerTracker.getLastHandler(RequestCycle.get()).getPageId() ? > Is this a valid Way

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
PageRequestHandlerTracker.getLastHandler(RequestCycle.get()).getPageId() ? Is this a valid Way to get the last pageid? Kind regards Tobias > Am 09.09.2014 um 14:50 schrieb Martin Grigorov : > > The UrlGenerator class is used somewhere where the Page is available, no ? > In SomeComponent/Some

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
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 : > > The UrlGenerator class is used somewhere where the Page is available, no ? > In SomeComponent/SomeBehavior: > > UrlGenerator generator = new UrlGene

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
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 refere

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
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, even

AuthenticatedWebSession.authenticate() not being called

2014-09-09 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

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
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, Se

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
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

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
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.

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
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(W

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

2014-09-09 Thread Martin Grigorov
Can you reproduce this in a simple quickstart app ? AbstractAjaxTimerBehavior will send a request on the defined timeout, but the processing of this request should be fast enough. Check what you do in #onTimer() callback. On Tue, Sep 9, 2014 at 2:02 PM, Rakesh A wrote: > Hi, > Strange thing is

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
On Tue, Sep 9, 2014 at 2:05 PM, Tobias Soloschenko < tobiassolosche...@googlemail.com> wrote: > Hi again, > > I tried out that code you mentioned here. > WebSession.get().getPageManager().getPage(int i) returns IManageablePage > which is not applicable as argument for newAjaxRequestTarget. > cast

Re: Wicket logs

2014-09-09 Thread Martin Grigorov
Hi, The provided (none!) logs look fine. Please provide some more so we can check them too. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Sep 9, 2014 at 2:16 PM, dharmendra pandey < dharmendra.pan...@gmail.com> wrote: > Hi, > > My application is deployed

Wicket logs

2014-09-09 Thread dharmendra pandey
Hi, My application is deployed on PRODUCTION environment and I set our application log level (Wicket Application to deployment mode) After override/setting the method below we are seeing lots unnecessary wicket logs info in file. public RuntimeConfigurationType getRuntimeConfigurationType() {

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
Hi again, I tried out that code you mentioned here. WebSession.get().getPageManager().getPage(int i) returns IManageablePage which is not applicable as argument for newAjaxRequestTarget. The second thing is how do I get the instance of a page by class with the last page id not from within a compo

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

2014-09-09 Thread Rakesh A
Hi, Strange thing is, even if I increase the request timeout to 5mins using "org.apache.wicket.settings.IRequestCycleSettings.setTimeout(Duration)", I get the same exception. I use Wicket 6.15.0, pages are unversioned & page uses 'AbstractAjaxTimerBehavior'. Does 'AbstractAjaxTimerBehavior' cause

Re: How to register a global resource with dependencies?

2014-09-09 Thread Martin Grigorov
This is OK. Override Component#renderHead() or Behavior#renderHead() and list all references that are needed. You can also use org.apache.wicket.Application#getHeaderContributorListeners().add(new IHeaderContributor() { #renderHead() {...} }) to define which header items should be contributed for e

Re: How to register a global resource with dependencies?

2014-09-09 Thread brushmate
Okay, then I have another question: Where do I have to define the references. Until now, I always defined them in the component that needs them. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-register-a-global-resource-with-dependencies-tp4667403p4667411.html

Re: How to register a global resource with dependencies?

2014-09-09 Thread Martin Grigorov
On Tue, Sep 9, 2014 at 1:35 PM, brushmate wrote: > Thanks for your answer. So everytime I want to reference a resource, I have > to declare its dependencies? > > I want to register it globally, because I can use it on different pages > then > and if the path to the resource changes in the future,

Re: How to register a global resource with dependencies?

2014-09-09 Thread Tobias Soloschenko
You could use resource bundles, define all ResourceReferences within the bundle and within each ResourceReference their dependencies. If you would use any resourcereference within a renderHead method, all dependencies and resources would placed at the right position and you would save some requests

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

2014-09-09 Thread Martin Grigorov
The Inspector tries to get a reference to the page by its id to be able to get a list of its components. But another thread is already acquired the lock to this page... It seems to write the page's markup to the browser but I cannot say why it does this for more than a minute. Martin Grigorov Wick

Re: How to register a global resource with dependencies?

2014-09-09 Thread brushmate
Thanks for your answer. So everytime I want to reference a resource, I have to declare its dependencies? I want to register it globally, because I can use it on different pages then and if the path to the resource changes in the future, I only need to update it at one place. -- View this message

Re: How to register a global resource with dependencies?

2014-09-09 Thread Martin Grigorov
Hi, You register the IResource with getSharedResources().add(String name, IResource resource) but later you need to reference it with SharedResourceReference(name) to be able to use it. You can override SharedResourceReference's getDependencies() to declare the JQuery dependency. Why do you need

CouldNotLockPageException while trying 'inspect' option of Debug bar

2014-09-09 Thread Rakesh A
Hi, I was trying to analyze my wicket page, by adding Wicket debug bar. When I click on the 'Inspector' option in Wicket debug bar I get a CouldNotLockPageException. Thread dump logged is provided below, I couldn't understand much from it, can anybody point me towards why I am getting this excepti

Re: How to register a global resource with dependencies?

2014-09-09 Thread Tobias Soloschenko
You can get the JQueryResourceReference used by Wicket like this: getJavaScriptLibrarySettings().getJQueryReference() kind regards Tobias 2014-09-09 12:20 GMT+02:00 brushmate : > Hi,I want to register a JS file globally, but it depends on jQuery. The > user > guide says that rsources can be re

How to register a global resource with dependencies?

2014-09-09 Thread brushmate
Hi,I want to register a JS file globally, but it depends on jQuery. The user guide says that rsources can be registered with getSharedResources().add(String name, IResource resource). But since it takes an IResource, I can not declare the dependencies with overriding getDependencies() like I would

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
Thats it!!! Thanks! Kind regards Tobias Von meinem iPhone gesendet > Am 09.09.2014 um 11:51 schrieb Martin Grigorov : > > I've re-read the message and I think I got it. > What you really need is a mounted resource > (WebApplication#mountResource(someResourceReference)) > To get a url to it us

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
Hi, the example shows up event bubbling which is not what I mean. Thanks anyway :-) Kind regards Tobias > Am 09.09.2014 um 11:40 schrieb "Richter, Marvin" > : > > What you are looking for is the Wicket Event mechanism. > > This allows you to send a broadcast to a specified Component (e.g.

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
I only wrote some pseudo code to show what I want to do. In simple words: I want to write javascript code that invokes a method on the server side. The method on Server side is going to refresh components. Everything should work without Rendering the javascript code within a wicket page / compon

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
I've re-read the message and I think I got it. What you really need is a mounted resource (WebApplication#mountResource(someResourceReference)) To get a url to it use: theUrl = requestCycle.urlFor(sameResRef, parametersWithPageId) Wicket.Ajax.get({"u": theUrl, ...}) In IResource#respond() you can c

RE: Global Ajax Event Handler

2014-09-09 Thread Richter, Marvin
What you are looking for is the Wicket Event mechanism. This allows you to send a broadcast to a specified Component (e.g. the current page) and a payload (e.g. your custom event type which contains information). In the Components which should react on the event you override the method onEvent,

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
I am still confused :-) You used class names which are not available in Wicket 6.17.0 so I cannot map them to any functionality that is possible with "local" behavior. My guess is that you ask about org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() You can register custom l

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
Hi, thanks for the answer, but this is only a client side event hook not for processing a request to the Server. I added a pseudo code to the question of martin who asked me what I exactly want to do. Thanks anyway for the fast answer! kind regards, Tobias > Am 09.09.2014 um 11:06 schrieb T

Re: Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
I want to have the possibility to add a listener at application Level like in this pseudo code Server side getGlobalAjaxBehaviors().add("myid",new GlobalAjaxBehavior(){ public void respond(GlobalRequest request){ // here the Event is received // request.getArguments(); // request.replace(..

Re: Global Ajax Event Handler

2014-09-09 Thread Tom Götz
See https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax, section "Global Ajax call listeners“. Cheers, -Tom On 09.09.2014, at 10:58, Tobias Soloschenko wrote: > Hi all, > > is there a way to register a global ajax event handler within Wicket? For > normal there is the Abstra

Re: Global Ajax Event Handler

2014-09-09 Thread Martin Grigorov
What exactly you want to do ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Sep 9, 2014 at 11:58 AM, Tobias Soloschenko < tobiassolosche...@googlemail.com> wrote: > Hi all, > > is there a way to register a global ajax event handler within Wicket? For > no

Global Ajax Event Handler

2014-09-09 Thread Tobias Soloschenko
Hi all, is there a way to register a global ajax event handler within Wicket? For normal there is the AbstractDefaultAjaxBehavior which is added to a component. And then the CallbackScript can be obtained and used within a OnDomReadyHeaderItem for example. Is there a way to do this on applica

Re: Variant Change Behavior

2014-09-09 Thread Thibault Kruse
The API looks good. I don't have time to test it right now. On Tue, Sep 9, 2014 at 9:44 AM, Martin Grigorov wrote: > https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commit;h=702bf45a > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > > On Tue, Sep 9,

Re: Variant Change Behavior

2014-09-09 Thread Martin Grigorov
https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commit;h=702bf45a Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Sep 9, 2014 at 10:42 AM, Martin Grigorov wrote: > Please check that the solution provided with > https://issues.apache.org/jira/browse/

Re: Variant Change Behavior

2014-09-09 Thread Martin Grigorov
Please check that the solution provided with https://issues.apache.org/jira/browse/WICKET-5694 will do the job. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Sep 8, 2014 at 10:45 AM, Thibault Kruse wrote: > Hm, thinking some more, the general solution wo

Re: JavaSerializer - Error serializing object class

2014-09-09 Thread Martin Grigorov
Hi, This is a well known issue with CDI+EJB. It has been discussed few times here and other forums. CDI injects non-Serializable objects for EJB beans. A workaround is to use a delegate CDI bean to lookup the EJBs. I.e. instead of @Inject-ing EJBs in Wicket components inject a scoped CDI bean that

Re: [ANNOUNCE] Apache Wicket 6.17.0 released

2014-09-09 Thread Guillaume Smet
Hi, On Tue, Sep 9, 2014 at 8:46 AM, Martin Grigorov wrote: > I use this URL to check: > http://central.maven.org/maven2/org/apache/wicket/wicket-core/6.17.0/ > Most probably the index of search.maven.org is broken ... I reported it to Sonatype: https://getsatisfaction.com/sonatype/topics/wicket-

Re: JavaSerializer - Error serializing object class

2014-09-09 Thread Maxim Solodovnik
you can only have Serializable classes stored in the page you can have DTO or ID stored if it is impossible On 9 September 2014 13:53, Stefan Lorenz wrote: > Hi, > > with Glassfish4 we get a lot of Exceptions when a page gets serialized. > > org.apache.wicket.serialize.java.JavaSerializer - Erro