Simulate DropDownChoice selection

2008-10-06 Thread Aleksandr Nikiforov

Hi all,

I have a couple of DropDownChoices  and I want to test their behaviour 
using WicketTester,

is it possible to somehow simulate that user has made selection in ddc?

Regards,
Aleksandr

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

2008-10-06 Thread Igor Vaynberg
if i were you i would read the exception message, it is telling you
exactly what is going wrong...if you showed some code or provided a
quickstart we can help further.

-igor

On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
[EMAIL PROTECTED] wrote:
 Anybody?

 Guys please help me with this one.



 -Original Message-
 From: Yazeed Isaacs
 Sent: 03 October 2008 03:00 PM
 To: users@wicket.apache.org
 Subject: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and 
 paging throws an IllegalStateException

 Hi

 I have an AjaxFallbackDefaultDataTable table and I am using an 
 AjaxLazyLoadPanel when rendering this table. When I click the AjaxButton the 
 table lazy loads.

 To summarize (in short) I have a AjaxButton that when clicked the onSubmit() 
 method creates the AjaxLazyLoadPanel, the AjaxLazyLoadPanel's 
 getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable table. 
 Therefore the AjaxLazyLoadPanel renders as the AjaxFallbackDefaultDataTable 
 table.

 The table lazy loads correctly, but when I click on a column in order to sort 
 it or click on the page navigation links, I get the following error:

 java.lang.IllegalStateException: Ajax render cannot be called on component 
 that has setRenderBodyOnly enabled.
 ...
 Component id = content, page = 
 za.co.transactionjunction.transpector.pages.TransactionQueryPage, path = 
 8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable

 Where transactions is the AjaxLazyLoadPanel.

 Am I missing something? Please help.

 Regards,
 Yazeed Isaacs




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

2008-10-06 Thread Yazeed Isaacs
Hi Igor

Here is the java code:

add(new AjaxButton(ajaxSubmitButton, this) {

protected void onSubmit(AjaxRequestTarget target, Form form) {

AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
transactions) {

private static final long serialVersionUID = 1L;

@Override
public Component getLazyLoadComponent(String id)
{

TransactionQuery transactionQuery = new
TransactionQuery();


transactionQuery.setCardNumber(cardNumberField
.getInput());

transactionQuery.setDateFrom(dateFromField
.getInput());

transactionQuery.setDateTo(dateToField.getInput());

transactionQuery.setStoreId(storeIdsDropDownChoice
.getInput());
transactionQuery

.setTerminalId(terminalIdsDropDownChoice

.getInput());
int transactionNumber = 0;
if (transNumberField.getInput() != null)
{
if
((transNumberField.getInput().length()  0))
transactionNumber =
Integer

.parseInt(transNumberField

.getInput());
}
transactionQuery

.setTransactionNumber(transactionNumber);



AjaxFallbackDefaultDataTable results =
new AjaxFallbackDefaultDataTable(
id,
columns,
new
SortableTransactionQueryResultsDataProvider(

transactionQuery), 10);

// transactions.setOutputMarkupId(true);

results.setRenderBodyOnly(false);

return results;
}

};

transactions.setRenderBodyOnly(false);

form.replace(transactions);

target.addComponent(transactions);
}

});



HTML code:

table cellpadding=2 cellspacing=0 width=521
wicket:id=transactions

/table


I have tried playing around with the way I've implemented this, but I
keep on getting the same exception (java.lang.IllegalStateException)
when I sort a column or navigate to a page.

Let me know what you think.

Regards,
Yazeed Isaacs



-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: 06 October 2008 09:31 AM
To: users@wicket.apache.org
Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

if i were you i would read the exception message, it is telling you
exactly what is going wrong...if you showed some code or provided a
quickstart we can help further.

-igor

On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
[EMAIL PROTECTED] wrote:
 Anybody?

 Guys please help me with this one.



 -Original Message-
 From: Yazeed Isaacs
 Sent: 03 October 2008 03:00 PM
 To: users@wicket.apache.org
 Subject: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting
and paging throws an IllegalStateException

 Hi

 I have an AjaxFallbackDefaultDataTable table and I am using an
AjaxLazyLoadPanel when rendering this table. When I click the AjaxButton
the table lazy loads.

 To summarize (in short) I have a AjaxButton that when clicked the
onSubmit() method creates the AjaxLazyLoadPanel, the AjaxLazyLoadPanel's
getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable
table. Therefore the AjaxLazyLoadPanel renders as the
AjaxFallbackDefaultDataTable table.

 The table lazy loads correctly, but when I click on a column in order
to sort it or click on the page navigation links, I get the following
error:

 java.lang.IllegalStateException: Ajax render cannot be called on
component that has setRenderBodyOnly enabled.
 ...
 Component id = content, page =
za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable

 Where transactions is the AjaxLazyLoadPanel.

 Am I missing something? Please help.

 Regards,
 Yazeed Isaacs




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

2008-10-06 Thread Igor Vaynberg
read the message!

remove setRenderBodyOnly(false);

-igor

On Mon, Oct 6, 2008 at 12:41 AM, Yazeed Isaacs
[EMAIL PROTECTED] wrote:
 Hi Igor

 Here is the java code:

 add(new AjaxButton(ajaxSubmitButton, this) {

protected void onSubmit(AjaxRequestTarget target, Form form) {

AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
transactions) {

private static final long serialVersionUID = 1L;

@Override
public Component getLazyLoadComponent(String id)
 {

TransactionQuery transactionQuery = new
 TransactionQuery();


 transactionQuery.setCardNumber(cardNumberField
.getInput());

 transactionQuery.setDateFrom(dateFromField
.getInput());

 transactionQuery.setDateTo(dateToField.getInput());

 transactionQuery.setStoreId(storeIdsDropDownChoice
.getInput());
transactionQuery

 .setTerminalId(terminalIdsDropDownChoice

 .getInput());
int transactionNumber = 0;
if (transNumberField.getInput() != null)
 {
if
 ((transNumberField.getInput().length()  0))
transactionNumber =
 Integer

 .parseInt(transNumberField

 .getInput());
}
transactionQuery

 .setTransactionNumber(transactionNumber);



AjaxFallbackDefaultDataTable results =
 new AjaxFallbackDefaultDataTable(
id,
columns,
new
 SortableTransactionQueryResultsDataProvider(

 transactionQuery), 10);

// transactions.setOutputMarkupId(true);

results.setRenderBodyOnly(false);

return results;
}

};

transactions.setRenderBodyOnly(false);

form.replace(transactions);

target.addComponent(transactions);
}

 });



 HTML code:

 table cellpadding=2 cellspacing=0 width=521
 wicket:id=transactions

 /table


 I have tried playing around with the way I've implemented this, but I
 keep on getting the same exception (java.lang.IllegalStateException)
 when I sort a column or navigate to a page.

 Let me know what you think.

 Regards,
 Yazeed Isaacs



 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: 06 October 2008 09:31 AM
 To: users@wicket.apache.org
 Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
 sorting and paging throws an IllegalStateException

 if i were you i would read the exception message, it is telling you
 exactly what is going wrong...if you showed some code or provided a
 quickstart we can help further.

 -igor

 On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
 [EMAIL PROTECTED] wrote:
 Anybody?

 Guys please help me with this one.



 -Original Message-
 From: Yazeed Isaacs
 Sent: 03 October 2008 03:00 PM
 To: users@wicket.apache.org
 Subject: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting
 and paging throws an IllegalStateException

 Hi

 I have an AjaxFallbackDefaultDataTable table and I am using an
 AjaxLazyLoadPanel when rendering this table. When I click the AjaxButton
 the table lazy loads.

 To summarize (in short) I have a AjaxButton that when clicked the
 onSubmit() method creates the AjaxLazyLoadPanel, the AjaxLazyLoadPanel's
 getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable
 table. Therefore the AjaxLazyLoadPanel renders as the
 AjaxFallbackDefaultDataTable table.

 The table lazy loads correctly, but when I click on a column in order
 to sort it or click on the page navigation links, I get the following
 error:

 java.lang.IllegalStateException: Ajax render cannot be called on
 component that has setRenderBodyOnly enabled.
 ...
 Component id = content, page =
 za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
 8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable

 Where transactions is the AjaxLazyLoadPanel.

 Am I missing something? Please help.

 Regards,
 Yazeed Isaacs




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, 

Re: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

2008-10-06 Thread Ernesto Reinaldo Barreiro
The problem is, as Igor pointed, you cannot re-render a component via AJAX
if it has set setRenderBodyOnly(true)... Why?
div wicket:id=testAjax
  pContent.../p
/div

will be renderend as

pContent.../p

instead of

div id=someid
  pContent.../p
/div

So, there is no way wicket AJAX js can replace the div with something
else... Additionally you have to set setOutputMarkupId(true) on the
component you want to replace..

Ernesto

