Re: EqualInputValidator for PasswortTextfield

2014-04-01 Thread Daniela L
Hi Alasdair,
thanks a lot for your quick response. I  changed the EqualInputValidator
key to the same text as EqualPasswordInputValidator:
EqualInputValidator =${label0} und ${label1} m\u00fcssen gleich sein.
I propose to change the default text in the wicket
Application_de.properties file in the same way or change the word Label
to Feld because outside the IT world the word Label is not really known
in germany.
Best regards,
Daniela


2014-03-31 12:42 GMT+02:00 Collinson, Alasdair 
alasdair.collin...@senacor.com:

 Hi!

 In such a case the error with the key EqualInputValidator is used; the
 Application_de.properties-file defines the message you see. You could
 override that in your local properties file. However you probably want to
 use the EqualPasswordInputValidator anyway which is a specialisation of the
 EqualInputValidator which should produce the output you want. Here you
 could of course override the value as well if you like.

 Best regards,
 Alasdair

 -Ursprüngliche Nachricht-
 Von: Daniela L [mailto:danigal...@gmail.com]
 Gesendet: Montag, 31. März 2014 12:24
 An: users@wicket.apache.org
 Betreff: EqualInputValidator for PasswortTextfield

 Hi,
 I have two PasswordTextfields with a EqualInputValidator using wicket
 6.12.0 the 2 fields have Labels with localized Names. When the user leaves
 one PasswordTextfield empty the feedback message presented is containing
 the word Label like this:
 '' vom Label E-Mail und 'testemailaddr...@test.com' vom Label E-Mail
 Adresse wiederholen müssen gleich sein.
 How can I avoid the word Label in the feedback message?
 Best regards
 Daniela

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




Re: Close Browser Behavior

2014-03-17 Thread Daniela L
Hi,
I have solved the problem, overriding valueUnbound in my custom session and
updating the database
with my @SpringBeans works when the session is expiring. My problem was
that I was using data
from my session in the @Repository Dao impl class like this:
MyCustomSession.get() and that issued the There is no application attached
to current thread ContainerBackgroundProcessor exception.
Many thanks for the help.
Best regards
Daniela


2014-03-14 14:51 GMT+01:00 Daniela L danigal...@gmail.com:

 Hi Martin,
 it is definitely a problem in my code :-))
 But unfortunately I do not understand how to update the database at that
 stage using
 @SpringBean? Is that impossible? Do I have to do this outside Wicket using
 a HttpSessionListener?
 I also tryid to make my custom session implement
 HttpSessionBindingListener and override valueUnbound
 but that makes no difference. Is there a example for this anywhere, that
 seems to be such a common use case?
 Best Regards
 Daniela


 2014-03-13 15:40 GMT+01:00 Martin Grigorov mgrigo...@apache.org:

 Hi,

 Maybe it is a problem in your code ;-)

  pIn case of session expiration this method is called in a non-worker
 thread, i.e.
  * there are no thread locals exported for the Application, RequestCycle
 and Session.
  * The Session is the current instance. The Application can be found by
 using
  * {@link Application#get(String)}. There is no way to get a reference to
 a
 RequestCycle/p
  */
 public void onInvalidate()
 {
 }

 The javadoc clearly says that when this method is called by the web
 container due to session expiration there are no thread locals.
 The thread locals are available in #onInvalidate() only if the application
 code called Session#invalidate[Now]() explicitly.

 Martin Grigorov
 Wicket Training and Consulting


 On Thu, Mar 13, 2014 at 4:34 PM, Daniela L danigal...@gmail.com wrote:

  Hi Martin,
  if found the reason why the data is not freed in onInvalidate,
  the Spring/Hibernate update to the database issues a There is no
  application attached to current thread
  ContainerBackgroundProcessor[StandardEngine[Catalina]]. Is this a
 wicket
  or a tomcat issue?
  Best Regards
  Daniela
 
 
  2014-03-12 14:31 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
 
   On Wed, Mar 12, 2014 at 3:20 PM, Daniela L danigal...@gmail.com
 wrote:
  
Hi Martin,
thank you very much for your quick and brilliant answer :-)
Changing to AjaxCheckBox did the trick.
It seems to be very difficult to provide a secure way to invalidate
  user
data
cross browser compliant. I noticed that using a tablet with android
 or
   IOS
