Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-11 Thread Ernesto Reinaldo Barreiro
Did not have time to look at it. I will try today.


On Tue, Nov 12, 2013 at 7:44 AM, Dirk Forchel wrote:

> Did anybody try to run my attached quickstart application and can explain
> why
> the additional LocaleMapper changes the path?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662335.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Struggling with ContextRelativeResource, RenderedDynamicImageResource and SharedResources

2013-11-11 Thread Dirk Forchel
Did anybody try to run my attached quickstart application and can explain why
the additional LocaleMapper changes the path?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Struggling-with-ContextRelativeResource-RenderedDynamicImageResource-and-SharedResources-tp4662190p4662335.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: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Cedric Gatay
I was on my phone and didn't read that well the provided snippet, it should
work fine then ;)

__
Cedric Gatay (@Cedric_Gatay )
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr


On Mon, Nov 11, 2013 at 4:05 PM, Martin Grigorov wrote:

> There is a difference between onunload and onbeforeunload. You can cancel
> the latter.
> You can make Ajax call only in onbeforeunload. And it has to be
> synchronous.
>
>
> On Mon, Nov 11, 2013 at 4:55 PM, Cedric Gatay  wrote:
>
> > AFAIK the browser won't issue a new server call (or will not process the
> > response) once the onunload event has been called so I doubt this will
> work
> > (using the web inspector of your browser will allow you to check whether
> or
> > not the call has been done)
> >
> > I second what Martin said, you need to add the JavaScript code to call
> the
> > server.
> > Le 11 nov. 2013 15:29, "Martin Grigorov"  a écrit
> :
> >
> > > respond() is the callback method that Wicket will notify.
> > > But you need to trigger an Ajax call first. This is done with the
> Wicket
> > > Ajax API: Wicket.Ajax.get(...).
> > >
> > > Just try with the line I've added in your JS code
> > >
> > >
> > > On Mon, Nov 11, 2013 at 4:04 PM, Daniela L 
> wrote:
> > >
> > > > I thought adding respond was the ajax call to the server, am I wrong?
> > > > I didn't work much with ajax, i am sorry
> > > >
> > > >
> > > > 2013/11/11 Martin Grigorov 
> > > >
> > > > > Did you do what I suggested you ?
> > > > >
> > > > >
> > > > > On Mon, Nov 11, 2013 at 3:49 PM, Daniela L 
> > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I have tryed to change to AbstractDefaultAjaxBehavior like I
> > > described
> > > > > > below, but respond is never called. What am I doing wrong?
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > as far as I have understood this can only be achieved, if I
> > subclass
> > > > > > AbstractDefaultAjaxBehavior like this?
> > > > > >
> > > > > > public class PageExitWarningBehavior extends
> > > > AbstractDefaultAjaxBehavior
> > > > >  {
> > > > > > @Override
> > > > > > protected void respond(AjaxRequestTarget target) {
> > > > > >
> > > > > > AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
> > > > > >   }
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > You need to make an Ajax call to the server.
> > > > > >
> > > > > >
> > > > > > On Mon, Nov 11, 2013 at 2:10 PM, Daniela L  >
> > > > > >  <
> danigal...@gmail.com
> > >
> > > > > > wrote:
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > > this is my first question, so i hope I get everything right.
> > > > > >
> > > > > > I am trying to catch the event of the user closing the browser
> > window
> > > > in
> > > > > > wicket.
> > > > > >
> > > > > > I followed this example:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
> > > > > >
> > > > > > and I managed to get the example working so the message is
> > displayed,
> > > > > but I
> > > > > > have no idea how to get the event triggered by the javascript
> > > function
> > > > in
> > > > > > wicket. I need this because when the user closes the browser
> > window I
> > > > > want
> > > > > > to update some data in my database.
> > > > > > Here is what I have tryed:
> > > > > >
> > > > > >
> > > > > >  RequiredTextField myTextField = new
> > > > > > RequiredTextField("myTextField");
> > > > > >  myTextField.setOutputMarkupPlaceholderTag(true);
> > > > > >  myTextField.add(new PageExitWarningBehavior(){
> > > > > > @Override
> > > > > > public void onEvent(Component component, IEvent
> > event)
> > > > > > {
> > > > > > //this isn't ever called
> > > > > > MySession.get().releaseBlockedDataFromDatabase();
> > > > > > }
> > > > > > });
> > > > > >
> > > > > > public class PageExitWarningBehavior extends Behavior  {
> > > > > > @Override
> > > > > > public void renderHead(Component component,
> IHeaderResponse
> > > > > > response) {
> > > > > > super.renderHead(component, response);
> > > > > > response.render(new
> > > > > > OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
> > > > > >
> > > > > >
> > > > > >   + "Wicket.Ajax.get({u:
> > '"+getCallbackUrl()+"',
> > > > > async:
> > > > > > false});"
> > > > > >
> > > > > >
> > > > > >   + "var message = 'Your confirmation message
> goes
> > > > > > here.',"
> > > > > >
> > > > > >   + "e = e || window.event;" + "if (e) {"
> > > > > >
> > > > > >   + "e.returnValue = message;" + "}" + "return
> > > > message;"
> > > > > +
> > > > > > "};"));
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > What am I missing? Thank you very much 

[ANNOUNCE] Wicket jQuery UI 6.12.0 is released

2013-11-11 Thread Sebastien
Hi,

wicket-jquery-ui 6.12.0 based on Apache Wicket 6.12.0 is released and will
shortly be available in Maven Central.

The changelog can be found at the wiki page:
https://github.com/sebfz1/wicket-jquery-ui/wiki/%5Bchangelog%5D-wicket-jquery-ui-6.12.0

Maven dependency


com.googlecode.wicket-jquery-ui
wicket-jquery-ui
6.12.0


Non Maven users can download the jars manually from here
http://central.maven.org/maven2/com/googlecode/wicket-jquery-ui/

Enjoy!


Re: Wicket localization in stateful pages

2013-11-11 Thread meduolis
Storing it in page will not work as it will reset each time I call
setResponsePage.
Storing it in data base will not work also, because locale will became
global for all visitors.
So I tried to pass it using page parameters. Also, I have updated dynamic
label model to LoadableDetachableModel.

This time I got different result, but still, not what I expected.

"Back" action restores locale from page parameter one step behind the value
stored in session,
so I got different values each time I go back.
Attaching updated version, if there is still someone who will to help me:
versionLocale.zip
  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662326.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



AW: Link

2013-11-11 Thread Christian Schröter
Hey,

For a simple solution just overwrite onComponentTag().
But I think there a already complete components addressing this issue.

   @Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (getPage().getPageClass() == Fault.class) {
// inline style
tag.put("style", "color: red;");
// css class
tag.put("class", "active");
}
}

Cheers,
Christian

Von: christoph.ma...@t-systems.com [mailto:christoph.ma...@t-systems.com]
Gesendet: Montag, 11. November 2013 11:23
An: users@wicket.apache.org
Betreff: Link

Hello,

there are 4 links at the top of my page.
[cid:eda0a64b-ce32-4c04-b1b1-cc10df635636]
Every link should forward to another page. But the User couldn't see on which 
page he is. I want to change the color of the links depending on the page which 
the user has chosen. How can I realize this? I implemented the links like this:

Link faultLink = new Link("faultLink") {
@Override
public void onClick() {
setResponsePage(Fault.class);
}
};

Christoph




Re: Wicket localization in stateful pages

2013-11-11 Thread Sven Meier

Is there a way to restore locale for dynamic models when navigating between 
page versions?