On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs 
[EMAIL PROTECTED] wrote:

 Hi Igor

 Here is the java code:

 add(new AjaxButton(ajaxSubmitButton, this) {

protected void onSubmit(AjaxRequestTarget target, Form form) {

AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
transactions) {

private static final long serialVersionUID = 1L;

@Override
public Component getLazyLoadComponent(String id)
 {

TransactionQuery transactionQuery = new
 TransactionQuery();


 transactionQuery.setCardNumber(cardNumberField
.getInput());

 transactionQuery.setDateFrom(dateFromField
.getInput());

 transactionQuery.setDateTo(dateToField.getInput());

 transactionQuery.setStoreId(storeIdsDropDownChoice
.getInput());
transactionQuery

 .setTerminalId(terminalIdsDropDownChoice

 .getInput());
int transactionNumber = 0;
if (transNumberField.getInput() != null)
 {
if
 ((transNumberField.getInput().length()  0))
transactionNumber =
 Integer

 .parseInt(transNumberField

 .getInput());
}
transactionQuery

 .setTransactionNumber(transactionNumber);



AjaxFallbackDefaultDataTable results =
 new AjaxFallbackDefaultDataTable(
id,
columns,
new
 SortableTransactionQueryResultsDataProvider(

 transactionQuery), 10);

// transactions.setOutputMarkupId(true);

results.setRenderBodyOnly(false);

return results;
}

};

transactions.setRenderBodyOnly(false);

form.replace(transactions);

target.addComponent(transactions);
}

 });



 HTML code:

 table cellpadding=2 cellspacing=0 width=521
 wicket:id=transactions

 /table


 I have tried playing around with the way I've implemented this, but I
 keep on getting the same exception (java.lang.IllegalStateException)
 when I sort a column or navigate to a page.

 Let me know what you think.

 Regards,
 Yazeed Isaacs



 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: 06 October 2008 09:31 AM
 To: users@wicket.apache.org
 Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
 sorting and paging throws an IllegalStateException

 if i were you i would read the exception message, it is telling you
 exactly what is going wrong...if you showed some code or provided a
 quickstart we can help further.

 -igor

 On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
 [EMAIL PROTECTED] wrote:
  Anybody?
 
  Guys please help me with this one.
 
 
 
  -Original Message-
  From: Yazeed Isaacs
  Sent: 03 October 2008 03:00 PM
  To: users@wicket.apache.org
  Subject: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting
 and paging throws an IllegalStateException
 
  Hi
 
  I have an AjaxFallbackDefaultDataTable table and I am using an
 AjaxLazyLoadPanel when rendering this table. When I click the AjaxButton
 the table lazy loads.
 
  To summarize (in short) I have a AjaxButton that when clicked the
 onSubmit() method creates the AjaxLazyLoadPanel, the AjaxLazyLoadPanel's
 getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable
 table. Therefore the AjaxLazyLoadPanel renders as the
 AjaxFallbackDefaultDataTable table.
 
  The table lazy loads correctly, but when I click on a column in order
 to sort it or click on the page navigation links, I get the following
 error:
 
  java.lang.IllegalStateException: Ajax render cannot be called on
 component that has setRenderBodyOnly enabled.
  ...
  Component id = content, page =
 za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
 8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
 
  Where transactions is the AjaxLazyLoadPanel.
 
  Am I missing something? Please help.
 
  Regards,
  Yazeed Isaacs
 
 
 

 

Serializing model. DetachedModel or not

2008-10-06 Thread jensiator

Hello
Im working on a Pageable dataview using SortableDataProvider  and I have
trouble to find out how It should be done regarding memory use versus
database requests. I've looked on the repeaters live action and read the
model chapter in wicket in action. 

1. If I dont use the loadabledetachableModel I need to implement
Serializable in my modelobject corrensponding to a row in the dataview.
Wicket wants to serialize the modelobject to the session. What will/might
happen to the webapplication memory if I choose this approach? How long will
the data be stored in the session? 

2. All the examples I have seen regarding the loadable approach seems to be
calling the db a little to much. When implementing the SortableDataProvider
iterator method, all examples call the db for the data to be shown in the
current page. Then the model extending LoadableDetachableModel will load (in
load method) the Models data again from some kind of identifier. It seems to
be that were loading all data twice. Is this how it should be done?

Jens Alenius
-- 
View this message in context: 
http://www.nabble.com/Serializing-model.-DetachedModel-or-not-tp19833559p19833559.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Nice urls in markup

2008-10-06 Thread Liz Huber
That is the intention, the fallback links only work when javascript is 
enabled.

According to the book wicket in action the intention of a fallback link 
is, that it acts like a usual link, if java script is disabled. Or did I 
get this wrong?



 I think you should mount your pages like this:
 mount(new HybridUrlCodingStrategy(home/project, ProjectPage.class));
 mount(new HybridUrlCodingStrategy(home/team, TeamPage.class));

This would be great, but I can't do this, because project and team 
aren't single pages. 

Once, panel project is displayed in page home and once panel team is 
shown (depending on what the user selected in menu).

Each panel has its own class, but only page classes can be mounted.



Does anyone still have an idea?

Liz





 - Original Message -
 From: Erik van Oosten
 Sent: 09/26/08 04:29 pm
 To: users@wicket.apache.org
 Subject: Re: Nice urls in markup
 
 Liz,
  The href-Element of my Ajax-Fallbacklinks show a pretty URLs now, but 
 the 
  fallback links don't work anymore, if JavaScript is disabled.

 That is the intention, the fallback links only work when havascript is
 enabled.
 
 I think you should mount your pages like this:
 mount(new HybridUrlCodingStrategy(home/project, ProjectPage.class));
 mount(new HybridUrlCodingStrategy(home/team, TeamPage.class));
 
 Regards,
 Erik.
 
 
 Liz Huber wrote:
  First of all: Thanks a lot for trying to help me, Erik!
 
  The href-Element of my Ajax-Fallbacklinks show a pretty URLs now, but 
 the 
  fallback links don't work anymore, if JavaScript is disabled.
  ul
 lia href=home id=navMail__itema onclick=var 
  
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
  
  function() {return Wicket.$('navMail__itema') != 
 null;}.bind(this));return 
  !wcall;spanProducts/span/a/li
  /ul
  ul
 lia href=home id=navMail__itemb onclick=var 
  
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
  
  function() {return Wicket.$('navMail__itemb') != 
 null;}.bind(this));return 
  !wcall;spanTeam/span/a/li
  /ul
 
  The thing I'd like to do is to mount a different, meaningful URLs for 
 each 
  Ajax-Fallbacklink. This URL should be shown in markup and within the 
  address line of the browser. And of course, the link should work 
  afterwards:
  ul
 lia href=home/products id=navMail__itema onclick=var 
  
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
  
  function() {return Wicket.$('navMail__itema') != 
 null;}.bind(this));return 
  !wcall;spanProducts/span/a/li
  /ul
  ul
 lia href=home/team id=navMail__itemb onclick=var 
  
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
  
  function() {return Wicket.$('navMail__itemb') != 
 null;}.bind(this));return 
  !wcall;spanTeam/span/a/li
  /ul
 
  I've been wondering, if it is even possible to do that. Could anyone 
 try to 
  help, please?
 
  Thanks,
  Liz
 
 
 
 

  - Original Message -
  From: Erik van Oosten
  Sent: 25/09/08 02:39 pm
  To: users@wicket.apache.org
  Subject: Re: Nice urls in markup
 
  Use a HybridUrlCodingStrategy to mount your pages. This will make ajax 
  request link to a similar URL as the page your are mounting (it adds a 
  number).
 
  Regards,
  Erik.
 
  Liz Huber wrote:
  
  I'm trying to beautify all wicket urls of my application by mounting 

  the 
  
  pages to meaningful paths. 
  Thereby the urls become pretty in the browser's address line.
 
  But within the rendered markup links and images still have non 
 formated 
  wicket urls. 
  So I mounted the images as shared resources and successfully tricked 
 by 
  overwriting methode onComponentTag():
 
  @Override
  protected void onComponentTag(ComponentTag tag) 
  {
  super.onComponentTag(tag);
  tag.put(src, urlFor(getImageResourceReference()).toString()); 
  }
  
  The same way I proceeded concerning links: I mounted the referenced 

  page 
  
  and overwrote methode onComponentTag():
 
  @Override
  protected void onComponentTag(ComponentTag tag) {
  super.onComponentTag(tag);
  if (clazz != null) {
  tag.put(href, urlFor(clazz, null)); //where clazz = 
  Class.forName(getDefaultModelObjectAsString());
  } else {
  tag.remove(href);
  }
  }
 
  This works pretty well and the urls in markup look like the 
 mountpaths. 

  But 
  
  one problem is still remaining. I created a list containing ajax 

  fallback 
  
  links. In markup they contain a href attribute, which is probably 

  used, 
  
  when java script is deactivated. 
 
  ...ul
 lia 
 

  
 href=?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::ILinkListener::

Re: Nice urls in markup

2008-10-06 Thread Igor Vaynberg
ajax fallback links are callback links, you cannot override their
generated url in markup without rolling your own urlcodingstrategy.
only bookmarkable page links generate bookmarkable (mounted) urls.

-igor