the
beforeunload is not triggered at all. Therefor I added a cleanup
 method
   to
the onInvalidate
of my custom session which should be triggered by the tomcats
session-timeout, but
it seems using mobile devices onInvalidate is not triggered?
   
  
   onInvalidate() is called by the server when the client hasn't
  touched/used
   its http session for session-timeout minutes.
   It shouldn't matter whether it is a desktop or mobile client.
  
  
Best Regards
Daniela
   
   
2014-03-12 13:21 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
   
 Hi,

 On Wed, Mar 12, 2014 at 1:15 PM, Daniela L danigal...@gmail.com
   wrote:

  Hi,
  I am using a close browser behavior to clean up user data if the
  user
  closes
  the browser window. I also use a CheckBox to toggle the
 visibility
  of
 some
  Textfields. Unfortunately the refresh through the click of the
   CheckBox
  triggers the close browser
  behavior. How can this be avoided?
  Here is what I did (with wicket 6.12.0):
 
 
  customerFirstName = new
RequiredTextFieldString(customer.firstName);
  customerFirstName.setOutputMarkupPlaceholderTag(true);
  closeBrowserBehavior =  new AbstractDefaultAjaxBehavior() {
 @Override
  protected void respond(AjaxRequestTarget target) {
 
  AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }
 
  @Override
  public void renderHead(Component component,
   IHeaderResponse
  response) {
  super.renderHead(component, response);
  response.render(new
 
  OnDomReadyHeaderItem(window.onbeforeunload =
  function (e) {
  + if (!window.dontAsk) {
  + Wicket.Ajax.get({u:
  '+getCallbackUrl()+', async: false});
  + var message = 'my message.',
  + e = e || window.event; + if
  (e)
   {
  + e.returnValue = message; +
  }} +
  return message;
  +
  };));
  }
  };
  customerFirstName.add

Re: Close Browser Behavior

2014-03-14 Thread Daniela L
Hi Martin,
it is definitely a problem in my code :-))
But unfortunately I do not understand how to update the database at that
stage using
@SpringBean? Is that impossible? Do I have to do this outside Wicket using
a HttpSessionListener?
I also tryid to make my custom session implement HttpSessionBindingListener
and override valueUnbound
but that makes no difference. Is there a example for this anywhere, that
seems to be such a common use case?
Best Regards
Daniela


2014-03-13 15:40 GMT+01:00 Martin Grigorov mgrigo...@apache.org:

 Hi,

 Maybe it is a problem in your code ;-)

  pIn case of session expiration this method is called in a non-worker
 thread, i.e.
  * there are no thread locals exported for the Application, RequestCycle
 and Session.
  * The Session is the current instance. The Application can be found by
 using
  * {@link Application#get(String)}. There is no way to get a reference to a
 RequestCycle/p
  */
 public void onInvalidate()
 {
 }

 The javadoc clearly says that when this method is called by the web
 container due to session expiration there are no thread locals.
 The thread locals are available in #onInvalidate() only if the application
 code called Session#invalidate[Now]() explicitly.

 Martin Grigorov
 Wicket Training and Consulting


 On Thu, Mar 13, 2014 at 4:34 PM, Daniela L danigal...@gmail.com wrote:

  Hi Martin,
  if found the reason why the data is not freed in onInvalidate,
  the Spring/Hibernate update to the database issues a There is no
  application attached to current thread
  ContainerBackgroundProcessor[StandardEngine[Catalina]]. Is this a wicket
  or a tomcat issue?
  Best Regards
  Daniela
 
 
  2014-03-12 14:31 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
 
   On Wed, Mar 12, 2014 at 3:20 PM, Daniela L danigal...@gmail.com
 wrote:
  
Hi Martin,
thank you very much for your quick and brilliant answer :-)
Changing to AjaxCheckBox did the trick.
It seems to be very difficult to provide a secure way to invalidate
  user
data
cross browser compliant. I noticed that using a tablet with android
 or
   IOS
the
beforeunload is not triggered at all. Therefor I added a cleanup
 method
   to
the onInvalidate
of my custom session which should be triggered by the tomcats
session-timeout, but
it seems using mobile devices onInvalidate is not triggered?
   
  
   onInvalidate() is called by the server when the client hasn't
  touched/used
   its http session for session-timeout minutes.
   It shouldn't matter whether it is a desktop or mobile client.
  
  