Whenever the locale is changed, put it in the session and store it in the page 
too.
Override #getLocale() and return whatever is stored as the page's locale.

Sven


On 11/11/2013 04:24 PM, meduolis wrote:

So, back button does not restore locale value in session?

Ok, I will be more specific:

*action 1.* I click link switchLanguageToEN; (VERSION 1) (both labels (with
static and dynamic models) updates to english);
*action 2.* I click link switchLanguageToDE; (VERSION 2)(... updates to
german);
*action 3.* I click back in browser; (VERSION 1) (label with static model
updates to english, dynamic - stays german).

debug result:
Static model: getSession().getLocale() == en EN (locale restored from
version 1)
Dynamic model: getSession().getLocale() == de DE (locale taken from version
2)

My last question related to this topic (sorry for that spam):

1. Is there a way to restore locale for dynamic models when navigating
between page versions?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662323.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: Wicket localization in stateful pages

2013-11-11 Thread meduolis
So, back button does not restore locale value in session?

Ok, I will be more specific:

*action 1.* I click link switchLanguageToEN; (VERSION 1) (both labels (with
static and dynamic models) updates to english);
*action 2.* I click link switchLanguageToDE; (VERSION 2)(... updates to
german);
*action 3.* I click back in browser; (VERSION 1) (label with static model
updates to english, dynamic - stays german).

debug result:
Static model: getSession().getLocale() == en EN (locale restored from
version 1)
Dynamic model: getSession().getLocale() == de DE (locale taken from version
2)

My last question related to this topic (sorry for that spam):

1. Is there a way to restore locale for dynamic models when navigating
between page versions?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662323.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: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Martin Grigorov
There is a difference between onunload and onbeforeunload. You can cancel
the latter.
You can make Ajax call only in onbeforeunload. And it has to be synchronous.


On Mon, Nov 11, 2013 at 4:55 PM, Cedric Gatay  wrote:

> AFAIK the browser won't issue a new server call (or will not process the
> response) once the onunload event has been called so I doubt this will work
> (using the web inspector of your browser will allow you to check whether or
> not the call has been done)
>
> I second what Martin said, you need to add the JavaScript code to call the
> server.
> Le 11 nov. 2013 15:29, "Martin Grigorov"  a écrit :
>
> > respond() is the callback method that Wicket will notify.
> > But you need to trigger an Ajax call first. This is done with the Wicket
> > Ajax API: Wicket.Ajax.get(...).
> >
> > Just try with the line I've added in your JS code
> >
> >
> > On Mon, Nov 11, 2013 at 4:04 PM, Daniela L  wrote:
> >
> > > I thought adding respond was the ajax call to the server, am I wrong?
> > > I didn't work much with ajax, i am sorry
> > >
> > >
> > > 2013/11/11 Martin Grigorov 
> > >
> > > > Did you do what I suggested you ?
> > > >
> > > >
> > > > On Mon, Nov 11, 2013 at 3:49 PM, Daniela L 
> > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have tryed to change to AbstractDefaultAjaxBehavior like I
> > described
> > > > > below, but respond is never called. What am I doing wrong?
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > as far as I have understood this can only be achieved, if I
> subclass
> > > > > AbstractDefaultAjaxBehavior like this?
> > > > >
> > > > > public class PageExitWarningBehavior extends
> > > AbstractDefaultAjaxBehavior
> > > >  {
> > > > > @Override
> > > > > protected void respond(AjaxRequestTarget target) {
> > > > >
> > > > > AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
> > > > >   }
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > You need to make an Ajax call to the server.
> > > > >
> > > > >
> > > > > On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
> > > > >   >
> > > > > wrote:
> > > > >
> > > > >
> > > > > Hi,
> > > > > this is my first question, so i hope I get everything right.
> > > > >
> > > > > I am trying to catch the event of the user closing the browser
> window
> > > in
> > > > > wicket.
> > > > >
> > > > > I followed this example:
> > > > >
> > > > >
> > > >
> > >
> >
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
> > > > >
> > > > > and I managed to get the example working so the message is
> displayed,
> > > > but I
> > > > > have no idea how to get the event triggered by the javascript
> > function
> > > in
> > > > > wicket. I need this because when the user closes the browser
> window I
> > > > want
> > > > > to update some data in my database.
> > > > > Here is what I have tryed:
> > > > >
> > > > >
> > > > >  RequiredTextField myTextField = new
> > > > > RequiredTextField("myTextField");
> > > > >  myTextField.setOutputMarkupPlaceholderTag(true);
> > > > >  myTextField.add(new PageExitWarningBehavior(){
> > > > > @Override
> > > > > public void onEvent(Component component, IEvent
> event)
> > > > > {
> > > > > //this isn't ever called
> > > > > MySession.get().releaseBlockedDataFromDatabase();
> > > > > }
> > > > > });
> > > > >
> > > > > public class PageExitWarningBehavior extends Behavior  {
> > > > > @Override
> > > > > public void renderHead(Component component, IHeaderResponse
> > > > > response) {
> > > > > super.renderHead(component, response);
> > > > > response.render(new
> > > > > OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
> > > > >
> > > > >
> > > > >   + "Wicket.Ajax.get({u:
> '"+getCallbackUrl()+"',
> > > > async:
> > > > > false});"
> > > > >
> > > > >
> > > > >   + "var message = 'Your confirmation message goes
> > > > > here.',"
> > > > >
> > > > >   + "e = e || window.event;" + "if (e) {"
> > > > >
> > > > >   + "e.returnValue = message;" + "}" + "return
> > > message;"
> > > > +
> > > > > "};"));
> > > > > }
> > > > > }
> > > > >
> > > > > What am I missing? Thank you very much in advance
> > > > >
> > > >
> > >
> >
>


Re: Wicket localization in stateful pages

2013-11-11 Thread Martin Grigorov
Hi meduolis,

I hope you know what http session is.
It doesn't matter how you get to a page (via a normal (forward) link or via
back button), when you read an attribute value from the session it will be
the same.

In your case the dynamic models use the session's locale to decide which
i18n resource bundle to use.


On Mon, Nov 11, 2013 at 4:49 PM, meduolis  wrote:

> Hi Martin,
>
> so, if I want "browser back" action to show the same result, I have to
> choose between components with static models or components with dynamic
> models only? Because if I use different types I will get different results
> when backing to older page version?
> I am really not getting the thing here :). Shouldn't it be consistent?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662319.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: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Cedric Gatay
AFAIK the browser won't issue a new server call (or will not process the
response) once the onunload event has been called so I doubt this will work
(using the web inspector of your browser will allow you to check whether or
not the call has been done)

I second what Martin said, you need to add the JavaScript code to call the
server.
Le 11 nov. 2013 15:29, "Martin Grigorov"  a écrit :