On Thu, Sep 25, 2008 at 4:48 AM, Liz Huber [EMAIL PROTECTED] wrote:
 I'm trying to beautify all wicket urls of my application by mounting the
 pages to meaningful paths.
 Thereby the urls become pretty in the browser's address line.

 But within the rendered markup links and images still have non formated
 wicket urls.
 So I mounted the images as shared resources and successfully tricked by
 overwriting methode onComponentTag():

 @Override
 protected void onComponentTag(ComponentTag tag)
 {
 super.onComponentTag(tag);
 tag.put(src, urlFor(getImageResourceReference()).toString());
 }

 The same way I proceeded concerning links: I mounted the referenced page
 and overwrote methode onComponentTag():

 @Override
 protected void onComponentTag(ComponentTag tag) {
 super.onComponentTag(tag);
 if (clazz != null) {
 tag.put(href, urlFor(clazz, null)); //where clazz =
 Class.forName(getDefaultModelObjectAsString());
 } else {
 tag.remove(href);
 }
 }

 This works pretty well and the urls in markup look like the mountpaths. But
 one problem is still remaining. I created a list containing ajax fallback
 links. In markup they contain a href attribute, which is probably used,
 when java script is deactivated.

 ...ul
lia
 href=?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::ILinkListener::
 id=navMail__itema onclick=var
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
 function() {return Wicket.$('navMail__itema') != null;}.bind(this));return
 !wcall;spanAjaxLink 1/span/a/li
 /ul
 ul
lia
 href=?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::ILinkListener::
 id=navMail__itemb onclick=var
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
 function() {return Wicket.$('navMail__itemb') != null;}.bind(this));return
 !wcall;spanAjaxLink 2/span/a/li
 /ul...

 I'd like to formate this url as well but I don't know how. I've already
 tried to mount Pages with parameters and to overwrite the href in the
 onComponentTag() methode. But it didn't help!
 Could you please give me a clue!

 Thanks,
 Liz


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Serializing model. DetachedModel or not

2008-10-06 Thread Igor Vaynberg
what exactly loads twice? dataview only makes two queries: one for the
size of the dataset and one for the window of data it is going to
render.

-igor

On Mon, Oct 6, 2008 at 1:07 AM, jensiator [EMAIL PROTECTED] wrote:

 Hello
 Im working on a Pageable dataview using SortableDataProvider  and I have
 trouble to find out how It should be done regarding memory use versus
 database requests. I've looked on the repeaters live action and read the
 model chapter in wicket in action.

 1. If I dont use the loadabledetachableModel I need to implement
 Serializable in my modelobject corrensponding to a row in the dataview.
 Wicket wants to serialize the modelobject to the session. What will/might
 happen to the webapplication memory if I choose this approach? How long will
 the data be stored in the session?

 2. All the examples I have seen regarding the loadable approach seems to be
 calling the db a little to much. When implementing the SortableDataProvider
 iterator method, all examples call the db for the data to be shown in the
 current page. Then the model extending LoadableDetachableModel will load (in
 load method) the Models data again from some kind of identifier. It seems to
 be that were loading all data twice. Is this how it should be done?

 Jens Alenius
 --
 View this message in context: 
 http://www.nabble.com/Serializing-model.-DetachedModel-or-not-tp19833559p19833559.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simulate DropDownChoice selection

2008-10-06 Thread Nino Saturnino Martinez Vazquez Wael

use form tester...

Aleksandr Nikiforov wrote:

Hi all,

I have a couple of DropDownChoices  and I want to test their behaviour 
using WicketTester,

is it possible to somehow simulate that user has made selection in ddc?

Regards,
Aleksandr

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having Wicket append #someanchor

2008-10-06 Thread Nino Saturnino Martinez Vazquez Wael

Could you add it to the wiki?

http://cwiki.apache.org/WICKET/

kan wrote:

I've made custom url coding strategy which finds key named # in
PageParameters and encodes it as anchor part (opaque part).

2008/10/2 Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:
  

I would probably just do a simple javascript and make a
headercontribution... But I guess it's not really the standard way when it
comes to anchors...

Craig Tataryn wrote:


*bump*

On Wed, Oct 1, 2008 at 2:04 PM, Craig Tataryn [EMAIL PROTECTED] wrote:


  

I was wondering if there is a way to have Wicket append some anchor
information to a response page?

So if I were on: MyPage.html, then they click a submit button and the
server side codes does a setResponsePage(MyPage.class) I would want the
actual page to be MyPage.html#someanchor

A suggestion on ##wicket was to do a redirect through httpServletResponse
and rewrite the url myself, but I wanted to know if Wicket supported this
a
bit more out of the box

Thanks!

Craig.

--
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn






  

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having Wicket append #someanchor

2008-10-06 Thread kan
I've made custom url coding strategy which finds key named # in
PageParameters and encodes it as anchor part (opaque part).

2008/10/2 Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:
 I would probably just do a simple javascript and make a
 headercontribution... But I guess it's not really the standard way when it
 comes to anchors...

 Craig Tataryn wrote:

 *bump*

 On Wed, Oct 1, 2008 at 2:04 PM, Craig Tataryn [EMAIL PROTECTED] wrote:



 I was wondering if there is a way to have Wicket append some anchor
 information to a response page?

 So if I were on: MyPage.html, then they click a submit button and the
 server side codes does a setResponsePage(MyPage.class) I would want the
 actual page to be MyPage.html#someanchor

 A suggestion on ##wicket was to do a redirect through httpServletResponse
 and rewrite the url myself, but I wanted to know if Wicket supported this
 a
 bit more out of the box

 Thanks!

 Craig.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn







 --
 -Wicket for love

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



HTTPS and FileUpload

2008-10-06 Thread Uwe Schäfer

hi

i think i hit a bug within wicket (or maybe it is a bug within the 
appserver?).


i have a FileUpload on a wicket form and everything is smooth, _until_ 
it is taken to https.
it looks like in https, the request does not (at least in caucho resin) 
tell the size of the request. This means (whatever maxSize is defined) 
wicket rejects to process it:


org.apache.wicket.util.upload.FileUploadBase:236 (wicket 1.4m3)

if (requestSize == -1)
{
  throw new UnknownSizeException( the request
was rejected because its size is unknown);
}

is there a way around, or does this sanity check break on https?

cu uwe

ps: shall i open an isue for that? i just commented those lines out 
locally and it works nicely with http as well as http.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simulate DropDownChoice selection

2008-10-06 Thread Edward Yakop
On Mon, Oct 6, 2008 at 3:11 PM, Aleksandr Nikiforov
[EMAIL PROTECTED] wrote:
 Hi all,

 I have a couple of DropDownChoices  and I want to test their behaviour using
 WicketTester,
 is it possible to somehow simulate that user has made selection in ddc?

WicketTester tester = ...;

// If ajax drop down choice
tester.setParameterForNextRequest(path:to:ddc, itemIndex );
tester.setupRequestAndResponse(true);
tester.executeAjaxEvent(path:to:ddc, onchange);

// Normal drop down choice
FormTester formTester = tester.newFormTester( path:to:form );
formTester.select( path:to:ddc, itemIndex );
formTester.submit();

Regards,
Edward Yakop

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Newbie Question, Very Basic Model Use

2008-10-06 Thread walnutmon

After using property models, it's nice to have automatic binding to variables
in objects... However, I can't seem to get the same thing to work with local
variables... as an example...

new CheckBox(toggleSomething, new PropertyModel(someObject,
toggleableProperty));
works beautifully...

However, 
new CheckBox(toggleSomething, new Model(toggleableObject));
//toggleableObject is a Boolean

doesn't seem to change anything on form submit, that toggleable object only
dictates the initial state of the checkbox, but doesn't change with it
What am I missing?

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie Question, Very Basic Model Use

2008-10-06 Thread Serkan Camurcuoglu
Model assigns a new object as the model object, and I think 
java.lang.Boolean is immutable so it can't change after it's constructed 
anyway. So instead of checking the value of toggleableObject I think you 
can check myCheckbox.getModelObject() == Boolean.TRUE etc..




Ryan Gravener wrote:

If you would like the property model to work with local variables do
new propertymodel(this,property)

On 10/6/08, walnutmon [EMAIL PROTECTED] wrote:
  

After using property models, it's nice to have automatic binding to
variables
in objects... However, I can't seem to get the same thing to work with local
variables... as an example...

new CheckBox(toggleSomething, new PropertyModel(someObject,
toggleableProperty));
works beautifully...

However,
new CheckBox(toggleSomething, new Model(toggleableObject));
//toggleableObject is a Boolean

doesn't seem to change anything on form submit, that toggleable object only
dictates the initial state of the checkbox, but doesn't change with it
What am I missing?

--
View this message in context:
http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie Question, Very Basic Model Use

2008-10-06 Thread Ryan Gravener
If you would like the property model to work with local variables do
new propertymodel(this,property)