Best Regards
Daniela
   
   
2014-03-12 13:21 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
   
 Hi,

 On Wed, Mar 12, 2014 at 1:15 PM, Daniela L danigal...@gmail.com
   wrote:

  Hi,
  I am using a close browser behavior to clean up user data if the
  user
  closes
  the browser window. I also use a CheckBox to toggle the
 visibility
  of
 some
  Textfields. Unfortunately the refresh through the click of the
   CheckBox
  triggers the close browser
  behavior. How can this be avoided?
  Here is what I did (with wicket 6.12.0):
 
 
  customerFirstName = new
RequiredTextFieldString(customer.firstName);
  customerFirstName.setOutputMarkupPlaceholderTag(true);
  closeBrowserBehavior =  new AbstractDefaultAjaxBehavior() {
 @Override
  protected void respond(AjaxRequestTarget target) {
 
  AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }
 
  @Override
  public void renderHead(Component component,
   IHeaderResponse
  response) {
  super.renderHead(component, response);
  response.render(new
 
  OnDomReadyHeaderItem(window.onbeforeunload =
  function (e) {
  + if (!window.dontAsk) {
  + Wicket.Ajax.get({u:
  '+getCallbackUrl()+', async: false});
  + var message = 'my message.',
  + e = e || window.event; + if
  (e)
   {
  + e.returnValue = message; +
  }} +
  return message;
  +
  };));
  }
  };
  customerFirstName.add(closeBrowserBehavior);
  form.add(customerFirstName);
 
  createAccountCB = new CheckBox(createAccountCB, new
  ModelBoolean(createAccount)){
  @Override
  protected void onSelectionChanged(Boolean
  newSelection) {
  super.onSelectionChanged(newSelection);
  createAccount = !createAccount;
  }
 
  @Override
  protected boolean
 wantOnSelectionChangedNotifications

Re: Close Browser Behavior

2014-03-13 Thread Daniela L
Hi Martin,
if found the reason why the data is not freed in onInvalidate,
the Spring/Hibernate update to the database issues a There is no
application attached to current thread
ContainerBackgroundProcessor[StandardEngine[Catalina]]. Is this a wicket
or a tomcat issue?
Best Regards
Daniela


2014-03-12 14:31 GMT+01:00 Martin Grigorov mgrigo...@apache.org:

 On Wed, Mar 12, 2014 at 3:20 PM, Daniela L danigal...@gmail.com wrote:

  Hi Martin,
  thank you very much for your quick and brilliant answer :-)
  Changing to AjaxCheckBox did the trick.
  It seems to be very difficult to provide a secure way to invalidate user
  data
  cross browser compliant. I noticed that using a tablet with android or
 IOS
  the
  beforeunload is not triggered at all. Therefor I added a cleanup method
 to
  the onInvalidate
  of my custom session which should be triggered by the tomcats
  session-timeout, but
  it seems using mobile devices onInvalidate is not triggered?
 

 onInvalidate() is called by the server when the client hasn't touched/used
 its http session for session-timeout minutes.
 It shouldn't matter whether it is a desktop or mobile client.


  Best Regards
  Daniela
 
 
  2014-03-12 13:21 GMT+01:00 Martin Grigorov mgrigo...@apache.org:
 
   Hi,
  
   On Wed, Mar 12, 2014 at 1:15 PM, Daniela L danigal...@gmail.com
 wrote:
  
Hi,
I am using a close browser behavior to clean up user data if the user
closes
the browser window. I also use a CheckBox to toggle the visibility of
   some
Textfields. Unfortunately the refresh through the click of the
 CheckBox
triggers the close browser
behavior. How can this be avoided?
Here is what I did (with wicket 6.12.0):
   
   
customerFirstName = new
  RequiredTextFieldString(customer.firstName);
customerFirstName.setOutputMarkupPlaceholderTag(true);
closeBrowserBehavior =  new AbstractDefaultAjaxBehavior() {
   @Override
protected void respond(AjaxRequestTarget target) {
   
AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
}
   
@Override
public void renderHead(Component component,
 IHeaderResponse
response) {
super.renderHead(component, response);
response.render(new
OnDomReadyHeaderItem(window.onbeforeunload =
function (e) {
+ if (!window.dontAsk) {
+ Wicket.Ajax.get({u:
'+getCallbackUrl()+', async: false});
+ var message = 'my message.',
+ e = e || window.event; + if (e)
 {
+ e.returnValue = message; + }} +
return message;
+
};));
}
};
customerFirstName.add(closeBrowserBehavior);
form.add(customerFirstName);
   