> respond() is the callback method that Wicket will notify.
> But you need to trigger an Ajax call first. This is done with the Wicket
> Ajax API: Wicket.Ajax.get(...).
>
> Just try with the line I've added in your JS code
>
>
> On Mon, Nov 11, 2013 at 4:04 PM, Daniela L  wrote:
>
> > I thought adding respond was the ajax call to the server, am I wrong?
> > I didn't work much with ajax, i am sorry
> >
> >
> > 2013/11/11 Martin Grigorov 
> >
> > > Did you do what I suggested you ?
> > >
> > >
> > > On Mon, Nov 11, 2013 at 3:49 PM, Daniela L 
> wrote:
> > >
> > > > Hi,
> > > >
> > > > I have tryed to change to AbstractDefaultAjaxBehavior like I
> described
> > > > below, but respond is never called. What am I doing wrong?
> > > >
> > > >
> > > > Hi,
> > > >
> > > > as far as I have understood this can only be achieved, if I subclass
> > > > AbstractDefaultAjaxBehavior like this?
> > > >
> > > > public class PageExitWarningBehavior extends
> > AbstractDefaultAjaxBehavior
> > >  {
> > > > @Override
> > > > protected void respond(AjaxRequestTarget target) {
> > > >
> > > > AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
> > > >   }
> > > >
> > > >
> > > > Hi,
> > > >
> > > > You need to make an Ajax call to the server.
> > > >
> > > >
> > > > On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
> > > >  
> > > > wrote:
> > > >
> > > >
> > > > Hi,
> > > > this is my first question, so i hope I get everything right.
> > > >
> > > > I am trying to catch the event of the user closing the browser window
> > in
> > > > wicket.
> > > >
> > > > I followed this example:
> > > >
> > > >
> > >
> >
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
> > > >
> > > > and I managed to get the example working so the message is displayed,
> > > but I
> > > > have no idea how to get the event triggered by the javascript
> function
> > in
> > > > wicket. I need this because when the user closes the browser window I
> > > want
> > > > to update some data in my database.
> > > > Here is what I have tryed:
> > > >
> > > >
> > > >  RequiredTextField myTextField = new
> > > > RequiredTextField("myTextField");
> > > >  myTextField.setOutputMarkupPlaceholderTag(true);
> > > >  myTextField.add(new PageExitWarningBehavior(){
> > > > @Override
> > > > public void onEvent(Component component, IEvent event)
> > > > {
> > > > //this isn't ever called
> > > > MySession.get().releaseBlockedDataFromDatabase();
> > > > }
> > > > });
> > > >
> > > > public class PageExitWarningBehavior extends Behavior  {
> > > > @Override
> > > > public void renderHead(Component component, IHeaderResponse
> > > > response) {
> > > > super.renderHead(component, response);
> > > > response.render(new
> > > > OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
> > > >
> > > >
> > > >   + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"',
> > > async:
> > > > false});"
> > > >
> > > >
> > > >   + "var message = 'Your confirmation message goes
> > > > here.',"
> > > >
> > > >   + "e = e || window.event;" + "if (e) {"
> > > >
> > > >   + "e.returnValue = message;" + "}" + "return
> > message;"
> > > +
> > > > "};"));
> > > > }
> > > > }
> > > >
> > > > What am I missing? Thank you very much in advance
> > > >
> > >
> >
>


Re: Wicket localization in stateful pages

2013-11-11 Thread meduolis
Hi Martin,

so, if I want "browser back" action to show the same result, I have to
choose between components with static models or components with dynamic
models only? Because if I use different types I will get different results
when backing to older page version? 
I am really not getting the thing here :). Shouldn't it be consistent?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662319.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: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Martin Grigorov
respond() is the callback method that Wicket will notify.
But you need to trigger an Ajax call first. This is done with the Wicket
Ajax API: Wicket.Ajax.get(...).

Just try with the line I've added in your JS code


On Mon, Nov 11, 2013 at 4:04 PM, Daniela L  wrote:

> I thought adding respond was the ajax call to the server, am I wrong?
> I didn't work much with ajax, i am sorry
>
>
> 2013/11/11 Martin Grigorov 
>
> > Did you do what I suggested you ?
> >
> >
> > On Mon, Nov 11, 2013 at 3:49 PM, Daniela L  wrote:
> >
> > > Hi,
> > >
> > > I have tryed to change to AbstractDefaultAjaxBehavior like I described
> > > below, but respond is never called. What am I doing wrong?
> > >
> > >
> > > Hi,
> > >
> > > as far as I have understood this can only be achieved, if I subclass
> > > AbstractDefaultAjaxBehavior like this?
> > >
> > > public class PageExitWarningBehavior extends
> AbstractDefaultAjaxBehavior
> >  {
> > > @Override
> > > protected void respond(AjaxRequestTarget target) {
> > >
> > > AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
> > >   }
> > >
> > >
> > > Hi,
> > >
> > > You need to make an Ajax call to the server.
> > >
> > >
> > > On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
> > >  
> > > wrote:
> > >
> > >
> > > Hi,
> > > this is my first question, so i hope I get everything right.
> > >
> > > I am trying to catch the event of the user closing the browser window
> in
> > > wicket.
> > >
> > > I followed this example:
> > >
> > >
> >
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
> > >
> > > and I managed to get the example working so the message is displayed,
> > but I
> > > have no idea how to get the event triggered by the javascript function
> in
> > > wicket. I need this because when the user closes the browser window I
> > want
> > > to update some data in my database.
> > > Here is what I have tryed:
> > >
> > >
> > >  RequiredTextField myTextField = new
> > > RequiredTextField("myTextField");
> > >  myTextField.setOutputMarkupPlaceholderTag(true);
> > >  myTextField.add(new PageExitWarningBehavior(){
> > > @Override
> > > public void onEvent(Component component, IEvent event)
> > > {
> > > //this isn't ever called
> > > MySession.get().releaseBlockedDataFromDatabase();
> > > }
> > > });
> > >
> > > public class PageExitWarningBehavior extends Behavior  {
> > > @Override
> > > public void renderHead(Component component, IHeaderResponse
> > > response) {
> > > super.renderHead(component, response);
> > > response.render(new
> > > OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
> > >
> > >
> > >   + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"',
> > async:
> > > false});"
> > >
> > >
> > >   + "var message = 'Your confirmation message goes
> > > here.',"
> > >
> > >   + "e = e || window.event;" + "if (e) {"
> > >
> > >   + "e.returnValue = message;" + "}" + "return
> message;"
> > +
> > > "};"));
> > > }
> > > }
> > >
> > > What am I missing? Thank you very much in advance
> > >
> >
>


Re: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Daniela L
I thought adding respond was the ajax call to the server, am I wrong?
I didn't work much with ajax, i am sorry


2013/11/11 Martin Grigorov 

> Did you do what I suggested you ?
>
>
> On Mon, Nov 11, 2013 at 3:49 PM, Daniela L  wrote:
>
> > Hi,
> >
> > I have tryed to change to AbstractDefaultAjaxBehavior like I described
> > below, but respond is never called. What am I doing wrong?
> >
> >
> > Hi,
> >
> > as far as I have understood this can only be achieved, if I subclass
> > AbstractDefaultAjaxBehavior like this?
> >
> > public class PageExitWarningBehavior extends AbstractDefaultAjaxBehavior
>  {
> > @Override
> > protected void respond(AjaxRequestTarget target) {
> >
> > AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
> >   }
> >
> >
> > Hi,
> >
> > You need to make an Ajax call to the server.
> >
> >
> > On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
> >  
> > wrote:
> >
> >
> > Hi,
> > this is my first question, so i hope I get everything right.
> >
> > I am trying to catch the event of the user closing the browser window in
> > wicket.
> >
> > I followed this example:
> >
> >
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
> >
> > and I managed to get the example working so the message is displayed,
> but I
> > have no idea how to get the event triggered by the javascript function in
> > wicket. I need this because when the user closes the browser window I
> want
> > to update some data in my database.
> > Here is what I have tryed:
> >
> >
> >  RequiredTextField myTextField = new
> > RequiredTextField("myTextField");
> >  myTextField.setOutputMarkupPlaceholderTag(true);
> >  myTextField.add(new PageExitWarningBehavior(){
> > @Override
> > public void onEvent(Component component, IEvent event)
> > {
> > //this isn't ever called
> > MySession.get().releaseBlockedDataFromDatabase();
> > }
> > });
> >
> > public class PageExitWarningBehavior extends Behavior  {
> > @Override
> > public void renderHead(Component component, IHeaderResponse
> > response) {
> > super.renderHead(component, response);
> > response.render(new
> > OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
> >
> >
> >   + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"',
> async:
> > false});"
> >
> >
> >   + "var message = 'Your confirmation message goes
> > here.',"
> >
> >   + "e = e || window.event;" + "if (e) {"
> >
> >   + "e.returnValue = message;" + "}" + "return message;"
> +
> > "};"));
> > }
> > }
> >
> > What am I missing? Thank you very much in advance
> >
>