On 10/6/08, walnutmon [EMAIL PROTECTED] wrote:

 After using property models, it's nice to have automatic binding to
 variables
 in objects... However, I can't seem to get the same thing to work with local
 variables... as an example...

 new CheckBox(toggleSomething, new PropertyModel(someObject,
 toggleableProperty));
 works beautifully...

 However,
 new CheckBox(toggleSomething, new Model(toggleableObject));
 //toggleableObject is a Boolean

 doesn't seem to change anything on form submit, that toggleable object only
 dictates the initial state of the checkbox, but doesn't change with it
 What am I missing?

 --
 View this message in context:
 http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Ryan Gravener
http://twitter.com/ryangravener

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Modeless Window (real or div)

2008-10-06 Thread Francisco Diaz Trepat - gmail
Hi I need to build a pop-up modal window on my application.
I wanted to see if I could get some recomendations or comments.

Obviously I need not to re-enter username and password and work on the same
session.

It could be a div element like the Wicket Dialog, or a real new window.

Thoughts?

thanks,
f(t)


Re: Newbie Question, Very Basic Model Use

2008-10-06 Thread Martijn Dashorst
see the models page on the wiki and read the javadoc for CompoundPropertyModel

Martijn

On Mon, Oct 6, 2008 at 3:26 PM, walnutmon [EMAIL PROTECTED] wrote:

 After using property models, it's nice to have automatic binding to variables
 in objects... However, I can't seem to get the same thing to work with local
 variables... as an example...

 new CheckBox(toggleSomething, new PropertyModel(someObject,
 toggleableProperty));
 works beautifully...

 However,
 new CheckBox(toggleSomething, new Model(toggleableObject));
 //toggleableObject is a Boolean

 doesn't seem to change anything on form submit, that toggleable object only
 dictates the initial state of the checkbox, but doesn't change with it
 What am I missing?

 --
 View this message in context: 
 http://www.nabble.com/Newbie-Question%2C-Very-Basic-Model-Use-tp19837933p19837933.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having Wicket append #someanchor

2008-10-06 Thread kan
http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs-Howtoadd%23anchor(opaque)topageurl%3F

2008/10/6 Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:
 Could you add it to the wiki?

 http://cwiki.apache.org/WICKET/

 kan wrote:

 I've made custom url coding strategy which finds key named # in
 PageParameters and encodes it as anchor part (opaque part).

 2008/10/2 Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:


 I would probably just do a simple javascript and make a
 headercontribution... But I guess it's not really the standard way when
 it
 comes to anchors...

 Craig Tataryn wrote:


 *bump*

 On Wed, Oct 1, 2008 at 2:04 PM, Craig Tataryn [EMAIL PROTECTED]
 wrote:




 I was wondering if there is a way to have Wicket append some anchor
 information to a response page?

 So if I were on: MyPage.html, then they click a submit button and the
 server side codes does a setResponsePage(MyPage.class) I would want the
 actual page to be MyPage.html#someanchor

 A suggestion on ##wicket was to do a redirect through
 httpServletResponse
 and rewrite the url myself, but I wanted to know if Wicket supported
 this
 a
 bit more out of the box

 Thanks!

 Craig.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn







 --
 -Wicket for love

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]








 --
 -Wicket for love

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
WBR, kan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Serializing model. DetachedModel or not

2008-10-06 Thread jensiator