createAccountCB = new CheckBox(createAccountCB, new
ModelBoolean(createAccount)){
@Override
protected void onSelectionChanged(Boolean newSelection) {
super.onSelectionChanged(newSelection);
createAccount = !createAccount;
}
   
@Override
protected boolean wantOnSelectionChangedNotifications()
{
return true;
   
  
   This uses non-Ajax way to submit the new selection.
   As you noted this leads to 'beforeunload' event being fired.
  
   You will have to use AjaxCheckBox or AjaxFormComponentUpdatingBehavior
 to
   avoid the page reload.
  
  
}
};
form.add(createAccountCB);
   
emailRepeat = new TextFieldString(emailRepeat, new
PropertyModelString(appointCalendar, customer.eMailAdress)){
  @Override
protected void onConfigure(){
super.onConfigure();
setVisibilityAllowed(createAccount);
}
}
};
emailRepeat.setOutputMarkupPlaceholderTag(true);
form.add(emailRepeat):
   
Thanks a lot in advance!
Best Regards
Daniela
   
  
 



Close Browser Behavior

2014-03-12 Thread Daniela L
Hi,
I am using a close browser behavior to clean up user data if the user closes
the browser window. I also use a CheckBox to toggle the visibility of some
Textfields. Unfortunately the refresh through the click of the CheckBox
triggers the close browser
behavior. How can this be avoided?
Here is what I did (with wicket 6.12.0):


customerFirstName = new RequiredTextFieldString(customer.firstName);
customerFirstName.setOutputMarkupPlaceholderTag(true);
closeBrowserBehavior =  new AbstractDefaultAjaxBehavior() {
   @Override
protected void respond(AjaxRequestTarget target) {

AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
}

@Override
public void renderHead(Component component, IHeaderResponse
response) {
super.renderHead(component, response);
response.render(new
OnDomReadyHeaderItem(window.onbeforeunload =
function (e) {
+ if (!window.dontAsk) {
+ Wicket.Ajax.get({u:
'+getCallbackUrl()+', async: false});
+ var message = 'my message.',
+ e = e || window.event; + if (e) {
+ e.returnValue = message; + }} +
return message;
+
};));
}
};
customerFirstName.add(closeBrowserBehavior);
form.add(customerFirstName);

createAccountCB = new CheckBox(createAccountCB, new
ModelBoolean(createAccount)){
@Override
protected void onSelectionChanged(Boolean newSelection) {
super.onSelectionChanged(newSelection);
createAccount = !createAccount;
}

@Override
protected boolean wantOnSelectionChangedNotifications()
{
return true;
}
};
form.add(createAccountCB);

emailRepeat = new TextFieldString(emailRepeat, new
PropertyModelString(appointCalendar, customer.eMailAdress)){
  @Override
protected void onConfigure(){
super.onConfigure();
setVisibilityAllowed(createAccount);
}
}
};
emailRepeat.setOutputMarkupPlaceholderTag(true);
form.add(emailRepeat):

Thanks a lot in advance!
Best Regards
Daniela


Re: Close Browser Behavior

2014-03-12 Thread Daniela L
Hi Martin,
thank you very much for your quick and brilliant answer :-)
Changing to AjaxCheckBox did the trick.
It seems to be very difficult to provide a secure way to invalidate user
data
cross browser compliant. I noticed that using a tablet with android or IOS
the
beforeunload is not triggered at all. Therefor I added a cleanup method to
the onInvalidate
of my custom session which should be triggered by the tomcats
session-timeout, but
it seems using mobile devices onInvalidate is not triggered?
Best Regards
Daniela