AW: Link

2013-11-11 Thread Christoph.Manig
Ok thanks.

I did the same like this:
Link faultLink = new Link("faultLink") {
@Override
public void onClick() {
setResponsePage(Fault.class);
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (pageName.equals(Fault.class.getSimpleName())){
tag.put("class", pageName);
}
}
};


Christoph

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



Re: Link

2013-11-11 Thread Ernesto Reinaldo Barreiro
You want to give a different CSS for links in different pages?

public class ClassModifier extends AttributeModifier {

/**
 * @param attribute
 * @param replaceModel
 */
public ClassModifier(IModel replaceModel) {
super("class", replaceModel);
}

/**
 * @param attribute
 * @param value
 */
public ClassModifier(Serializable value) {
super("class", value);
}

}

and

faultLink.add(new ClassModifier(this.getClass().getSimpleName()) )

?


On Mon, Nov 11, 2013 at 12:50 PM,  wrote:

> I mean an example for the CSS Solution
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics
> Hoyerswerdaer Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 – 209
> email:  christoph.ma...@t-systems.com
>
>
> -Ursprüngliche Nachricht-
> Von: Martin Grigorov [mailto:mgrigo...@apache.org]
> Gesendet: Montag, 11. November 2013 12:41
> An: users@wicket.apache.org
> Betreff: Re: Link
>
> BookmarkablePageLink faultLink = new BookmarkablePageLink("faultLink",
> Fault.class); faultLink.setAutoEnable(true);
>
>
> On Mon, Nov 11, 2013 at 1:37 PM,  wrote:
>
> > Can you give an example?
> >
> >
> > Mit freundlichen Grüßen
> > Christoph Manig
> > Systems Engineer
> >
> > T-Systems International GmbH
> > Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer
> > Str. 18
> > 01099 Dresden
> > tel.:   +49 (0) 351 / 8152 - 188
> > fax:+49 (0) 351 / 8152 - 209
> > email:  christoph.ma...@t-systems.com
> >
> >
> > -Ursprüngliche Nachricht-
> > Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> > Gesendet: Montag, 11. November 2013 11:34
> > An: users@wicket.apache.org
> > Betreff: Re: Link
> >
> > Maybe use CSS? Add a class attribute with the "name" of the page?
> >
> >
> > On Mon, Nov 11, 2013 at 11:23 AM,  wrote:
> >
> > >  Hello,
> > >
> > > there are 4 links at the top of my page.
> > >  Every link should forward to another page. But the User couldn't
> > > see on which page he is. I want to change the color of the links
> > > depending on the page which the user has chosen. How can I realize
> > > this? I implemented the links like this:
> > >
> > > Link faultLink = new Link("faultLink") {
> > > @Override
> > > public void onClick() {
> > > setResponsePage(Fault.class);
> > > }
> > > };
> > >
> > > Christoph
> > >
> > >
> > >
> > >
> > > 
> > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Martin Grigorov
Did you do what I suggested you ?


On Mon, Nov 11, 2013 at 3:49 PM, Daniela L  wrote:

> Hi,
>
> I have tryed to change to AbstractDefaultAjaxBehavior like I described
> below, but respond is never called. What am I doing wrong?
>
>
> Hi,
>
> as far as I have understood this can only be achieved, if I subclass
> AbstractDefaultAjaxBehavior like this?
>
> public class PageExitWarningBehavior extends AbstractDefaultAjaxBehavior  {
> @Override
> protected void respond(AjaxRequestTarget target) {
>
> AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
>   }
>
>
> Hi,
>
> You need to make an Ajax call to the server.
>
>
> On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
>  
> wrote:
>
>
> Hi,
> this is my first question, so i hope I get everything right.
>
> I am trying to catch the event of the user closing the browser window in
> wicket.
>
> I followed this example:
>
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
>
> and I managed to get the example working so the message is displayed, but I
> have no idea how to get the event triggered by the javascript function in
> wicket. I need this because when the user closes the browser window I want
> to update some data in my database.
> Here is what I have tryed:
>
>
>  RequiredTextField myTextField = new
> RequiredTextField("myTextField");
>  myTextField.setOutputMarkupPlaceholderTag(true);
>  myTextField.add(new PageExitWarningBehavior(){
> @Override
> public void onEvent(Component component, IEvent event)
> {
> //this isn't ever called
> MySession.get().releaseBlockedDataFromDatabase();
> }
> });
>
> public class PageExitWarningBehavior extends Behavior  {
> @Override
> public void renderHead(Component component, IHeaderResponse
> response) {
> super.renderHead(component, response);
> response.render(new
> OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
>
>
>   + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"', async:
> false});"
>
>
>   + "var message = 'Your confirmation message goes
> here.',"
>
>   + "e = e || window.event;" + "if (e) {"
>
>   + "e.returnValue = message;" + "}" + "return message;" +
> "};"));
> }
> }
>
> What am I missing? Thank you very much in advance
>


Re: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Daniela L
Hi,

I have tryed to change to AbstractDefaultAjaxBehavior like I described
below, but respond is never called. What am I doing wrong?


Hi,

as far as I have understood this can only be achieved, if I subclass
AbstractDefaultAjaxBehavior like this?

public class PageExitWarningBehavior extends AbstractDefaultAjaxBehavior  {
@Override
protected void respond(AjaxRequestTarget target) {
AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }


Hi,

You need to make an Ajax call to the server.


On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
 
wrote:


Hi,
this is my first question, so i hope I get everything right.

I am trying to catch the event of the user closing the browser window in
wicket.

I followed this example:
http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value

and I managed to get the example working so the message is displayed, but I
have no idea how to get the event triggered by the javascript function in
wicket. I need this because when the user closes the browser window I want
to update some data in my database.
Here is what I have tryed:


 RequiredTextField myTextField = new
RequiredTextField("myTextField");
 myTextField.setOutputMarkupPlaceholderTag(true);
 myTextField.add(new PageExitWarningBehavior(){
@Override
public void onEvent(Component component, IEvent event)
{
//this isn't ever called
MySession.get().releaseBlockedDataFromDatabase();
}
});

public class PageExitWarningBehavior extends Behavior  {
@Override
public void renderHead(Component component, IHeaderResponse
response) {
super.renderHead(component, response);
response.render(new
OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"


  + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"', async:
false});"


  + "var message = 'Your confirmation message goes
here.',"

  + "e = e || window.event;" + "if (e) {"

  + "e.returnValue = message;" + "}" + "return message;" +
"};"));
}
}

What am I missing? Thank you very much in advance


Re: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Daniela L
Hi,

as far as I have understood this can only be achieved, if I subclass
AbstractDefaultAjaxBehavior like this?