Hi Igor
If the sortabledataprovider calls the db to get the window of data, and the
detached model (set in the dataproviders model method) calls the db in the
load method to get the data from a private transient id. Will not the
database be called twice for every record/row in the dataset? The sortable
example in wicket live action seems to do
that(http://www.wicketstuff.org/wicket13/repeater/). Or am I getting it all
wrong?
Jens Alenius

-- 
View this message in context: 
http://www.nabble.com/Serializing-model.-DetachedModel-or-not-tp19833559p19843071.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wicket Security

2008-10-06 Thread Marc Ende
Hi,

I'd like to integrate security in my wicket application. I've seen a
tutorial regarding jaas, ldap etc.
(http://blog.xebia.com/2008/05/08/wicket-jboss-jaas-ldap/) and I've
found swarm. In the repositories I had found wicket-security. While
reading the tutorial I've found that the wicket-security and the
tutorial relates to each other. After reading swarm I had the impression
that this will be another approach OR I had missed some things.

What I'd like to do is:

I have a webapp which has some parts in public areas which should only
be shown to authorized people. On the other hand there should be pages
which are completely only for these authorized peoples. As a backend I
have to use JAAS. The business-logic is encapsulated in ejb's which also
have declarative security (which annotations).

Now I have some questions:

- Are both projects (wicket-security and swarm) diffrent project or do
I have a completly wrong understanding of these both projects?
- I've found that the Tutorial is working great and I know how to
protect a whole page. But when I'd like to set parts invisible if there
is no authenticated people seeing the page. How can I get access to the
roles when I'm using a page where only parts should be set visible or
invisible regarding the authorization.
- Following this tutorial can I use the LoginContext from Jaas to
authenticate against the ejb's or is it lost after login?
- When the login context is available: Can I also use wicket-javaee with
this context?

Sorry for this stupid questions. I had used other frameworks before and
now I'm a complete beginner on wicket (and JAAS was used by me a long
time ago...)
Anyway: The few steps I had done with wicket and I really like it. It's
a great framework! You've done a really good job!!!

marc



signature.asc
Description: OpenPGP digital signature


How to expose regular exception message in FeedbackPanel?

2008-10-06 Thread Seven Corners

I have a form whose submission can possibly generate exceptions.  I would
like to expose the exception text in the FeedbackPanel.  How can I do this?

I've tried getting the FeedbackMessagesModel and doing a setObject() on that
but it's not accepting a String, a FeedbackMessages List, or a new
FeedbackMessage.  Obviously I'm going about this the wrong way.

Ideas?

Thanking you in advance for your time and trouble.
-- 
View this message in context: 
http://www.nabble.com/How-to-expose-regular-exception-message-in-FeedbackPanel--tp19843597p19843597.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to expose regular exception message in FeedbackPanel?

2008-10-06 Thread Ryan Gravener
In your catch clause in onsubmit, call error(e.getMessage())


Ryan Gravener
http://twitter.com/ryangravener


On Mon, Oct 6, 2008 at 2:32 PM, Seven Corners [EMAIL PROTECTED]wrote:


 I have a form whose submission can possibly generate exceptions.  I would
 like to expose the exception text in the FeedbackPanel.  How can I do this?

 I've tried getting the FeedbackMessagesModel and doing a setObject() on
 that
 but it's not accepting a String, a FeedbackMessages List, or a new
 FeedbackMessage.  Obviously I'm going about this the wrong way.

 Ideas?

 Thanking you in advance for your time and trouble.
 --
 View this message in context:
 http://www.nabble.com/How-to-expose-regular-exception-message-in-FeedbackPanel--tp19843597p19843597.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to expose regular exception message in FeedbackPanel?

2008-10-06 Thread Serkan Camurcuoglu
you can use the info, warn, error or fatal methods of component to 
generate feedback messages.. usually you can just write:


catch (Exception e) {
 error(e.getMessage());
}



Seven Corners wrote:

I have a form whose submission can possibly generate exceptions.  I would
like to expose the exception text in the FeedbackPanel.  How can I do this?

I've tried getting the FeedbackMessagesModel and doing a setObject() on that
but it's not accepting a String, a FeedbackMessages List, or a new
FeedbackMessage.  Obviously I'm going about this the wrong way.

Ideas?

Thanking you in advance for your time and trouble.
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



force page reload

2008-10-06 Thread francisco treacy
hi,

i'm integrating a wicket application with an online payment system
provided by a bank.

i have a wicket stateful page (ie shows visa / mastercard icons) which
links to the bank app's payment page. depending on the transaction,
the bank sends us back a result code in an encrypted http url
parameter, appended to the url of our wicket page.

String encrypted =
getWebRequestCycle().getWebRequest().getHttpServletRequest().getParameter(DATA);

according to the bank's response, i decide whether to show a please
pay or a thank you page with wicket variations.

the only problem i am having here is: the wicket page is cached, so no
matter what the  result is, it will show the last seen version in the
pagemap - that is, it won't re-execute the page's java code.

i tried overriding headers

protected void setHeaders(WebResponse response) {
response.setHeader(Pragma, no-cache);
response.setDateHeader(Expires,0);
response.setHeader(Cache-Control, no-cache, max-age=0,
must-revalidate, no-store);
}

but none of these http headers are seen in the html output whatsoever.

i also tried implementing IMarkupCacheKeyProvider and returning null.
with no success so far.

what should i do to execute the page's code, no matter when it is called?

thanks,

francisco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Non-modal ModalWindow ?

2008-10-06 Thread Cédric Thiébault
Is there an equivalent of the ModalWindow but non-modal, ie without a
mask that prevent user from interacting the rest of page ?
Thanks!

Cedric

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to expose regular exception message in FeedbackPanel?

2008-10-06 Thread Shelah Horvitz
Thank you.  I can't believe you got back to me so fast!

This is a slick solution.  I appreciate it.



From: Serkan Camurcuoglu [EMAIL PROTECTED]
Sent: Monday, October 06, 2008 2:36 PM
To: users@wicket.apache.org
Subject: Re: How to expose regular exception message in FeedbackPanel?

you can use the info, warn, error or fatal methods of component to
generate feedback messages.. usually you can just write:

catch (Exception e) {
  error(e.getMessage());
}



Seven Corners wrote:
 I have a form whose submission can possibly generate exceptions.  I would
 like to expose the exception text in the FeedbackPanel.  How can I do this?

 I've tried getting the FeedbackMessagesModel and doing a setObject() on that
 but it's not accepting a String, a FeedbackMessages List, or a new
 FeedbackMessage.  Obviously I'm going about this the wrong way.

 Ideas?

 Thanking you in advance for your time and trouble.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Non-modal ModalWindow ?

2008-10-06 Thread Daan van Etten

Yes, it's called a DIV.

Regards,

Daan


On 6 okt 2008, at 21:08, Cédric Thiébault wrote:


Is there an equivalent of the ModalWindow but non-modal, ie without a
mask that prevent user from interacting the rest of page ?
Thanks!

Cedric

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Radio component with children?

2008-10-06 Thread dukehoops

I made my component a subclass of FormComponentPanel and overrode
convertInput(). However when form containing this formComponentPanel is
submitted, panel's convertInput method is never called. 

As result panel displays correctly, but changes are lost on submission. Any
ideas?

-

Nikita Tovstoles
vside.com


-- 
View this message in context: 
http://www.nabble.com/Custom-Radio-component-with-children--tp19804341p19844805.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Serializing model. DetachedModel or not

2008-10-06 Thread Igor Vaynberg
the loadabledetachablemodel is initialized with the object itself

eg new contactdetachablemodel(contact)

so during that initial request the model has the object already loaded
by the dataprovider

i suggest instead of making assumptions you try to write some code and
see how it works

-igor

On Mon, Oct 6, 2008 at 11:05 AM, jensiator [EMAIL PROTECTED] wrote:

 Hi Igor
 If the sortabledataprovider calls the db to get the window of data, and the
 detached model (set in the dataproviders model method) calls the db in the
 load method to get the data from a private transient id. Will not the
 database be called twice for every record/row in the dataset? The sortable
 example in wicket live action seems to do
 that(http://www.wicketstuff.org/wicket13/repeater/). Or am I getting it all
 wrong?
 Jens Alenius

 --
 View this message in context: 
 http://www.nabble.com/Serializing-model.-DetachedModel-or-not-tp19833559p19843071.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Auto-Reload in Wicket

2008-10-06 Thread cnoleherzer

I'm new to Wicket and i found that Wicket doesn't auto reload if i changed my
java code, i must relaunch jetty after some changes. Is there some way to
make Wicket auto-reloadable? I also use Spring in my project.
-- 
View this message in context: 
http://www.nabble.com/Auto-Reload-in-Wicket-tp19844952p19844952.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Intermittently not updating TextField

2008-10-06 Thread Seven Corners

I have a form where one of my text fields intermittently doesn't update when
I change the model, even though I add the component to the AJAX target. 
Most of the time it works.  When you add a few fields to the ListChoice,
this is where things get dicey.

Here's the scenario: you have a ListChoice of user names and a series of
text fields with data about each user.  When you click on a name in the
ListChoice, we use the username as a key and ask the server for the rest of
the data on that user, which I fluff into a UserBean object, whose data is
the model for my TextFields.  Then I use AJAX to update the fields:

// Instantiate the TextFields
txtUserName = new TextFieldString( txtUserName, new
PropertyModelString( selectedUser, userName ) );
txtUserName.setOutputMarkupId( true );
acctForm.add( txtUserName );  
...
txtEmail = new TextFieldString( txtEmail, new
PropertyModelString( selectedUser, email ) );
txtEmail.setOutputMarkupId( true );
...
acctForm.add( txtEmail );

// Set up the ListChoice and its onChange behavior
listCtrlUsers = new ListChoiceString( userNames, new
PropertyModelString( selectedUser, userName ), userNames );
listCtrlUsers.add( new AjaxFormComponentUpdatingBehavior( onchange )
{
protected void onUpdate( AjaxRequestTarget target )
{
selectedUser = new UserBean( UserAdapter.getUser(
listCtrlUsers.getModelObject() ) );
txtUserName.setModelObject( selectedUser.getUserName() ); 
txtEmail.setModelObject( selectedUser.getEmail() ); 
txtPhoneNo.setModelObject( selectedUser.getPhoneNo() ); 
...
target.addComponent( txtUserName );
target.addComponent( txtEmail );
target.addComponent( txtPhoneNo );
...
}
}
listCtrlUsers.setOutputMarkupId( true );
acctForm.add( listCtrlUsers );

The UserBean is straightforward accessors:

private class UserBean
{
public UserBean( final User user )
{
userName = user.getUserName();
phoneNo = user.getPhoneNo();
email = user.getEmail();
...
}

public String getUserName()
{
return userName;
}

public void setUserName( String strName )
{
userName = strName;
}
...
}

Now, you are able to add to or delete from the ListChoice via calls to the
server that add or delete users, and the ListChoice USUALLY (but not always)
updates.  Of course, when it doesn't update it's obvious why everything
falls apart but the fact that it doesn't always update is problemmatic and
similar to the issue where the TextField doesn't update.

Does anyone have any ideas about this?

Thank you for your trouble and time.
-- 
View this message in context: 
http://www.nabble.com/Intermittently-not-updating-TextField-tp19845008p19845008.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Auto-Reload in Wicket

2008-10-06 Thread landry soules
If you use Eclipse, and built your application with the quick start 
Maven archetype, all you have to do is right-click on the Start class, 
and select debug asJava application, to start your app in auto 
reloading mode.



cnoleherzer wrote:

I'm new to Wicket and i found that Wicket doesn't auto reload if i changed my
java code, i must relaunch jetty after some changes. Is there some way to
make Wicket auto-reloadable? I also use Spring in my project.
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: force page reload

2008-10-06 Thread Serkan Camurcuoglu
If I understood you correctly, I've done something like this to show a 
different page depending on a url parameter. You should override the 
newRequestCycleProcessor() method of your application class, and return a 
different request target from the resolve method. Here I return a 
bookmarkablepagerequesttarget which creates a new home page if a certain 
parameter exists in the request:

@Override
protected IRequestCycleProcessor newRequestCycleProcessor() {
return new WebRequestCycleProcessor() {
@Override
public IRequestTarget resolve(RequestCycle cycle, RequestParameters 
params) {
if (null != 
params.getParameters().get(ContentSearchPage.PARAM_SEARCH_KEY)) {
return new 
BookmarkablePageRequestTarget(ContentSearchPage.class);
}
return super.resolve(cycle, params);
}
};
}



-Original Message-
From: francisco treacy [mailto:[EMAIL PROTECTED]
Sent: Mon 10/6/2008 10:07 PM
To: users@wicket.apache.org
Subject: force page reload
 
hi,

i'm integrating a wicket application with an online payment system
provided by a bank.

i have a wicket stateful page (ie shows visa / mastercard icons) which
links to the bank app's payment page. depending on the transaction,
the bank sends us back a result code in an encrypted http url
parameter, appended to the url of our wicket page.

String encrypted =
getWebRequestCycle().getWebRequest().getHttpServletRequest().getParameter(DATA);

according to the bank's response, i decide whether to show a please
pay or a thank you page with wicket variations.

the only problem i am having here is: the wicket page is cached, so no
matter what the  result is, it will show the last seen version in the
pagemap - that is, it won't re-execute the page's java code.

i tried overriding headers

protected void setHeaders(WebResponse response) {
response.setHeader(Pragma, no-cache);
response.setDateHeader(Expires,0);
response.setHeader(Cache-Control, no-cache, max-age=0,
must-revalidate, no-store);
}

but none of these http headers are seen in the html output whatsoever.

i also tried implementing IMarkupCacheKeyProvider and returning null.
with no success so far.

what should i do to execute the page's code, no matter when it is called?

thanks,

francisco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Non-modal ModalWindow ?

2008-10-06 Thread Cédric Thiébault
A ModalWindows is not just a DIV with a mask...
I need all the ModalWindow logic (show/hide, drag, resize, etc.) but
not the mask.

Cedric


On Mon, Oct 6, 2008 at 3:30 PM, Daan van Etten [EMAIL PROTECTED] wrote:
 Yes, it's called a DIV.

 Regards,

 Daan


 On 6 okt 2008, at 21:08, Cédric Thiébault wrote:

 Is there an equivalent of the ModalWindow but non-modal, ie without a
 mask that prevent user from interacting the rest of page ?
 Thanks!

 Cedric

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Non-modal ModalWindow ?

2008-10-06 Thread Daan van Etten

You could check the ModalWindow in wicket-extensions.

It contains a file called modal.js. In that file you can find the  
following function:


/**
 * Creates the mask accordingly to the settings.
 */
createMask: function() {
if (this.settings.mask == transparent)
this.mask = new Wicket.Window.Mask(true);
else if (this.settings.mask == semi-transparent)
this.mask = new Wicket.Window.Mask(false);

if (typeof(this.mask) != undefined) {
this.mask.show();
}
},

You could change this function and the ModalWindow.MaskType so you can  
set a 'disabled' mask.
After that, you can create a JIRA issue with your code, so more people  
can profit from it :-)


Regards,

Daan

On 6 okt 2008, at 22:04, Cédric Thiébault wrote:


A ModalWindows is not just a DIV with a mask...
I need all the ModalWindow logic (show/hide, drag, resize, etc.) but
not the mask.

Cedric


On Mon, Oct 6, 2008 at 3:30 PM, Daan van Etten [EMAIL PROTECTED] wrote:

Yes, it's called a DIV.

Regards,

Daan


On 6 okt 2008, at 21:08, Cédric Thiébault wrote:

Is there an equivalent of the ModalWindow but non-modal, ie  
without a

mask that prevent user from interacting the rest of page ?
Thanks!

Cedric

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Radio component with children?

2008-10-06 Thread Igor Vaynberg
paste some code

-igor

On Mon, Oct 6, 2008 at 12:35 PM, dukehoops [EMAIL PROTECTED] wrote:

 I made my component a subclass of FormComponentPanel and overrode
 convertInput(). However when form containing this formComponentPanel is
 submitted, panel's convertInput method is never called.

 As result panel displays correctly, but changes are lost on submission. Any
 ideas?

 -
 
 Nikita Tovstoles
 vside.com
 

 --
 View this message in context: 
 http://www.nabble.com/Custom-Radio-component-with-children--tp19804341p19844805.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unable to add a Form to a ModalWindow opened from within another ModalWindow

2008-10-06 Thread Nick Zimmerman
As an update to my question, I have been able to add a Form to a Page 
based ModalWindow that was opened from another Page based ModalWindow. 
The top ModalWindow can now be moved beyond the confines of the parent 
ModalWindow. The problem still exists when trying to add a Form to a 
Panel based ModalWindow that was opened from another Panel based 
ModalWindow.


Does anyone know of a work around for the Panel based ModalWindows? 
Using Page based ModalWindows is limiting my ability to update content 
on the underlying WebPage via Ajax.


Thanks for any help you can offer,

-Nick

Nick Zimmerman wrote:

Hello,

I am trying to use ModalWindows to control the workflow of a survey
creation page. I have run into an issue where I am not able to
add a Form to a Panel based ModalWindow that was opened from another
Panel based ModalWindow.

I can add a Form to a Panel based ModalWindow if I open it from a Page 
based ModalWindow, but then the Panel based ModalWindow is contained 
within the borders of the Page based ModalWindow instead of floating 
above the page and the previous ModalWindow.


Is there a way to add the Form using only Panel based ModalWindows? 
Otherwise, is there a way to get the second ModalWindow to be able to 
move beyond the borders of the Page based ModalWindow?


Thank you in advance for any help you can offer.


-Nick


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Need help regarding Base Page refresh.

2008-10-06 Thread ravichand

Have the same problem. Can any one help
-- 
View this message in context: 
http://www.nabble.com/Need-help-regarding-Base-Page-refresh.-tp19602473p19846169.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Radio component with children?

2008-10-06 Thread dukehoops

Sure, here it is below. Test selects a non-default value from
'publicLocationChoices' drop down. Problems are:
-on form submit, LocationSelectionPanel.convertInput() is not called (have
breakpoint there)
-in debugger, I can see dropDown's rawInput changing on form submit, but
model's object ('data') value is never updated

Test
public void testLocationSelectionPanel_SelectCohost() {
final WicketTester t = getTester();
final VirtualEventFormBean formBean = new VirtualEventFormBean();
formBean.setEventId(EVENT_ID);
formBean.setOrganizerId(currentUser.getId());
final EventLocation initialLocation =
virtualEventService.getCustomSpaceEventLocation(currentUser.getId());
formBean.setLocation(initialLocation);

LocationSelectionPanelTestPage p = new
LocationSelectionPanelTestPage(formBean);
t.startPage(p);
t.assertRenderedPage(LocationSelectionPanelTestPage.class);

DropDownChoice publicLocationsChoice = (DropDownChoice)
t.getComponentFromLastRenderedPage(form:location:publicLocationChoices);
//selecting component

FormTester ft = t.newFormTester(form);

//select cohost
ft.select(location:publicLocationChoices, 1); //select 1st public
location

//submit 
ft.submit();
EventLocation newLocation = p.getFormBean().getLocation();
assertNotSame(initialLocation, newLocation);
assertTrue(newLocation instanceof PublicEventLocation);
}

Test Page
public class LocationSelectionPanelTestPage extends AbstractWebPage {

@SpringBean private VirtualEventService virtualEventService;

private final VirtualEventFormBean formBean;
private CompoundPropertyModel model;

public LocationSelectionPanelTestPage(VirtualEventFormBean formBean) {
assert formBean != null;
this.formBean = formBean;
model = new CompoundPropertyModel(formBean);
Form form = new Form(form, model);
add(form);

//location selection
final CustomSpaceEventLocation organizerLocation =
virtualEventService.getCustomSpaceEventLocation(formBean.getOrganizerId());
//assemble cohost models
ListCustomSpaceEventLocation cohostLocations = new
ArrayListCustomSpaceEventLocation();
for (Serializable cohostId : formBean.getCohosts()) {
CustomSpaceEventLocation cohostLocation =
virtualEventService.getCustomSpaceEventLocation(cohostId);
cohostLocations.add(cohostLocation);
}

LocationSelectionPanel locationSelectionPanel = new
LocationSelectionPanel(
location,
organizerLocation,
cohostLocations,
virtualEventService.getPublicEventLocations(),
formBean);

form.add(locationSelectionPanel);
}

public VirtualEventFormBean getFormBean() {
return formBean;
}
}

Custom Component In Question
public class LocationSelectionPanel extends FormComponentPanel {

//final private PublicLocationRadio publicLocationRadio;
final private RadioGroup locationGroup;
final private PublicLocationDropDownChoice publicLocationDropDown;
final private VirtualEventFormBean formBean;
//final private BoundCompoundPropertyModel model;
//final static String LOCATION_PROPERTY = location;
final private Model publicLocationModel = new Model();
final private Model locationGroupModel = new Model();
final private CustomSpaceEventLocation organizerLocation;

public LocationSelectionPanel(
String wicketId,
CustomSpaceEventLocation organizerLocation,
ListCustomSpaceEventLocation cohostLocations,
ListPublicEventLocation publicLocations,
VirtualEventFormBean formBean) {

super(wicketId);
assert organizerLocation != null;
assert cohostLocations != null;
assert publicLocations != null;
assert formBean != null;

this.formBean = formBean;
this.organizerLocation = organizerLocation;

this.setRequired(true);

//model = new BoundCompoundPropertyModel(formBean);
this.setModel(new Model(formBean.getLocation()));
//model.bind(this, LOCATION_PROPERTY);


//group will default to location specified in formBean.location
locationGroup = new RadioGroup(locationGroup, locationGroupModel);
locationGroup.setRequired(true);
add(locationGroup); //bind RadioGroup's model object to location
property of this.model's formBean

// organizer's apt
CustomSpaceRadio organizerRadio = new
CustomSpaceRadio(organizerLocation, organizerLocation);
locationGroup.add(organizerRadio);

//co-hosts' places
//create radio controls for cohosts' locations
ListView participantChoices = new
CohostLocationListView(cohostLocationChoices, cohostLocations);

Re: Need help regarding Base Page refresh.

2008-10-06 Thread Igor Vaynberg
is it really so hard to google refresh parent window from child window

wow

-igor

On Mon, Oct 6, 2008 at 1:50 PM, ravichand [EMAIL PROTECTED] wrote:

 Have the same problem. Can any one help
 --
 View this message in context: 
 http://www.nabble.com/Need-help-regarding-Base-Page-refresh.-tp19602473p19846169.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom Radio component with children?

2008-10-06 Thread Igor Vaynberg
does this work without wickettester?

-igor

On Mon, Oct 6, 2008 at 2:24 PM, dukehoops [EMAIL PROTECTED] wrote:

 Sure, here it is below. Test selects a non-default value from
 'publicLocationChoices' drop down. Problems are:
 -on form submit, LocationSelectionPanel.convertInput() is not called (have
 breakpoint there)
 -in debugger, I can see dropDown's rawInput changing on form submit, but
 model's object ('data') value is never updated

 Test
public void testLocationSelectionPanel_SelectCohost() {
final WicketTester t = getTester();
final VirtualEventFormBean formBean = new VirtualEventFormBean();
formBean.setEventId(EVENT_ID);
formBean.setOrganizerId(currentUser.getId());
final EventLocation initialLocation =
 virtualEventService.getCustomSpaceEventLocation(currentUser.getId());
formBean.setLocation(initialLocation);

LocationSelectionPanelTestPage p = new
 LocationSelectionPanelTestPage(formBean);
t.startPage(p);
t.assertRenderedPage(LocationSelectionPanelTestPage.class);

DropDownChoice publicLocationsChoice = (DropDownChoice)
 t.getComponentFromLastRenderedPage(form:location:publicLocationChoices);
 //selecting component

FormTester ft = t.newFormTester(form);

//select cohost
ft.select(location:publicLocationChoices, 1); //select 1st public
 location

//submit
ft.submit();
EventLocation newLocation = p.getFormBean().getLocation();
assertNotSame(initialLocation, newLocation);
assertTrue(newLocation instanceof PublicEventLocation);
}

 Test Page
 public class LocationSelectionPanelTestPage extends AbstractWebPage {

@SpringBean private VirtualEventService virtualEventService;

private final VirtualEventFormBean formBean;
private CompoundPropertyModel model;

public LocationSelectionPanelTestPage(VirtualEventFormBean formBean) {
assert formBean != null;
this.formBean = formBean;
model = new CompoundPropertyModel(formBean);
Form form = new Form(form, model);
add(form);

//location selection
final CustomSpaceEventLocation organizerLocation =
 virtualEventService.getCustomSpaceEventLocation(formBean.getOrganizerId());
//assemble cohost models
ListCustomSpaceEventLocation cohostLocations = new
 ArrayListCustomSpaceEventLocation();
for (Serializable cohostId : formBean.getCohosts()) {
CustomSpaceEventLocation cohostLocation =
 virtualEventService.getCustomSpaceEventLocation(cohostId);
cohostLocations.add(cohostLocation);
}

LocationSelectionPanel locationSelectionPanel = new
 LocationSelectionPanel(
location,
organizerLocation,
cohostLocations,
virtualEventService.getPublicEventLocations(),
formBean);

form.add(locationSelectionPanel);
}

public VirtualEventFormBean getFormBean() {
return formBean;
}
 }

 Custom Component In Question
 public class LocationSelectionPanel extends FormComponentPanel {

//final private PublicLocationRadio publicLocationRadio;
final private RadioGroup locationGroup;
final private PublicLocationDropDownChoice publicLocationDropDown;
final private VirtualEventFormBean formBean;
//final private BoundCompoundPropertyModel model;
//final static String LOCATION_PROPERTY = location;
final private Model publicLocationModel = new Model();
final private Model locationGroupModel = new Model();
final private CustomSpaceEventLocation organizerLocation;

public LocationSelectionPanel(
String wicketId,
CustomSpaceEventLocation organizerLocation,
ListCustomSpaceEventLocation cohostLocations,
ListPublicEventLocation publicLocations,
VirtualEventFormBean formBean) {

super(wicketId);
assert organizerLocation != null;
assert cohostLocations != null;
assert publicLocations != null;
assert formBean != null;

this.formBean = formBean;
this.organizerLocation = organizerLocation;

this.setRequired(true);

//model = new BoundCompoundPropertyModel(formBean);
this.setModel(new Model(formBean.getLocation()));
//model.bind(this, LOCATION_PROPERTY);


//group will default to location specified in formBean.location
locationGroup = new RadioGroup(locationGroup, locationGroupModel);
locationGroup.setRequired(true);
add(locationGroup); //bind RadioGroup's model object to location
 property of this.model's formBean

// organizer's apt
CustomSpaceRadio organizerRadio = new
 CustomSpaceRadio(organizerLocation, organizerLocation);
locationGroup.add(organizerRadio);

//co-hosts' places
//create radio controls for cohosts' locations
ListView participantChoices = 

Wicket on Tomcat?

2008-10-06 Thread Vernon
I just dip into Wicket. I notice that Wicket setup exclusively with Jetty, for 
example, the quick start page http://wicket.apache.org/quickstart.html. Can I 
create an Eclipse project for TC instead of Jetty?  



  

Re: Wicket on Tomcat?

2008-10-06 Thread Jeremy Thomerson
Yes - it's a regular web app, and you build it into a regular war just like
normal.  Most of my production applications are deployed with Tomcat.  But
the development with Jetty in Eclipse is very simple and convenient since
you can run the start class in debug mode, and it will start an embedded
server and eclipse will pick up HTML / class file changes.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Mon, Oct 6, 2008 at 6:37 PM, Vernon [EMAIL PROTECTED] wrote:

 I just dip into Wicket. I notice that Wicket setup exclusively with Jetty,
 for example, the quick start page http://wicket.apache.org/quickstart.html.
 Can I create an Eclipse project for TC instead of Jetty?






Re: Custom Radio component with children?

2008-10-06 Thread dukehoops

It is not easy for me to check whether this component functions outside of
test harness at the moment (dependency issues) but I will do so tomorrow.

In the mean time, debugging the unit test further I can tell that:
radioGroup and DropDownChoices are the only components that get called by
validate(FormComponent) method inside Form.validateComponents().
LocationSelectionPanel does not (even though all three are children of form)


BTW, FormComponentPanel overrides checkRequired() but - contrary to javadocs
on checkRequired() - does NOT call isRequired() first. Unsure what that
means though...

-nikita


igor.vaynberg wrote:
 
 does this work without wickettester?
 

-

Nikita Tovstoles
vside.com


-- 
View this message in context: 
http://www.nabble.com/Custom-Radio-component-with-children--tp19804341p19849085.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket on Tomcat?

2008-10-06 Thread Vernon
Thanks for your quick response. 

How I shall take actions then? 

Sorry for this dumb question.



- Original Message 
From: Jeremy Thomerson [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Monday, October 6, 2008 4:42:22 PM
Subject: Re: Wicket on Tomcat?

Yes - it's a regular web app, and you build it into a regular war just like
normal.  Most of my production applications are deployed with Tomcat.  But
the development with Jetty in Eclipse is very simple and convenient since
you can run the start class in debug mode, and it will start an embedded
server and eclipse will pick up HTML / class file changes.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Mon, Oct 6, 2008 at 6:37 PM, Vernon [EMAIL PROTECTED] wrote:

 I just dip into Wicket. I notice that Wicket setup exclusively with Jetty,
 for example, the quick start page http://wicket.apache.org/quickstart.html.
 Can I create an Eclipse project for TC instead of Jetty?







  

Patch for ModalWindow?

2008-10-06 Thread rmorrisey

wicket 1.3.4
I have a small addition to ModalWindow that I think would be useful as a
patch. Please tell me what you think.

The idea is hook in an IAjaxCallDecorator on the WindowClosedCallback
request (before WindowClosedCallback.onClose() finished and repaints the
page containing the ModalWindow). It does this by letting the user set an
IAjaxCallDecorator on the ModalWindow itself, which is then used when the
WindowClosedBehavior is rendered.

In our system we use a ModalWindow to pick items that will be displayed on
the page. The ModalWindow takes a couple of seconds to repaint the
containing page after it is closed (this is the ajax request where
WindowClosedCallback.onClose() is called). The call decorator can do
something before WindowClosedCallback.onClose() finishes, like displaying a
wicket ajax indicator icon.

http://www.nabble.com/file/p19849489/ModalWindow.java ModalWindow.java 

-- 
View this message in context: 
http://www.nabble.com/Patch-for-ModalWindow--tp19849489p19849489.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: force page reload

2008-10-06 Thread John Krasnay
On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote:
 thanks for your help, serkan.
 
 cool, this works. as a workaround nevertheless:
 
 -i wouldn't want my app to check every single request the existence of
 a parameter which i am going to use in only *one* page anyway
 -what if i have this param passed to another page that doesn't expect
 it? this could easily introduce new bugs
 
 isn't there another easy way to force reloading / not caching a
 page? why isn't setHeaders having any effect? should be
 straightforward - what am i missing here?
 
 thanks again anyone for some pointers!
 
 francisco
 

It seems to me a bit strange to use markup variant for this. You could
have your callback page forward to the correct page like this:

public CallbackPage(PageParameters params) {
if (params.getString(DATA).equals(good)) {
setResponsePage(PaymentGoodPage.class);
} else {
setResponsePage(TryAgainPage.class);
}
}

Alternatively, you could instantiate an appropriate panel in your page:

public CallbackPage(PageParameters params) {
if (params.getString(DATA).equals(good)) {
add(new PaymentGoodPanel(responsePanel));
} else {
add(new TryAgainPanel(responsePanel));
}
}


jk

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: HTTPS and FileUpload

2008-10-06 Thread Igor Vaynberg
hmm, create a jira issue. mabe if you override getmaxsize on the form
and return -1 or null -indicating you dont care, we should not error
out

-igor

On Mon, Oct 6, 2008 at 4:10 AM, Uwe Schäfer [EMAIL PROTECTED] wrote:
 hi

 i think i hit a bug within wicket (or maybe it is a bug within the
 appserver?).

 i have a FileUpload on a wicket form and everything is smooth, _until_ it is
 taken to https.
 it looks like in https, the request does not (at least in caucho resin) tell
 the size of the request. This means (whatever maxSize is defined) wicket
 rejects to process it:

 org.apache.wicket.util.upload.FileUploadBase:236 (wicket 1.4m3)

 if (requestSize == -1)
 {
  throw new UnknownSizeException( the request
 was rejected because its size is unknown);
 }

 is there a way around, or does this sanity check break on https?

 cu uwe

 ps: shall i open an isue for that? i just commented those lines out locally
 and it works nicely with http as well as http.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket on Tomcat?

2008-10-06 Thread Igor Vaynberg
use maven archetype to create a quickstart
mvn package
take the generated war and drop it into tomcat

-igor

On Mon, Oct 6, 2008 at 5:59 PM, Vernon [EMAIL PROTECTED] wrote:
 Thanks for your quick response.

 How I shall take actions then?

 Sorry for this dumb question.



 - Original Message 
 From: Jeremy Thomerson [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Sent: Monday, October 6, 2008 4:42:22 PM
 Subject: Re: Wicket on Tomcat?

 Yes - it's a regular web app, and you build it into a regular war just like
 normal.  Most of my production applications are deployed with Tomcat.  But
 the development with Jetty in Eclipse is very simple and convenient since
 you can run the start class in debug mode, and it will start an embedded
 server and eclipse will pick up HTML / class file changes.

 --
 Jeremy Thomerson
 http://www.wickettraining.com

 On Mon, Oct 6, 2008 at 6:37 PM, Vernon [EMAIL PROTECTED] wrote:

 I just dip into Wicket. I notice that Wicket setup exclusively with Jetty,
 for example, the quick start page http://wicket.apache.org/quickstart.html.
 Can I create an Eclipse project for TC instead of Jetty?









-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: force page reload

2008-10-06 Thread Jeremy Thomerson
I'd wholeheartedly agree with the panel solution.  Either one would work,
but I think the panel is really good.



-- 
Jeremy Thomerson
http://www.wickettraining.com

On Mon, Oct 6, 2008 at 9:53 PM, John Krasnay [EMAIL PROTECTED] wrote:

 On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote:
  thanks for your help, serkan.
 
  cool, this works. as a workaround nevertheless:
 
  -i wouldn't want my app to check every single request the existence of
  a parameter which i am going to use in only *one* page anyway
  -what if i have this param passed to another page that doesn't expect
  it? this could easily introduce new bugs
 
  isn't there another easy way to force reloading / not caching a
  page? why isn't setHeaders having any effect? should be
  straightforward - what am i missing here?
 
  thanks again anyone for some pointers!
 
  francisco
 

 It seems to me a bit strange to use markup variant for this. You could
 have your callback page forward to the correct page like this:

 public CallbackPage(PageParameters params) {
if (params.getString(DATA).equals(good)) {
setResponsePage(PaymentGoodPage.class);
} else {
setResponsePage(TryAgainPage.class);
}
 }

 Alternatively, you could instantiate an appropriate panel in your page:

 public CallbackPage(PageParameters params) {
if (params.getString(DATA).equals(good)) {
add(new PaymentGoodPanel(responsePanel));
} else {
add(new TryAgainPanel(responsePanel));
}
 }


 jk

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Nice urls in markup

2008-10-06 Thread Jeremy Thomerson
fallback links do this:

generate normal HREF for non-ajax (or JS disabled) requests

add an onclick handler that handles the request via AJAX if possible, and
then returns false if JS was enabled.  this causes the normal HREF url to
never be visited.

hope this helps.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Mon, Oct 6, 2008 at 2:59 AM, Liz Huber [EMAIL PROTECTED] wrote:

 That is the intention, the fallback links only work when javascript is
 enabled.

 According to the book wicket in action the intention of a fallback link
 is, that it acts like a usual link, if java script is disabled. Or did I
 get this wrong?



  I think you should mount your pages like this:
  mount(new HybridUrlCodingStrategy(home/project, ProjectPage.class));
  mount(new HybridUrlCodingStrategy(home/team, TeamPage.class));

 This would be great, but I can't do this, because project and team
 aren't single pages.

 Once, panel project is displayed in page home and once panel team is
 shown (depending on what the user selected in menu).

 Each panel has its own class, but only page classes can be mounted.



 Does anyone still have an idea?

 Liz





  - Original Message -
  From: Erik van Oosten
  Sent: 09/26/08 04:29 pm
  To: users@wicket.apache.org
  Subject: Re: Nice urls in markup
 
  Liz,
   The href-Element of my Ajax-Fallbacklinks show a pretty URLs now, but
  the
   fallback links don't work anymore, if JavaScript is disabled.
  
  That is the intention, the fallback links only work when havascript is
  enabled.
 
  I think you should mount your pages like this:
  mount(new HybridUrlCodingStrategy(home/project, ProjectPage.class));
  mount(new HybridUrlCodingStrategy(home/team, TeamPage.class));
 
  Regards,
  Erik.
 
 
  Liz Huber wrote:
   First of all: Thanks a lot for trying to help me, Erik!
  
   The href-Element of my Ajax-Fallbacklinks show a pretty URLs now, but
  the
   fallback links don't work anymore, if JavaScript is disabled.
   ul
  lia href=home id=navMail__itema onclick=var
  
 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
   function() {return Wicket.$('navMail__itema') !=
  null;}.bind(this));return
   !wcall;spanProducts/span/a/li
   /ul
   ul
  lia href=home id=navMail__itemb onclick=var
  
 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
   function() {return Wicket.$('navMail__itemb') !=
  null;}.bind(this));return
   !wcall;spanTeam/span/a/li
   /ul
  
   The thing I'd like to do is to mount a different, meaningful URLs for
  each
   Ajax-Fallbacklink. This URL should be shown in markup and within the
   address line of the browser. And of course, the link should work
   afterwards:
   ul
  lia href=home/products id=navMail__itema onclick=var
  
 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
   function() {return Wicket.$('navMail__itema') !=
  null;}.bind(this));return
   !wcall;spanProducts/span/a/li
   /ul
   ul
  lia href=home/team id=navMail__itemb onclick=var
  
 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
   function() {return Wicket.$('navMail__itemb') !=
  null;}.bind(this));return
   !wcall;spanTeam/span/a/li
   /ul
  
   I've been wondering, if it is even possible to do that. Could anyone
  try to
   help, please?
  
   Thanks,
   Liz
  
  
  
  
  
   - Original Message -
   From: Erik van Oosten
   Sent: 25/09/08 02:39 pm
   To: users@wicket.apache.org
   Subject: Re: Nice urls in markup
  
   Use a HybridUrlCodingStrategy to mount your pages. This will make ajax
   request link to a similar URL as the page your are mounting (it adds a
   number).
  
   Regards,
   Erik.
  
   Liz Huber wrote:
  
   I'm trying to beautify all wicket urls of my application by mounting
  
   the
  
   pages to meaningful paths.
   Thereby the urls become pretty in the browser's address line.
  
   But within the rendered markup links and images still have non
  formated
   wicket urls.
   So I mounted the images as shared resources and successfully tricked
  by
   overwriting methode onComponentTag():
  
   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   tag.put(src, urlFor(getImageResourceReference()).toString());
   }
  
   The same way I proceeded concerning links: I mounted the referenced
  
   page
  
   and overwrote methode onComponentTag():
  
   @Override
   protected void onComponentTag(ComponentTag tag) {
   super.onComponentTag(tag);
   if (clazz != null) {
   tag.put(href, urlFor(clazz, null)); //where clazz =
   Class.forName(getDefaultModelObjectAsString());
   } else {
   tag.remove(href);
   }
   }
  
   This works pretty well and the urls 

Re: which browser is preferrable for Wicket 1.3

2008-10-06 Thread Timo Rantalaiho
On Mon, 06 Oct 2008, Nino Saturnino Martinez Vazquez Wael wrote:
 Yes since the browsers support their own subset of commands.

And have differences in the DOM tree and javascript event 
propagation.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Having Wicket append #someanchor

2008-10-06 Thread Nino Saturnino Martinez Vazquez Wael

:)

kan wrote:

http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs-Howtoadd%23anchor(opaque)topageurl%3F

2008/10/6 Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:
  

Could you add it to the wiki?

http://cwiki.apache.org/WICKET/

kan wrote:


I've made custom url coding strategy which finds key named # in
PageParameters and encodes it as anchor part (opaque part).

2008/10/2 Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]:

  

I would probably just do a simple javascript and make a
headercontribution... But I guess it's not really the standard way when
it
comes to anchors...

Craig Tataryn wrote:



*bump*

On Wed, Oct 1, 2008 at 2:04 PM, Craig Tataryn [EMAIL PROTECTED]
wrote:



  

I was wondering if there is a way to have Wicket append some anchor
information to a response page?

So if I were on: MyPage.html, then they click a submit button and the
server side codes does a setResponsePage(MyPage.class) I would want the
actual page to be MyPage.html#someanchor

A suggestion on ##wicket was to do a redirect through
httpServletResponse
and rewrite the url myself, but I wanted to know if Wicket supported
this
a
bit more out of the box

Thanks!

Craig.

--
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn






  

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







  

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Modeless Window (real or div)

2008-10-06 Thread Nino Saturnino Martinez Vazquez Wael

Why not use wicket modal window, and just override css?

Francisco Diaz Trepat - gmail wrote:

Hi I need to build a pop-up modal window on my application.
I wanted to see if I could get some recomendations or comments.

Obviously I need not to re-enter username and password and work on the same
session.

It could be a div element like the Wicket Dialog, or a real new window.

Thoughts?

thanks,
f(t)

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]