2014-03-12 13:21 GMT+01:00 Martin Grigorov mgrigo...@apache.org:

 Hi,

 On Wed, Mar 12, 2014 at 1:15 PM, Daniela L danigal...@gmail.com wrote:

  Hi,
  I am using a close browser behavior to clean up user data if the user
  closes
  the browser window. I also use a CheckBox to toggle the visibility of
 some
  Textfields. Unfortunately the refresh through the click of the CheckBox
  triggers the close browser
  behavior. How can this be avoided?
  Here is what I did (with wicket 6.12.0):
 
 
  customerFirstName = new RequiredTextFieldString(customer.firstName);
  customerFirstName.setOutputMarkupPlaceholderTag(true);
  closeBrowserBehavior =  new AbstractDefaultAjaxBehavior() {
 @Override
  protected void respond(AjaxRequestTarget target) {
 
  AppointmentSession.get().releaseSavedBlockedFreeCalendarEvent();
  }
 
  @Override
  public void renderHead(Component component, IHeaderResponse
  response) {
  super.renderHead(component, response);
  response.render(new
  OnDomReadyHeaderItem(window.onbeforeunload =
  function (e) {
  + if (!window.dontAsk) {
  + Wicket.Ajax.get({u:
  '+getCallbackUrl()+', async: false});
  + var message = 'my message.',
  + e = e || window.event; + if (e) {
  + e.returnValue = message; + }} +
  return message;
  +
  };));
  }
  };
  customerFirstName.add(closeBrowserBehavior);
  form.add(customerFirstName);
 
  createAccountCB = new CheckBox(createAccountCB, new
  ModelBoolean(createAccount)){
  @Override
  protected void onSelectionChanged(Boolean newSelection) {
  super.onSelectionChanged(newSelection);
  createAccount = !createAccount;
  }
 
  @Override
  protected boolean wantOnSelectionChangedNotifications()
  {
  return true;
 

 This uses non-Ajax way to submit the new selection.
 As you noted this leads to 'beforeunload' event being fired.

 You will have to use AjaxCheckBox or AjaxFormComponentUpdatingBehavior to
 avoid the page reload.


  }
  };
  form.add(createAccountCB);
 
  emailRepeat = new TextFieldString(emailRepeat, new
  PropertyModelString(appointCalendar, customer.eMailAdress)){
@Override
  protected void onConfigure(){
  super.onConfigure();
  setVisibilityAllowed(createAccount);
  }
  }
  };
  emailRepeat.setOutputMarkupPlaceholderTag(true);
  form.add(emailRepeat):
 
  Thanks a lot in advance!
  Best Regards
  Daniela
 



Re: Feedback Messages prevent DropDownChoice updating Textfields

2014-02-12 Thread Daniela L
Hi,
sometimes one doesn't see the obvious things,
I simply had to add a lastName.clearInput(); in the
onUpdate method and everything works as expected.
I hope that helps anybody having the same problem :-)
Best Regards
Daniela


Hi,
I am trying to implement a Feedback for every Form Component and
a catch all Feedback Panel in wicket 6.12.0. Everything works fine except
for the case
when a user causes a error which is shown in the Feedback Panel of the
Component,
e.g. the Textfield firstName is left empty. After that the select of the
DropDownChoice
does not update the Textfields anymore. Where is my mistake? Thanks a lot
in advance.
Daniela

Here is my code:

public class EditEmployeePage extends BasePage {
private FormComponentString firstName;
private DropDownChoiceEmployee employeeDDC;
private final FormEmployee employeListForm;
private ModelEmployee employeeModel;
private Employee employee;
@SpringBean(name=employeeService)
private EmployeeService employeeService;
private Button saveEmployeeButton;
private Button resetButton;

public EditEmployeePage(final PageParameters parameters) {
super();
employee = new Employee();
employeeModel = new ModelEmployee(employee);//for dropDownChoice
final CompoundPropertyModelEmployee employeeCpm = new
CompoundPropertyModelEmployee(employeeModel); //for form
employeListForm = new FormEmployee(employeListForm,
employeeCpm);
employeListForm.setOutputMarkupId(true);
add(employeListForm);
addEmployeeDropDown();
addFirstNameTextField();
//more fields
 }

private void addEmployeeDropDown() {
Label chooseEmployeeLabel = new Label(chooseEmployeeLabel,
Mitarbeiter wählen:*);
employeListForm.add(chooseEmployeeLabel);

// Employee DropdownChoice
LoadableDetachableModelListEmployee employeeValueChoices = new
LoadableDetachableModelListEmployee() {
private static final long serialVersionUID = 1L;

protected ListEmployee load() {
ListEmployee employees = Collections.emptyList();
employees = employeeService.findallEmployees(getCompany());
if (!employees.isEmpty()){
employeeModel.setObject(employees.get(0));
}
return employees;
}

};

employeeDDC = new DropDownChoiceEmployee(employee,
employeeModel,
employeeValueChoices.getObject(),
new TwoPropertiesChoiceRendererEmployee(employeeId,
lastName, firstName, ,));
employeeDDC.setLabel(new ModelString(Mitarbeiter
wählen));
employeeDDC.add(new
AjaxFormComponentUpdatingBehavior(onchange) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
   target.add(employeListForm);
}
  });