public class PageExitWarningBehavior extends AbstractDefaultAjaxBehavior  {
@Override
protected void respond(AjaxRequestTarget target) {
AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }


Hi,

You need to make an Ajax call to the server.


On Mon, Nov 11, 2013 at 2:10 PM, Daniela L 
 wrote:


Hi,
this is my first question, so i hope I get everything right.

I am trying to catch the event of the user closing the browser window in
wicket.

I followed this example:

http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value

and I managed to get the example working so the message is displayed, but I
have no idea how to get the event triggered by the javascript function in
wicket. I need this because when the user closes the browser window I want
to update some data in my database.
Here is what I have tryed:


 RequiredTextField myTextField = new
RequiredTextField("myTextField");
 myTextField.setOutputMarkupPlaceholderTag(true);
 myTextField.add(new PageExitWarningBehavior(){
@Override
public void onEvent(Component component, IEvent event)
{
//this isn't ever called
MySession.get().releaseBlockedDataFromDatabase();
}
});

public class PageExitWarningBehavior extends Behavior  {
@Override
public void renderHead(Component component, IHeaderResponse
response) {
super.renderHead(component, response);
response.render(new
OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"


  + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"', async:
false});"


  + "var message = 'Your confirmation message goes
here.',"

  + "e = e || window.event;" + "if (e) {"

  + "e.returnValue = message;" + "}" + "return message;" +
"};"));
}
}

What am I missing? Thank you very much in advance


Re: Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Martin Grigorov
Hi,

You need to make an Ajax call to the server.


On Mon, Nov 11, 2013 at 2:10 PM, Daniela L  wrote:

> Hi,
> this is my first question, so i hope I get everything right.
>
> I am trying to catch the event of the user closing the browser window in
> wicket.
>
> I followed this example:
>
>
> http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value
>
> and I managed to get the example working so the message is displayed, but I
> have no idea how to get the event triggered by the javascript function in
> wicket. I need this because when the user closes the browser window I want
> to update some data in my database.
> Here is what I have tryed:
>
>
>  RequiredTextField myTextField = new
> RequiredTextField("myTextField");
>  myTextField.setOutputMarkupPlaceholderTag(true);
>  myTextField.add(new PageExitWarningBehavior(){
> @Override
> public void onEvent(Component component, IEvent event)
> {
> //this isn't ever called
> MySession.get().releaseBlockedDataFromDatabase();
> }
> });
>
> public class PageExitWarningBehavior extends Behavior  {
> @Override
> public void renderHead(Component component, IHeaderResponse
> response) {
> super.renderHead(component, response);
> response.render(new
> OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
>
  + "Wicket.Ajax.get({u: '"+getCallbackUrl()+"', async:
false});"

>   + "var message = 'Your confirmation message goes
> here.',"

  + "e = e || window.event;" + "if (e) {"
>   + "e.returnValue = message;" + "}" + "return message;" +
> "};"));
> }
> }
>
> What am I missing? Thank you very much in advance :-)
>


Get return value of ajax event in Wicket 6.9.1

2013-11-11 Thread Daniela L
Hi,
this is my first question, so i hope I get everything right.

I am trying to catch the event of the user closing the browser window in
wicket.

I followed this example:

http://stackoverflow.com/questions/16527463/call-java-component-from-javascript-and-retreive-value

and I managed to get the example working so the message is displayed, but I
have no idea how to get the event triggered by the javascript function in
wicket. I need this because when the user closes the browser window I want
to update some data in my database.
Here is what I have tryed:


 RequiredTextField myTextField = new
RequiredTextField("myTextField");
 myTextField.setOutputMarkupPlaceholderTag(true);
 myTextField.add(new PageExitWarningBehavior(){
@Override
public void onEvent(Component component, IEvent event)
{
//this isn't ever called
MySession.get().releaseBlockedDataFromDatabase();
}
});

public class PageExitWarningBehavior extends Behavior  {
@Override
public void renderHead(Component component, IHeaderResponse
response) {
super.renderHead(component, response);
response.render(new
OnDomReadyHeaderItem("window.onbeforeunload = function (e) {"
  + "var message = 'Your confirmation message goes here.',"
  + "e = e || window.event;" + "if (e) {"
  + "e.returnValue = message;" + "}" + "return message;" +
"};"));
}
}

What am I missing? Thank you very much in advance :-)


AW: Link

2013-11-11 Thread Christoph.Manig
I mean an example for the CSS Solution


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden 
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 – 209
email:  christoph.ma...@t-systems.com


-Ursprüngliche Nachricht-
Von: Martin Grigorov [mailto:mgrigo...@apache.org] 
Gesendet: Montag, 11. November 2013 12:41
An: users@wicket.apache.org
Betreff: Re: Link

BookmarkablePageLink faultLink = new BookmarkablePageLink("faultLink", 
Fault.class); faultLink.setAutoEnable(true);


On Mon, Nov 11, 2013 at 1:37 PM,  wrote:

> Can you give an example?
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer 
> Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 - 209
> email:  christoph.ma...@t-systems.com
>
>
> -Ursprüngliche Nachricht-
> Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Gesendet: Montag, 11. November 2013 11:34
> An: users@wicket.apache.org
> Betreff: Re: Link
>
> Maybe use CSS? Add a class attribute with the "name" of the page?
>
>
> On Mon, Nov 11, 2013 at 11:23 AM,  wrote:
>
> >  Hello,
> >
> > there are 4 links at the top of my page.
> >  Every link should forward to another page. But the User couldn't 
> > see on which page he is. I want to change the color of the links 
> > depending on the page which the user has chosen. How can I realize 
> > this? I implemented the links like this:
> >
> > Link faultLink = new Link("faultLink") {
> > @Override
> > public void onClick() {
> > setResponsePage(Fault.class);
> > }
> > };
> >
> > Christoph
> >
> >
> >
> >
> > 
> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Link

2013-11-11 Thread Martin Grigorov
BookmarkablePageLink faultLink = new BookmarkablePageLink("faultLink",
Fault.class);
faultLink.setAutoEnable(true);


On Mon, Nov 11, 2013 at 1:37 PM,  wrote:

> Can you give an example?
>
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics
> Hoyerswerdaer Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 - 209
> email:  christoph.ma...@t-systems.com
>
>
> -Ursprüngliche Nachricht-
> Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Gesendet: Montag, 11. November 2013 11:34
> An: users@wicket.apache.org
> Betreff: Re: Link
>
> Maybe use CSS? Add a class attribute with the "name" of the page?
>
>
> On Mon, Nov 11, 2013 at 11:23 AM,  wrote:
>
> >  Hello,
> >
> > there are 4 links at the top of my page.
> >  Every link should forward to another page. But the User couldn't see
> > on which page he is. I want to change the color of the links depending
> > on the page which the user has chosen. How can I realize this? I
> > implemented the links like this:
> >
> > Link faultLink = new Link("faultLink") {
> > @Override
> > public void onClick() {
> > setResponsePage(Fault.class);
> > }
> > };
> >
> > Christoph
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


AW: Link

2013-11-11 Thread Christoph.Manig
Can you give an example?


Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden 
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 - 209
email:  christoph.ma...@t-systems.com


-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Montag, 11. November 2013 11:34
An: users@wicket.apache.org
Betreff: Re: Link

Maybe use CSS? Add a class attribute with the "name" of the page?


On Mon, Nov 11, 2013 at 11:23 AM,  wrote:

>  Hello,
>
> there are 4 links at the top of my page.
>  Every link should forward to another page. But the User couldn't see 
> on which page he is. I want to change the color of the links depending 
> on the page which the user has chosen. How can I realize this? I 
> implemented the links like this:
>
> Link faultLink = new Link("faultLink") {
> @Override
> public void onClick() {
> setResponsePage(Fault.class);
> }
> };
>
> Christoph
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



--
Regards - Ernesto Reinaldo Barreiro

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



SV: Table row visibility

2013-11-11 Thread Tron Walseth
Hi again

I wanted to turn on/off row visibility, and in doing that, I wanted to set row 
id on the row. 

I found out how this should be done, in overriding the newRowItem on the 
DefaultDataTable class, and adding an AttributeModifier to the rowItem. 

Sorry for any inconvenience. 

Yours, 
Tron Walseth

Fra: Martin Grigorov [mgrigo...@apache.org]
Sendt: 11. november 2013 11:28
Til: users@wicket.apache.org
Emne: Re: Table row visibility

Hi,

What is your question ?
I guess "how to get the markup id of the row?".
I'd suggest you to add a JS event listener on the  that filters for
clicks on 'tr' (i.e. event delegation).


On Mon, Nov 11, 2013 at 12:17 PM, Tron Walseth  wrote:

> Hi,
>
> I have a table with legends explaining map (OpenLayers) layers.
> I want to turn visibility on/off on the entire row based on the visibility
> of these map layers using JS.
>
> I can easily turn on/off the visibility of the legend image itself using
> JavaScript/JQuery, but I want to toggle visibility of the entire row. I
> know this can be done through ajax, but I don't want to put extra
> unnecessary load on the server through Ajax calls.
>
> The easiest way to do this (AFAIK) is adding an id to the table row, and
> toggling visibility through JQuery:
>
> $("#tableRowId").show()/hide();
>
> Below is the entire code of my LegendPanel pasted.
>
> Yours,
> Tron Walseth
>
> public class LegendPanel extends MapPanel
> {
> private static final long serialVersionUID = 1L;
> /**
>  * @param id
>  */
> public LegendPanel(String id, List layers,
> BusinessDataAjaxMap map)
> {
> super(id, map);
> ListDataProvider dp = new
> ListDataProvider<>(layers);
> DefaultDataTable table = new
> DefaultDataTable<>("legends", getTableColumns(), dp, 10);
> add(table);
>
> }
>
> private static List> getTableColumns()
> {
> List> cols = new ArrayList<>();
> cols.add(new HeaderlessColumn() {
>
> private static final long serialVersionUID = 1L;
>
> @Override
> public void populateItem(Item>
> cellItem, String componentId, IModel rowModel)
> {
> cellItem.add(new Label(componentId,
> rowModel.getObject().getLegendDescription()));
> }});
> cols.add(new HeaderlessColumn() {
> private static final long serialVersionUID = 1L;
>
> @Override
> public void populateItem(Item>
> cellItem, String componentId, IModel rowModel)
> {
> Url imgUrl =
> Url.parse(rowModel.getObject().getLayerLegend().trim());
> ResourceReference ref = new UrlResourceReference(imgUrl);
> ImagePanel i = new ImagePanel(componentId, ref);
> i.setMarkupId(rowModel.getObject().getLegendDescription());
> cellItem.add(i);
> }
> });
>
> return cols;
> }
>
> /* (non-Javadoc)
>  * @see
> org.apache.wicket.Component#renderHead(org.apache.wicket.markup.head.IHeaderResponse)
>  */
> @Override
> public void renderHead(IHeaderResponse response)
> {
> super.renderHead(response);
> response.render(JavaScriptHeaderItem.forScript("function
> toggleLegend(event){\n\t" +
> "var visible = event.object.visibility;\n" +
> "\tvar divObject = '#' +
> event.object.params.BUSINESSNAME;\n" +
> "\tif (visible) \n" +
> "\t\t$(divObject).show();\n" +
> "\telse\n" +
> "\t\t$(divObject).hide();\n" +
> "}", "layerlegend"));
> }
>
> /* (non-Javadoc)
>  * @see
> no.telespor.web.page.map.openlayers.MapPanel#updateComponents(org.apache.wicket.ajax.AjaxRequestTarget)
>  */
> @Override
> public void updateComponents(AjaxRequestTarget target)
> {
> //empty on purpose
> }
> }
>
> -
> 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: Link

2013-11-11 Thread Martin Grigorov
On Mon, Nov 11, 2013 at 12:41 PM,  wrote:

> Hello,
>
> I was already trying this. But it didn't works. Here is HTML:
> ESB Fehler |  wicket:id="protokollierungLink">Protokollierung  |  wicket:id="userManagementLink">Benutzerverwaltung |  wicket:id="changePasswordLink">Passwort ändern
>
> And here the Java:
> Link faultLink = new Link("faultLink") {
>  @Override
>  public void onClick() {
> setResponsePage(Fault.class);
>

If this is all your Java code then you better use BookmarkablePageLink. It
is more optimal solution for this.


>   }
> };
> faultLink.setAutoEnable(true);
>
> These links are in my parent page. The FaultPage extends of my parent
> page. Could that be the problem?
>
> Mit freundlichen Grüßen
> Christoph Manig
> Systems Engineer
>
> T-Systems International GmbH
> Systems Integration - SC Travel, Transport & Logistics
> Hoyerswerdaer Str. 18
> 01099 Dresden
> tel.:   +49 (0) 351 / 8152 - 188
> fax:+49 (0) 351 / 8152 – 209
> email:  christoph.ma...@t-systems.com
>
> -Ursprüngliche Nachricht-
> Von: Martin Grigorov [mailto:mgrigo...@apache.org]
> Gesendet: Montag, 11. November 2013 11:32
> An: users@wicket.apache.org
> Betreff: Re: Link
>
> Hi,
>
> See org.apache.wicket.markup.html.link.Link#setAutoEnable(true).
> This will automatically render "disabled" link for links which link to the
> current page.
>
>
> On Mon, Nov 11, 2013 at 12:23 PM,  wrote:
>
> >  Hello,
> >
> > there are 4 links at the top of my page.
> >  Every link should forward to another page. But the User couldn’t see
> > on which page he is. I want to change the color of the links depending
> > on the page which the user has chosen. How can I realize this? I
> > implemented the links like this:
> >
> > Link faultLink = new Link("faultLink") {
> > @Override
> > public void onClick() {
> > setResponsePage(Fault.class);
> > }
> > };
> >
> > Christoph
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>


Re: Handler after jqXhR success et before ajax response proccess

2013-11-11 Thread Olivier Dutrieux
thx for your response Martin,

Maybe a handler in the IAjaxCallListener (between jqXHR.success and Ajax
response is process) will be very nice feature in the future version of
wicket :)

Duto





-
Duto
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Handler-after-jqXhR-success-et-before-ajax-response-proccess-tp4662239p4662294.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



AW: Link

2013-11-11 Thread Christoph.Manig
Hello,

I was already trying this. But it didn't works. Here is HTML:
ESB Fehler | Protokollierung  | Benutzerverwaltung | Passwort ändern

And here the Java:
Link faultLink = new Link("faultLink") {
 @Override
 public void onClick() {
setResponsePage(Fault.class);
 }
};
faultLink.setAutoEnable(true);

These links are in my parent page. The FaultPage extends of my parent page. 
Could that be the problem? 

Mit freundlichen Grüßen
Christoph Manig
Systems Engineer