employeeDDC.setRequired(true);
employeListForm.add(employeeDDC);
}

private void addFirstNameTextField() {
// first name label and field on page
Label firstNameLabel = new Label(firstNameLabel, Vorname:*);
employeListForm.add(firstNameLabel);
firstName = new TextFieldString(firstName);
firstName.setLabel(new ModelString(Vorname));
firstName.setOutputMarkupPlaceholderTag(true);
FeedbackPanel firstNameFeedback =  (FeedbackPanel) new
FeedbackPanel(firstNameFeedback, firstName).setOutputMarkupId(true);
employeListForm.add(firstNameFeedback);
employeListForm.add(firstName);
firstName.setRequired(true);
}
...
}

public abstract class BasePage extends WebPage {
   private final FeedbackPanel pageFeedback = new
FeedbackPanel(feedback);
   public BasePage() {
  super();
  pageFeedback.setOutputMarkupId(true);
  add(pageFeedback);
   }


Fwd: Feedback Messages prevent DropDownChoice updating Textfields

2014-02-11 Thread Daniela L
Hi,
I am trying to implement a Feedback for every Form Component and
a catch all Feedback Panel in wicket 6.12.0. Everything works fine except
for the case
when a user causes a error which is shown in the Feedback Panel of the
Component,
e.g. the Textfield firstName is left empty. After that the select of the
DropDownChoice
does not update the Textfields anymore. Where is my mistake? Thanks a lot
in advance.
Daniela

Here is my code:

public class EditEmployeePage extends BasePage {
private FormComponentString firstName;
private DropDownChoiceEmployee employeeDDC;
private final FormEmployee employeListForm;
private ModelEmployee employeeModel;
private Employee employee;
@SpringBean(name=employeeService)
private EmployeeService employeeService;
private Button saveEmployeeButton;
private Button resetButton;

public EditEmployeePage(final PageParameters parameters) {
super();
employee = new Employee();
employeeModel = new ModelEmployee(employee);//for dropDownChoice
final CompoundPropertyModelEmployee employeeCpm = new
CompoundPropertyModelEmployee(employeeModel); //for form
employeListForm = new FormEmployee(employeListForm,
employeeCpm);
employeListForm.setOutputMarkupId(true);
add(employeListForm);
addEmployeeDropDown();
addFirstNameTextField();
//more fields
 }

private void addEmployeeDropDown() {
Label chooseEmployeeLabel = new Label(chooseEmployeeLabel,
Mitarbeiter wählen:*);
employeListForm.add(chooseEmployeeLabel);

// Employee DropdownChoice
LoadableDetachableModelListEmployee employeeValueChoices = new
LoadableDetachableModelListEmployee() {
private static final long serialVersionUID = 1L;

protected ListEmployee load() {
ListEmployee employees = Collections.emptyList();
employees = employeeService.findallEmployees(getCompany());
if (!employees.isEmpty()){
employeeModel.setObject(employees.get(0));
}
return employees;
}

};

employeeDDC = new DropDownChoiceEmployee(employee,
employeeModel,
employeeValueChoices.getObject(),
new TwoPropertiesChoiceRendererEmployee(employeeId,
lastName, firstName, ,));
employeeDDC.setLabel(new ModelString(Mitarbeiter
wählen));
employeeDDC.add(new
AjaxFormComponentUpdatingBehavior(onchange) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
   target.add(employeListForm);
}
  });

employeeDDC.setRequired(true);
employeListForm.add(employeeDDC);
}

private void addFirstNameTextField() {
// first name label and field on page
Label firstNameLabel = new Label(firstNameLabel, Vorname:*);
employeListForm.add(firstNameLabel);
firstName = new TextFieldString(firstName);
firstName.setLabel(new ModelString(Vorname));
firstName.setOutputMarkupPlaceholderTag(true);
FeedbackPanel firstNameFeedback =  (FeedbackPanel) new
FeedbackPanel(firstNameFeedback, firstName).setOutputMarkupId(true);
employeListForm.add(firstNameFeedback);
employeListForm.add(firstName);
firstName.setRequired(true);
}
...
}

public abstract class BasePage extends WebPage {
   private final FeedbackPanel pageFeedback = new
FeedbackPanel(feedback);
   public BasePage() {
  super();
  pageFeedback.setOutputMarkupId(true);
  add(pageFeedback);
   }


Re: Get return value of ajax event in Wicket 6.9.1

2013-11-14 Thread Daniela L
Hi,
now everything works perfect,
thank you I am so happy.
Best Regards
Daniela


2013/11/14 Martin Grigorov mgrigo...@apache.org

 Hi,

 mySubmitButton.add(AttributeAppender.append(onclick, window.dontAsk =
 true; return true;))

 response.render(new
 OnDomReadyHeaderItem(window.onbeforeunload = function (e) {
   + if (!window.dontAsk) { +
   + var message = 'Your confirmation message goes
 here.',
   + e = e || window.event; + if (e) {
   + e.returnValue = message; + } + return
 message;
+ }
 + };));


 On Wed, Nov 13, 2013 at 4:12 PM, Daniela L danigal...@gmail.com wrote:

  Hi,
  I am sorry I don't get it.
  How and when to set the JS variable?
  Like this:
  mySubmitButton.add(new AjaxEventBehavior(onclick) {
  @Override
  protected void onEvent(AjaxRequestTarget target) {
  AjaxRequestAttributes ajaxRequestAttributes = new
  AjaxRequestAttributes();
  CharSequence dynamicExtraParameters = var enableEvent =
  false;;
 
 
 
 
 ajaxRequestAttributes.getDynamicExtraParameters().add(dynamicExtraParameters)
 
  pageExitWarningBehavior.updateAjaxAttributes(ajaxRequestAttributes);
  }
  });
 
  And which onBeforeRender, the one of the TextField?
  Best Regards
  Daniela
 
 
  2013/11/13 Martin Grigorov mgrigo...@apache.org
 
   Hi,
  
   #onSubmit() would be called after the user agrees to leave the page.
  
   You can set some JS variable/flag when the submit button is used and
   depending on this flag do not ask for confirmation in onbeforerender.
  
  
   On Wed, Nov 13, 2013 at 10:02 AM, Daniela L danigal...@gmail.com
  wrote:
  
Hi,
I have another problem regarding this question.
Now every time the page is left the message  Do you want to leave
 the
page is popping up,
but when the user correctly fills the form on the page and hits the
   submit
button
he should be redirected to another page showing the result of his
  input.
I have tryed this to remove the behavior for a correct submit but the
message is still popping up:
   
mySubmitButton = new Button(mySubmitButton ) {
   
@Override
public void onSubmit() {
try {
myTextField.remove(pageExitWarningBehavior);
//tryed both
//pageExitWarningBehavior.detach(myTextField);
   }
};
   
   
2013/11/12 Daniela L danigal...@gmail.com
   
 Hi,
 thank you so much for your help this works fantastic.
 I am so happy I was trying around with this for days :-)


 2013/11/11 Martin Grigorov mgrigo...@apache.org

 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 danigal...@gmail.com
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 mgrigo...@apache.org
 
   Did you do what I suggested you ?
  
  
   On Mon, Nov 11, 2013 at 3:49 PM, Daniela L 
  danigal...@gmail.com
 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
danigal...@gmail.comdanigal...@gmail.com 
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

Re: Get return value of ajax event in Wicket 6.9.1

2013-11-13 Thread Daniela L
Hi,
I have another problem regarding this question.
Now every time the page is left the message  Do you want to leave the
page is popping up,
but when the user correctly fills the form on the page and hits the submit
button
he should be redirected to another page showing the result of his input.
I have tryed this to remove the behavior for a correct submit but the
message is still popping up:

mySubmitButton = new Button(mySubmitButton ) {

@Override
public void onSubmit() {
try {
myTextField.remove(pageExitWarningBehavior);
//tryed both
//pageExitWarningBehavior.detach(myTextField);
   }
};


2013/11/12 Daniela L danigal...@gmail.com

 Hi,
 thank you so much for your help this works fantastic.
 I am so happy I was trying around with this for days :-)