T-Systems International GmbH
Systems Integration - SC Travel, Transport & Logistics
Hoyerswerdaer Str. 18
01099 Dresden 
tel.:   +49 (0) 351 / 8152 - 188
fax:+49 (0) 351 / 8152 – 209
email:  christoph.ma...@t-systems.com

-Ursprüngliche Nachricht-
Von: Martin Grigorov [mailto:mgrigo...@apache.org] 
Gesendet: Montag, 11. November 2013 11:32
An: users@wicket.apache.org
Betreff: Re: Link

Hi,

See org.apache.wicket.markup.html.link.Link#setAutoEnable(true).
This will automatically render "disabled" link for links which link to the 
current page.


On Mon, Nov 11, 2013 at 12:23 PM,  wrote:

>  Hello,
>
> there are 4 links at the top of my page.
>  Every link should forward to another page. But the User couldn’t see 
> on which page he is. I want to change the color of the links depending 
> on the page which the user has chosen. How can I realize this? I 
> implemented the links like this:
>
> Link faultLink = new Link("faultLink") {
> @Override
> public void onClick() {
> setResponsePage(Fault.class);
> }
> };
>
> Christoph
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


Re: Link

2013-11-11 Thread Ernesto Reinaldo Barreiro
Maybe use CSS? Add a class attribute with the "name" of the page?


On Mon, Nov 11, 2013 at 11:23 AM,  wrote:

>  Hello,
>
> there are 4 links at the top of my page.
>  Every link should forward to another page. But the User couldn’t see on
> which page he is. I want to change the color of the links depending on the
> page which the user has chosen. How can I realize this? I implemented the
> links like this:
>
> Link faultLink = new Link("faultLink") {
> @Override
> public void onClick() {
> setResponsePage(Fault.class);
> }
> };
>
> Christoph
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: Link

2013-11-11 Thread Martin Grigorov
Hi,

See org.apache.wicket.markup.html.link.Link#setAutoEnable(true).
This will automatically render "disabled" link for links which link to the
current page.


On Mon, Nov 11, 2013 at 12:23 PM,  wrote:

>  Hello,
>
> there are 4 links at the top of my page.
>  Every link should forward to another page. But the User couldn’t see on
> which page he is. I want to change the color of the links depending on the
> page which the user has chosen. How can I realize this? I implemented the
> links like this:
>
> Link faultLink = new Link("faultLink") {
> @Override
> public void onClick() {
> setResponsePage(Fault.class);
> }
> };
>
> Christoph
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


Re: Table row visibility

2013-11-11 Thread Martin Grigorov
Hi,

What is your question ?
I guess "how to get the markup id of the row?".
I'd suggest you to add a JS event listener on the  that filters for
clicks on 'tr' (i.e. event delegation).


On Mon, Nov 11, 2013 at 12:17 PM, Tron Walseth  wrote:

> Hi,
>
> I have a table with legends explaining map (OpenLayers) layers.
> I want to turn visibility on/off on the entire row based on the visibility
> of these map layers using JS.
>
> I can easily turn on/off the visibility of the legend image itself using
> JavaScript/JQuery, but I want to toggle visibility of the entire row. I
> know this can be done through ajax, but I don't want to put extra
> unnecessary load on the server through Ajax calls.
>
> The easiest way to do this (AFAIK) is adding an id to the table row, and
> toggling visibility through JQuery:
>
> $("#tableRowId").show()/hide();
>
> Below is the entire code of my LegendPanel pasted.
>
> Yours,
> Tron Walseth
>
> public class LegendPanel extends MapPanel
> {
> private static final long serialVersionUID = 1L;
> /**
>  * @param id
>  */
> public LegendPanel(String id, List layers,
> BusinessDataAjaxMap map)
> {
> super(id, map);
> ListDataProvider dp = new
> ListDataProvider<>(layers);
> DefaultDataTable table = new
> DefaultDataTable<>("legends", getTableColumns(), dp, 10);
> add(table);
>
> }
>
> private static List> getTableColumns()
> {
> List> cols = new ArrayList<>();
> cols.add(new HeaderlessColumn() {
>
> private static final long serialVersionUID = 1L;
>
> @Override
> public void populateItem(Item>
> cellItem, String componentId, IModel rowModel)
> {
> cellItem.add(new Label(componentId,
> rowModel.getObject().getLegendDescription()));
> }});
> cols.add(new HeaderlessColumn() {
> private static final long serialVersionUID = 1L;
>
> @Override
> public void populateItem(Item>
> cellItem, String componentId, IModel rowModel)
> {
> Url imgUrl =
> Url.parse(rowModel.getObject().getLayerLegend().trim());
> ResourceReference ref = new UrlResourceReference(imgUrl);
> ImagePanel i = new ImagePanel(componentId, ref);
> i.setMarkupId(rowModel.getObject().getLegendDescription());
> cellItem.add(i);
> }
> });
>
> return cols;
> }
>
> /* (non-Javadoc)
>  * @see
> org.apache.wicket.Component#renderHead(org.apache.wicket.markup.head.IHeaderResponse)
>  */
> @Override
> public void renderHead(IHeaderResponse response)
> {
> super.renderHead(response);
> response.render(JavaScriptHeaderItem.forScript("function
> toggleLegend(event){\n\t" +
> "var visible = event.object.visibility;\n" +
> "\tvar divObject = '#' +
> event.object.params.BUSINESSNAME;\n" +
> "\tif (visible) \n" +
> "\t\t$(divObject).show();\n" +
> "\telse\n" +
> "\t\t$(divObject).hide();\n" +
> "}", "layerlegend"));
> }
>
> /* (non-Javadoc)
>  * @see
> no.telespor.web.page.map.openlayers.MapPanel#updateComponents(org.apache.wicket.ajax.AjaxRequestTarget)
>  */
> @Override
> public void updateComponents(AjaxRequestTarget target)
> {
> //empty on purpose
> }
> }
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Link

2013-11-11 Thread Christoph.Manig
Hello,

there are 4 links at the top of my page.

Every link should forward to another page. But the User couldn't see on which 
page he is. I want to change the color of the links depending on the page which 
the user has chosen. How can I realize this? I implemented the links like this:

Link faultLink = new Link("faultLink") {
@Override
public void onClick() {
setResponsePage(Fault.class);
}
};

Christoph



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

Table row visibility

2013-11-11 Thread Tron Walseth
Hi, 

I have a table with legends explaining map (OpenLayers) layers. 
I want to turn visibility on/off on the entire row based on the visibility of 
these map layers using JS. 

I can easily turn on/off the visibility of the legend image itself using 
JavaScript/JQuery, but I want to toggle visibility of the entire row. I know 
this can be done through ajax, but I don't want to put extra unnecessary load 
on the server through Ajax calls. 

The easiest way to do this (AFAIK) is adding an id to the table row, and 
toggling visibility through JQuery: 

$("#tableRowId").show()/hide();

Below is the entire code of my LegendPanel pasted. 

Yours, 
Tron Walseth

public class LegendPanel extends MapPanel
{
private static final long serialVersionUID = 1L;
/**
 * @param id
 */
public LegendPanel(String id, List layers, 
BusinessDataAjaxMap map)
{
super(id, map);
ListDataProvider dp = new ListDataProvider<>(layers);
DefaultDataTable table = new 
DefaultDataTable<>("legends", getTableColumns(), dp, 10);
add(table);

}

private static List> getTableColumns()
{
List> cols = new ArrayList<>();
cols.add(new HeaderlessColumn() {

private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item> 
cellItem, String componentId, IModel rowModel)
{
cellItem.add(new Label(componentId, 
rowModel.getObject().getLegendDescription()));
}});
cols.add(new HeaderlessColumn() {
private static final long serialVersionUID = 1L;

@Override
public void populateItem(Item> 
cellItem, String componentId, IModel rowModel)
{
Url imgUrl = 
Url.parse(rowModel.getObject().getLayerLegend().trim());
ResourceReference ref = new UrlResourceReference(imgUrl);
ImagePanel i = new ImagePanel(componentId, ref);
i.setMarkupId(rowModel.getObject().getLegendDescription());
cellItem.add(i);
}
});

return cols;
}

/* (non-Javadoc)
 * @see 
org.apache.wicket.Component#renderHead(org.apache.wicket.markup.head.IHeaderResponse)
 */
@Override
public void renderHead(IHeaderResponse response)
{
super.renderHead(response);
response.render(JavaScriptHeaderItem.forScript("function 
toggleLegend(event){\n\t" +
"var visible = event.object.visibility;\n" +
"\tvar divObject = '#' + 
event.object.params.BUSINESSNAME;\n" +
"\tif (visible) \n" +
"\t\t$(divObject).show();\n" +
"\telse\n" +
"\t\t$(divObject).hide();\n" +
"}", "layerlegend"));
}

/* (non-Javadoc)
 * @see 
no.telespor.web.page.map.openlayers.MapPanel#updateComponents(org.apache.wicket.ajax.AjaxRequestTarget)
 */
@Override
public void updateComponents(AjaxRequestTarget target)
{
//empty on purpose
}
}

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



Re: Efficient pagination with MongoDB and Wicket

2013-11-11 Thread Martin Grigorov
Hi,

You can create MongoDataProvider that will implement #iterator(start,
count) but will ignore the passed parameters.
You will need additionally to create your own PagingNavigator with custom
links which when clicked would do something like:
mongoDataProvider.setFirst(someObjectId) and
mongoDataProvider.setRange(whatEverIsNeeded). Then #iterator() and #size()
will use the start ObjectId and the Range to do whatever is needed.