 2013/11/11 Martin Grigorov mgrigo...@apache.org

 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 danigal...@gmail.com 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 mgrigo...@apache.org
 
   Did you do what I suggested you ?
  
  
   On Mon, Nov 11, 2013 at 3:49 PM, Daniela L danigal...@gmail.com
 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
danigal...@gmail.comdanigal...@gmail.com 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:
   
   
 RequiredTextFieldString myTextField = new
RequiredTextFieldString(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-13 Thread Daniela L
Hi,
I am sorry I don't get it.
How and when to set the JS variable?
Like this:
mySubmitButton.add(new AjaxEventBehavior(onclick) {
@Override
protected void onEvent(AjaxRequestTarget target) {
AjaxRequestAttributes ajaxRequestAttributes = new
AjaxRequestAttributes();
CharSequence dynamicExtraParameters = var enableEvent =
false;;


ajaxRequestAttributes.getDynamicExtraParameters().add(dynamicExtraParameters)

pageExitWarningBehavior.updateAjaxAttributes(ajaxRequestAttributes);
}
});

And which onBeforeRender, the one of the TextField?
Best Regards
Daniela


2013/11/13 Martin Grigorov mgrigo...@apache.org

 Hi,

 #onSubmit() would be called after the user agrees to leave the page.

 You can set some JS variable/flag when the submit button is used and
 depending on this flag do not ask for confirmation in onbeforerender.


 On Wed, Nov 13, 2013 at 10:02 AM, Daniela L danigal...@gmail.com wrote:

  Hi,
  I have another problem regarding this question.
  Now every time the page is left the message  Do you want to leave the
  page is popping up,
  but when the user correctly fills the form on the page and hits the
 submit
  button
  he should be redirected to another page showing the result of his input.
  I have tryed this to remove the behavior for a correct submit but the
  message is still popping up:
 
  mySubmitButton = new Button(mySubmitButton ) {
 
  @Override
  public void onSubmit() {
  try {
  myTextField.remove(pageExitWarningBehavior);
  //tryed both
  //pageExitWarningBehavior.detach(myTextField);
 }
  };
 
 
  2013/11/12 Daniela L danigal...@gmail.com
 
   Hi,
   thank you so much for your help this works fantastic.
   I am so happy I was trying around with this for days :-)
  
  
   2013/11/11 Martin Grigorov mgrigo...@apache.org
  
   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 danigal...@gmail.com
  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 mgrigo...@apache.org
   
 Did you do what I suggested you ?


 On Mon, Nov 11, 2013 at 3:49 PM, Daniela L danigal...@gmail.com
   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
  danigal...@gmail.comdanigal...@gmail.com 
  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:
 
 
   RequiredTextFieldString myTextField = new
  RequiredTextFieldString(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

Re: Get return value of ajax event in Wicket 6.9.1

2013-11-12 Thread Daniela L
Hi,
thank you so much for your help this works fantastic.
I am so happy I was trying around with this for days :-)


2013/11/11 Martin Grigorov mgrigo...@apache.org

 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 danigal...@gmail.com 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 mgrigo...@apache.org
 
   Did you do what I suggested you ?
  
  
   On Mon, Nov 11, 2013 at 3:49 PM, Daniela L danigal...@gmail.com
 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
danigal...@gmail.comdanigal...@gmail.com 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:
   
   
 RequiredTextFieldString myTextField = new
RequiredTextFieldString(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:


 RequiredTextFieldString myTextField = new
RequiredTextFieldString(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 :-)


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 danigal...@gmail.com
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:


 RequiredTextFieldString myTextField = new
RequiredTextFieldString(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 danigal...@gmail.com
danigal...@gmail.comdanigal...@gmail.com 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:


 RequiredTextFieldString myTextField = new
RequiredTextFieldString(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 mgrigo...@apache.org

 Did you do what I suggested you ?


 On Mon, Nov 11, 2013 at 3:49 PM, Daniela L danigal...@gmail.com 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
  danigal...@gmail.comdanigal...@gmail.com 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:
 
 
   RequiredTextFieldString myTextField = new
  RequiredTextFieldString(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