I see that you will need to provide custom impls of several Wicket
interfaces/classes to make them more optimal for Mongo. You can donate them
as WicketSuff project [1] so other people can reuse and optimize them.

1. https://github.com/wicketstuff/core



On Sat, Nov 9, 2013 at 4:21 PM, Till Klocke  wrote:

> Hi!
>
> I'm trying to get an efficient pagination with MongoDB and Wicket working.
> The problem with MongoDB is, that the skip operation can become really
> expensive on large datasets (basically every time you really need
> pagination). So the best practice for pagination in MongoDB is to make
> range queries. So you build your query and limit it to i.e. 50 documents,
> if you need the next 50 you make the same query, but specify that you are
> only interested in objects where the objectId is higher than in the last
> item of the last query and so on.
> The Wicket IDataProvider unfortunately only gives you the primitive long to
> work with, which is insufficient for this case.
> Another problem with MongoDB is, that even "count" can become quite
> expensive. So I would like to avoid to give the total amount of available
> items from the beginning.
> Currently I  have a "google like" pagination in mind where the
> PagingNavigator only shows 10 or so page links and as the user goes through
> the pages it dynamically adds more page links to the end and removes the
> first links at the beginning.
> But unfortunately I'm kinda stuck. I tried to create some kind of
> IRangeDataProvider where I is a datatype for the range based query and
> replaces the long for skipping. But now I have to carry this through
> everything like DataView, DataBaseView and all the interfaces. Thats not
> nice, since it could also be needed to dynamically alter the type of the
> "range item" for example if you change the sorting. Apart from that I tink
> I ran into many more problems so that I am as far away from a working
> protype as I can be.
> So I am asking here for help. Probably some of the more experienced Wicket
> developers (more experienced than me) already build something like that or
> even published a small library project for this use case.
>
> Thanks in advance
>
> Regards,
>
> Till
>


Re: Handler after jqXhR success et before ajax response proccess

2013-11-11 Thread Martin Grigorov
Hi,


On Sat, Nov 9, 2013 at 12:16 AM, Olivier Dutrieux <
olivier.dutri...@pasteur.fr> wrote:

> Is there a aim to execute processAjaxResponse (javascript method to handled
> the ajax response by wicket-ajax.js) in IAjaxCallListener's success handler
> if I set wr ajaxAttribute to false ?
>

Yes, this should work.
Set 'wr' to false then create a new instance of Wicket.Ajax and call
processAjaxResponse() on it with all the required parameters.

Another option is to set some custom attribute to the div in beforeSend().
Then in success() you can check whether this custom attribute is still
there and decide what to do depending on this information.


> Duto
>
>
>
>
>
> -
> Duto
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Handler-after-jqXhR-success-et-before-ajax-response-proccess-tp4662239p4662245.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 localization in stateful pages

2013-11-11 Thread Martin Grigorov
Hi,

As Sven explained "2. new Label("contentNoModel",
resolveLocalizedContent());" doesn't use dynamic model (a model that will
re-calculate its object/value on each request). It initializes the value of
the label at construction time and from there on this value doesn't change.
See
https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels


On Mon, Nov 11, 2013 at 10:01 AM, Sven Meier  wrote:

> The back-button brings you back to the previous state of the component
> tree.
>
> If your page is depending on external state (e.g. session or database
> content) for rendering, it will of course show the most recent data
> wherever you have told it so (by using a model).
>
> Regards
> Sven
>
>
> On 11/10/2013 05:44 PM, meduolis wrote:
>
>> Exactly, I am really confused now. As I understand from your answer -
>> this is
>> expected behavior.
>> I thought that back action should behave exactly the same when you
>> navigating the site using wicket controls.
>> Should I override "back" action somehow and do it myself?
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.
>> n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-
>> tp4662260p4662262.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Release Cycle for wicket-socket

2013-11-11 Thread Martin Grigorov
Hi,


On Sun, Nov 10, 2013 at 4:31 AM, Jan Moxter  wrote:

> Hi Martin,
>
> - thank you for pointing me to the version 0.14 I will check out if the
> problem still exists.
>
> - We do use Jetty 9.0.x so the version seems to be appropriate, but thanks
> for explaining the differences
>
>
> By the way for something being "experimental" Wicket Native WebSocket
> runs really good and stable in our internal production application. We did
> not use it yet in a client product but we are getting near to releasing our
> first installation (for a client) that has it implemented as well.
>

Thanks for your feedback!

https://cwiki.apache.org/confluence/display/WICKET/Wicket+7.0+Roadmap#Wicket7.0Roadmap-Votewhichexperimentalmodulesshouldbecomestable
-
we will vote which experimental modules to become non-experimental for
Wicket 7.0.0.
I guess we will do the vote in dev@ mailing list. Probably we should create
tickets so users who are not subscribed to dev@ can give their opinion too.


>
>
> Thanks
>
> Jan Moxter
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Release-Cycle-for-wicket-socket-tp4662236p4662258.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 localization in stateful pages

2013-11-11 Thread Sven Meier

The back-button brings you back to the previous state of the component tree.

If your page is depending on external state (e.g. session or database 
content) for rendering, it will of course show the most recent data 
wherever you have told it so (by using a model).


Regards
Sven

On 11/10/2013 05:44 PM, meduolis wrote:

Exactly, I am really confused now. As I understand from your answer - this is
expected behavior.
I thought that back action should behave exactly the same when you
navigating the site using wicket controls.
Should I override "back" action somehow and do it myself?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Back-button-issue-when-localizing-in-stateful-pages-tp4662260p4662262.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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