Re: Duplicate Markup Ids

2011-11-14 Thread Jered Myers
The actual object I am working with is more complex than my code 
example.  There was a merge row function that was merging rows 
together.  The merge had a bug where it was merging the row and, in some 
scenarios, creating a new row at the same time.  This meant that both 
the merged row and the extra row had the same component.  It was blowing 
up because I was adding the same component to different rows in the 
repeater.  Doh!


On 11/14/2011 06:52 PM, Jeremy Thomerson wrote:

Curious, what was it?

PS - Sent from a tablet. Please excuse typos, spelling and compiler errors.

-- Jeremy Thomerson http://wickettraining.com Need a CMS for Wicket? 
Use Brix! http://brixcms.org On Nov 14, 2011 7:18 PM, "Jered Myers" 
 wrote:

>  I found the problem.  It was not a Wicket bug as expected.  Thanks for
>  taking the time to look at this anyway.
>
>  On 11/14/2011 03:36 PM, Jered Myers wrote:
>

>>  I forgot to post Wicket version 1.4.18
>>
>>  On 11/14/2011 02:07 PM, Jered Myers wrote:
>>

>>>  The HTML markup is always, so I
>>>  think the answer is no.  I end up with a markup id like "headerLabel8f".
>>>
>>>  On 11/14/2011 12:54 PM, Sven Meier wrote:
>>>

  Do you have markup ids pre-defined in your html markup?

  Sven

  On 11/14/2011 09:39 PM, Jered Myers wrote:


>  I am getting components with duplicate markup ids in my label
>  components.  What can cause this to happen?
>
>  I am letting Wicket set the markup ids.  Only one user is setup in a
>  manner that creates the problem, so in general there is not a duplication
>  problem.  As I understand it the markup id number is coming from the
>  Session's nextSequenceValue method, so I don't see how it could be
>  duplicated.  The components are getting built by multiple instances of 
the
>  same class and added into the same array.  Here is an example reduced 
down
>  to the basic parts:
>
>  Several classes build the MyDisplayRow objects and add them to the
>  same ArrayList...
>  for (DataRow data : myData)
>  {
>MyDisplayRow row = new MyDisplayRow();
>row.setLabelComponent(new Label("headerLabel",
>  data.getTextColumnData());
>getMyRowArrayList().add(row);
>  }
>
>  ...
>  ListView  repeater = new 
ListView("**repeater",
>  myRowArrrayListModel)
>  {
>protected void populateItem(ListItem<**MyDisplayRow>  item)
>{
>  // Here is where I see the duplicate markup ids
>  log.debug(item.getModelObject(**).getLabelComponent().**
>  getMarkupId());
>  item.add(item.getModelObject()**.getLabelComponent());
>}
>  }
>
>


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



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

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

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


Re: Exception Handling in 1.5

2011-11-14 Thread Igor Vaynberg
application.getrequestcyclelisteners().add(new abstractrequestcyclelistener() {
  irequsthandler onexception(e) {
   Throwable cause = e;
   if (cause instanceof WicketRuntimeException) {
   cause = cause.getCause();
   }

   if (cause instanceof InvocationTargetException) {
   cause = cause.getCause();
   }

   if (cause instanceof WicketResourceGoneException
   || cause instanceof ResourceGoneException) {
   return new renderpagerequesthandler(new
ResourceGonePage((WicketResourceGoneException)cause));
   }

   if (cause instanceof ResourceNotFoundException) {
   return new renderpagerequesthandler(new
NotFoundPage((ResourceNotFoundException)cause));
   }
});

-igor

On Mon, Nov 14, 2011 at 3:34 PM, Nelson Segura  wrote:
> Hello,
> I am starting to migrate from 1.4 to 1.5.
> I am having problems trying to figure out exactly what is the best way
> to do the following.
>
> I have some custom exception and some custom pages for when the code
> throws those exception. In 1.4 this seemed trivial. For example
>
>
> ..
>
> public class MyRequestLifecycle extends WebRequestCycle {
>
>    public MyRequestLifecycle(org.apache.wicket.protocol.http.WebApplication
> application,
>                                         WebRequest request,
>                                         Response response) {
>        super(application, request, response);
>    }
>
>    @Override
>    public Page onRuntimeException(Page page, RuntimeException e) {
>        Throwable cause = e;
>        if (cause instanceof WicketRuntimeException) {
>            cause = cause.getCause();
>        }
>
>        if (cause instanceof InvocationTargetException) {
>            cause = cause.getCause();
>        }
>
>        if (cause instanceof WicketResourceGoneException
>                || cause instanceof ResourceGoneException) {
>            return new ResourceGonePage((WicketResourceGoneException)cause);
>        }
>
>        if (cause instanceof ResourceNotFoundException) {
>            return new NotFoundPage((ResourceNotFoundException)cause);
>        }
>        return super.onRuntimeException(page, e);
>    }
>
> }
>
>
> But I can't figure out a clean / easy way to do this in 1.5. I seems
> that I need to write a lot of code to accomplish this.
>
> I am looking at the following links:
>
> https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
> https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html
>
> Problems are:
> - Which class should I be extend or implementing.
> AbstractRequestCycleListener? IExceptionMapper? IRequestHandler?
> - How do I get access to the current page?
> If I return a IRequestHandler, how do I create one. Do I need to
> create one? Can I use the current one? do I need to worry if this is
> part of an AjaxRequest? I have looked at code in
> AbstractRequestCycleListener, SystemMapper, CompoundRequestMapper,
> DefaultExceptionMapper, etc. It all seems too low level compared to
> other Wicket APIs, that makes me think I am missing something.
>
> What should I do?
>
> -Nelson
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Duplicate Markup Ids

2011-11-14 Thread Jeremy Thomerson
Curious, what was it?

PS - Sent from a tablet. Please excuse typos, spelling and compiler errors.

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org
On Nov 14, 2011 7:18 PM, "Jered Myers"  wrote:

> I found the problem.  It was not a Wicket bug as expected.  Thanks for
> taking the time to look at this anyway.
>
> On 11/14/2011 03:36 PM, Jered Myers wrote:
>
>> I forgot to post Wicket version 1.4.18
>>
>> On 11/14/2011 02:07 PM, Jered Myers wrote:
>>
>>> The HTML markup is always , so I
>>> think the answer is no.  I end up with a markup id like "headerLabel8f".
>>>
>>> On 11/14/2011 12:54 PM, Sven Meier wrote:
>>>
 Do you have markup ids pre-defined in your html markup?

 Sven

 On 11/14/2011 09:39 PM, Jered Myers wrote:

> I am getting components with duplicate markup ids in my label
> components.  What can cause this to happen?
>
> I am letting Wicket set the markup ids.  Only one user is setup in a
> manner that creates the problem, so in general there is not a duplication
> problem.  As I understand it the markup id number is coming from the
> Session's nextSequenceValue method, so I don't see how it could be
> duplicated.  The components are getting built by multiple instances of the
> same class and added into the same array.  Here is an example reduced down
> to the basic parts:
>
> Several classes build the MyDisplayRow objects and add them to the
> same ArrayList...
> for (DataRow data : myData)
> {
>  MyDisplayRow row = new MyDisplayRow();
>  row.setLabelComponent(new Label("headerLabel",
> data.getTextColumnData());
>  getMyRowArrayList().add(row);
> }
>
> ...
> ListView repeater = new ListView("**repeater",
> myRowArrrayListModel)
> {
>  protected void populateItem(ListItem<**MyDisplayRow> item)
>  {
>// Here is where I see the duplicate markup ids
>log.debug(item.getModelObject(**).getLabelComponent().**
> getMarkupId());
>item.add(item.getModelObject()**.getLabelComponent());
>  }
> }
>
>

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


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


Re: Duplicate Markup Ids

2011-11-14 Thread Jered Myers
I found the problem.  It was not a Wicket bug as expected.  Thanks for 
taking the time to look at this anyway.


On 11/14/2011 03:36 PM, Jered Myers wrote:

I forgot to post Wicket version 1.4.18

On 11/14/2011 02:07 PM, Jered Myers wrote:
The HTML markup is always , so I 
think the answer is no.  I end up with a markup id like "headerLabel8f".


On 11/14/2011 12:54 PM, Sven Meier wrote:

Do you have markup ids pre-defined in your html markup?

Sven

On 11/14/2011 09:39 PM, Jered Myers wrote:
I am getting components with duplicate markup ids in my label 
components.  What can cause this to happen?


I am letting Wicket set the markup ids.  Only one user is setup in 
a manner that creates the problem, so in general there is not a 
duplication problem.  As I understand it the markup id number is 
coming from the Session's nextSequenceValue method, so I don't see 
how it could be duplicated.  The components are getting built by 
multiple instances of the same class and added into the same 
array.  Here is an example reduced down to the basic parts:


Several classes build the MyDisplayRow objects and add them to the 
same ArrayList...

for (DataRow data : myData)
{
  MyDisplayRow row = new MyDisplayRow();
  row.setLabelComponent(new Label("headerLabel", 
data.getTextColumnData());

  getMyRowArrayList().add(row);
}

...
ListView repeater = new 
ListView("repeater", myRowArrrayListModel)

{
 protected void populateItem(ListItem item)
 {
// Here is where I see the duplicate markup ids

log.debug(item.getModelObject().getLabelComponent().getMarkupId());

item.add(item.getModelObject().getLabelComponent());
 }
}




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



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



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



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



Re: Duplicate Markup Ids

2011-11-14 Thread Jered Myers

I forgot to post Wicket version 1.4.18

On 11/14/2011 02:07 PM, Jered Myers wrote:
The HTML markup is always , so I 
think the answer is no.  I end up with a markup id like "headerLabel8f".


On 11/14/2011 12:54 PM, Sven Meier wrote:

Do you have markup ids pre-defined in your html markup?

Sven

On 11/14/2011 09:39 PM, Jered Myers wrote:
I am getting components with duplicate markup ids in my label 
components.  What can cause this to happen?


I am letting Wicket set the markup ids.  Only one user is setup in a 
manner that creates the problem, so in general there is not a 
duplication problem.  As I understand it the markup id number is 
coming from the Session's nextSequenceValue method, so I don't see 
how it could be duplicated.  The components are getting built by 
multiple instances of the same class and added into the same array.  
Here is an example reduced down to the basic parts:


Several classes build the MyDisplayRow objects and add them to the 
same ArrayList...

for (DataRow data : myData)
{
  MyDisplayRow row = new MyDisplayRow();
  row.setLabelComponent(new Label("headerLabel", 
data.getTextColumnData());

  getMyRowArrayList().add(row);
}

...
ListView repeater = new 
ListView("repeater", myRowArrrayListModel)

{
 protected void populateItem(ListItem item)
 {
// Here is where I see the duplicate markup ids
log.debug(item.getModelObject().getLabelComponent().getMarkupId());
item.add(item.getModelObject().getLabelComponent());
 }
}




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



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



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



Exception Handling in 1.5

2011-11-14 Thread Nelson Segura
Hello,
I am starting to migrate from 1.4 to 1.5.
I am having problems trying to figure out exactly what is the best way
to do the following.

I have some custom exception and some custom pages for when the code
throws those exception. In 1.4 this seemed trivial. For example


..

public class MyRequestLifecycle extends WebRequestCycle {

public MyRequestLifecycle(org.apache.wicket.protocol.http.WebApplication
application,
 WebRequest request,
 Response response) {
super(application, request, response);
}

@Override
public Page onRuntimeException(Page page, RuntimeException e) {
Throwable cause = e;
if (cause instanceof WicketRuntimeException) {
cause = cause.getCause();
}

if (cause instanceof InvocationTargetException) {
cause = cause.getCause();
}

if (cause instanceof WicketResourceGoneException
|| cause instanceof ResourceGoneException) {
return new ResourceGonePage((WicketResourceGoneException)cause);
}

if (cause instanceof ResourceNotFoundException) {
return new NotFoundPage((ResourceNotFoundException)cause);
}
return super.onRuntimeException(page, e);
}

}


But I can't figure out a clean / easy way to do this in 1.5. I seems
that I need to write a lot of code to accomplish this.

I am looking at the following links:

https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html

Problems are:
- Which class should I be extend or implementing.
AbstractRequestCycleListener? IExceptionMapper? IRequestHandler?
- How do I get access to the current page?
If I return a IRequestHandler, how do I create one. Do I need to
create one? Can I use the current one? do I need to worry if this is
part of an AjaxRequest? I have looked at code in
AbstractRequestCycleListener, SystemMapper, CompoundRequestMapper,
DefaultExceptionMapper, etc. It all seems too low level compared to
other Wicket APIs, that makes me think I am missing something.

What should I do?

-Nelson

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



Re: Duplicate Markup Ids

2011-11-14 Thread Jered Myers
The HTML markup is always , so I 
think the answer is no.  I end up with a markup id like "headerLabel8f".


On 11/14/2011 12:54 PM, Sven Meier wrote:

Do you have markup ids pre-defined in your html markup?

Sven

On 11/14/2011 09:39 PM, Jered Myers wrote:
I am getting components with duplicate markup ids in my label 
components.  What can cause this to happen?


I am letting Wicket set the markup ids.  Only one user is setup in a 
manner that creates the problem, so in general there is not a 
duplication problem.  As I understand it the markup id number is 
coming from the Session's nextSequenceValue method, so I don't see 
how it could be duplicated.  The components are getting built by 
multiple instances of the same class and added into the same array.  
Here is an example reduced down to the basic parts:


Several classes build the MyDisplayRow objects and add them to the 
same ArrayList...

for (DataRow data : myData)
{
  MyDisplayRow row = new MyDisplayRow();
  row.setLabelComponent(new Label("headerLabel", 
data.getTextColumnData());

  getMyRowArrayList().add(row);
}

...
ListView repeater = new 
ListView("repeater", myRowArrrayListModel)

{
 protected void populateItem(ListItem item)
 {
// Here is where I see the duplicate markup ids
log.debug(item.getModelObject().getLabelComponent().getMarkupId());
item.add(item.getModelObject().getLabelComponent());
 }
}




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



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



Re: Duplicate Markup Ids

2011-11-14 Thread Sven Meier

Do you have markup ids pre-defined in your html markup?

Sven

On 11/14/2011 09:39 PM, Jered Myers wrote:
I am getting components with duplicate markup ids in my label 
components.  What can cause this to happen?


I am letting Wicket set the markup ids.  Only one user is setup in a 
manner that creates the problem, so in general there is not a 
duplication problem.  As I understand it the markup id number is 
coming from the Session's nextSequenceValue method, so I don't see how 
it could be duplicated.  The components are getting built by multiple 
instances of the same class and added into the same array.  Here is an 
example reduced down to the basic parts:


Several classes build the MyDisplayRow objects and add them to the 
same ArrayList...

for (DataRow data : myData)
{
  MyDisplayRow row = new MyDisplayRow();
  row.setLabelComponent(new Label("headerLabel", 
data.getTextColumnData());

  getMyRowArrayList().add(row);
}

...
ListView repeater = new 
ListView("repeater", myRowArrrayListModel)

{
 protected void populateItem(ListItem item)
 {
// Here is where I see the duplicate markup ids
log.debug(item.getModelObject().getLabelComponent().getMarkupId());
item.add(item.getModelObject().getLabelComponent());
 }
}




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



Duplicate Markup Ids

2011-11-14 Thread Jered Myers
I am getting components with duplicate markup ids in my label 
components.  What can cause this to happen?


I am letting Wicket set the markup ids.  Only one user is setup in a 
manner that creates the problem, so in general there is not a 
duplication problem.  As I understand it the markup id number is coming 
from the Session's nextSequenceValue method, so I don't see how it could 
be duplicated.  The components are getting built by multiple instances 
of the same class and added into the same array.  Here is an example 
reduced down to the basic parts:


Several classes build the MyDisplayRow objects and add them to the same 
ArrayList...

for (DataRow data : myData)
{
  MyDisplayRow row = new MyDisplayRow();
  row.setLabelComponent(new Label("headerLabel", data.getTextColumnData());
  getMyRowArrayList().add(row);
}

...
ListView repeater = new ListView("repeater", 
myRowArrrayListModel)

{
 protected void populateItem(ListItem item)
 {
// Here is where I see the duplicate markup ids
log.debug(item.getModelObject().getLabelComponent().getMarkupId());
item.add(item.getModelObject().getLabelComponent());
 }
}

--
Jered Myers


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



Re: Customizing Error / Validation messages

2011-11-14 Thread anantasthana
Here is the Log messages
I am not sure what it is doing 

DEBUG - AbstractShiroFilter- No FilterChainResolver configured. 
Returning original FilterChain.
DEBUG - ponentStringResourceLoader - component: '[TextField [Component id =
zip]]'; key: 'zip.PatternValidator'
DEBUG - ponentStringResourceLoader - key:
'vendorPanel.vendorForm.zip.zip.PatternValidator'; class:
'com.aspen.web.html.vendor.VendorEditPage'; locale: 'en_US'; Style: 'null';
Variation: 'null'
INFO  - PropertiesFactory  - Loading properties files from
file:/C:/Users/AAsthana/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Aspen/WEB-INF/classes/com/aspen/web/html/vendor/VendorEditPage.properties
with loader
org.apache.wicket.resource.IsoPropertiesFilePropertiesLoader@a606e6
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'com.aspen.web.html.vendor.VendorEditPage'; locale: 'en_US'; Style: 'null';
Variation: 'null'
DEBUG - ponentStringResourceLoader - key:
'vendorForm.zip.zip.PatternValidator'; class:
'com.aspen.web.html.vendor.VendorEditPage$1'; locale: 'en_US'; Style:
'null'; Variation: 'null'
INFO  - PropertiesFactory  - Loading properties files from
file:/C:/Users/AAsthana/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Aspen/WEB-INF/classes/com/aspen/web/html/vendor/VendorEditPanel.properties
with loader
org.apache.wicket.resource.IsoPropertiesFilePropertiesLoader@a606e6
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'com.aspen.web.html.vendor.VendorEditPage$1'; locale: 'en_US'; Style:
'null'; Variation: 'null'
DEBUG - ponentStringResourceLoader - key: 'zip.zip.PatternValidator'; class:
'org.apache.wicket.markup.html.form.Form'; locale: 'en_US'; Style: 'null';
Variation: 'null'
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'org.apache.wicket.markup.html.form.Form'; locale: 'en_US'; Style: 'null';
Variation: 'null'
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'org.apache.wicket.markup.html.form.TextField'; locale: 'en_US'; Style:
'null'; Variation: 'null'
DEBUG - ponentStringResourceLoader - component: '[TextField [Component id =
zip]]'; key: 'zip.PatternValidator'
DEBUG - ponentStringResourceLoader - component: '[TextField [Component id =
zip]]'; key: 'zip.PatternValidator'
DEBUG - ponentStringResourceLoader - key:
'vendorPanel.vendorForm.zip.zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
INFO  - PropertiesFactory  - Loading properties files from
file:/C:/Users/AAsthana/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Aspen/WEB-INF/classes/com/aspen/web/WebAppDescriptor.properties
with loader
org.apache.wicket.resource.IsoPropertiesFilePropertiesLoader@a606e6
INFO  - PropertiesFactory  - Loading properties files from
jar:file:/C:/Users/AAsthana/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Aspen/WEB-INF/lib/wicket-core-1.5.2.jar!/org/apache/wicket/Application.properties
with loader
org.apache.wicket.resource.IsoPropertiesFilePropertiesLoader@a606e6
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
DEBUG - ponentStringResourceLoader - key:
'vendorForm.zip.zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
DEBUG - ponentStringResourceLoader - key: 'zip.zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'com.aspen.web.WebAppDescriptor'; locale: 'en_US'; Style: 'null'; Variation:
'null'
DEBUG - ponentStringResourceLoader - key: 'zip.PatternValidator'; class:
'org.apache.wicket.validation.validator.PatternValidator'; locale: 'en_US';
Style: 'null'; Variation: 'null'
DEBUG - ponentStringResourceLoader - component: '[TextField [Component id =
zip]]'; key: 'PatternValidator'
DEBUG - ponentStringResourceLoader - key:
'vendorPanel.vendorForm.zip.PatternValidator'; class:
'com.aspen.web.html.vendor.VendorEditPage'; locale: 'en_US'; Style: 'null';
Variation: 'null'
DEBUG - ponentStringResourceLoader - key: 'PatternValidator'; class:
'com.aspen.web.html.vendor.VendorEditPage'; locale: 'en_US'; Style: 'null';
Variation: 'null'
DEBUG - ponentStringResourceLoader - key: 'vendorForm.zip.PatternValidator';
class: 'com.aspen.web.html.vendor.VendorEditPage$1'; locale: 'en_US'; Style:
'null'; Variation: 'null'
DEBUG - ponentStringResourceLoader -

Re: Customizing Error / Validation messages

2011-11-14 Thread anantasthana
SO it says it is Loading the Properties file in the debug messages
I have the key as 
pattern =${label} is not a valid zip
but it still shows the regular expression should i try ${pattern} = zip is
invalid ??
Good work on getting I.5.3 released


Martin Grigorov-4 wrote:
> 
> Enable DEBUG logging for
> org.apache.wicket.resource.loader.ComponentStringResourceLoader and
> see whether your .properties file is asked at all.
> 
> On Mon, Nov 14, 2011 at 10:44 AM,   wrote:
>> I tried that it still does not work for some reason I have
>> VendorPage.class VendorPage.html and VendorPage.properties
>> Containing pattern = ${label} is invalid zip. It still shows me the
>> default message. Am I missing a step or doing some thing wrong?
>> --Original Message--
>> From: Martin Grigorov
>> To: users@.apache
>> ReplyTo: users@.apache
>> Subject: Re: Customizing Error / Validation messages
>> Sent: Nov 14, 2011 1:09 AM
>>
>> Hi,
>>
>> On Mon, Nov 14, 2011 at 8:50 AM, anantasthana  wrote:
>>> I am using pattern validator and i on a page named VendorPage and have a
>>> properties file with keys
>>> pattern= Zip
>>> I am using the pattern validator to validate zip code so i want the
>>> message
>>> to say ... is not a valid zip
>>> I dont know if i am doing smoe thing wrong or missing some thing but i
>>> can
>>> not get the message to display correctly.
>>> Thanks
>>
>> Create file VendorPage.properties and put it next to VendorPage.html
>> (make sure it is copied next to VendorPage.class at build time) and
>> put a line like:
>> pattern = ${label} is not a valid zip
>>
>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-wicket.1842946.n4.nabble.com/Customizing-Error-Validation-messages-tp4038582p4038582.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe@.apache
>>> For additional commands, e-mail: users-help@.apache
>>>
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscribe@.apache
>> For additional commands, e-mail: users-help@.apache
>>
>>
>>
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> -
> To unsubscribe, e-mail: users-unsubscribe@.apache
> For additional commands, e-mail: users-help@.apache
> 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Customizing-Error-Validation-messages-tp4038582p4040652.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Custom 404 page is not displayed correctly

2011-11-14 Thread Florian B.
Thanks for the tip but updating Wicket to 1.5.3 did the trick. I was still
running on 1.5-RC1. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-404-page-is-not-displayed-correctly-tp4040091p4040523.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Custom 404 page is not displayed correctly

2011-11-14 Thread Bertrand Guay-Paquet

Hi,

See https://issues.apache.org/jira/browse/WICKET-3602

Your mapping code is the same as mine.

In my error pages, I use this instead of configureResponse :

@Override
protected void setHeaders(WebResponse a_response) {
a_response.setStatus(HttpServletResponse.SC_NOT_FOUND);
super.setHeaders(a_response);
}

@Override
public boolean isErrorPage() {
return true;
}

Cheers,
Bertrand

On 14/11/2011 11:51 AM, Florian B. wrote:

I've implemented a custom 404 Page Not Found page for my web application
based in Wicket 1.5 following the Wicket wiki
(https://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html). I
tried to follow the tutorial as good as possible but it seems to be based on
a Wicket version before 1.5, so there seem to be some changes.

As the HybridUrlCodingStrategy class doesn't exist any more I mounted the
page using this line of code.

/mountPage("/404", PageNotFoundPage.class);/

The *configureResponse()* method of the PageNotFoundPage class looks like
this.

/@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
HttpServletResponse servletResp = (HttpServletResponse)
response.getContainerResponse();
servletResp.setStatus(HttpServletResponse.SC_NOT_FOUND);
}/

*The entry in the web.xml:*

/
 wicket.web
 /web/*
 REQUEST
 ERROR


 jersey
 /api/*



 404
 /web/404

/

My application is normally accessible under the following url.
http://localhost:8080/application/web/store where "store" is a mapping to
the home page of the application.

Now when I browse http://localhost:8080/application/web/404 the
PageNotFoundPage page is displayed as expected and everything seems to be
all right. But when I try to provoke a real 404 error by browsing an URL
(e.g. http://localhost:8080/application/web/thispagedoesntexist) which
doesn't exist something odd happens.

I would expect some kind of redirect to the 404 error page but the URL in
the browser stays the same and the browser shows the 404 PageNotFoundPage
page with the correct title, text and so one. So the error seems to be
recognized and handled by Wicket but the whole layout of the page is
missing. Inspecting the HTML of the page shows me there are some issues with
the URLs and that's why the browser cannot load all the resources like css,
images and so on.

E.g. when calling the 404 page manually (not by provoking an error) the path
to the css file in the HTML is "../STYLE/style.css" which is translated to
by the browser to following absolute URL:
"http://localhost/application/STYLE/style.css";

Now when provoking an 404 error the path to the css file in the HTML is
"../../../../STYLE/style.css" which is translated by the browser to
"http://localhost/STYLE/style.css"; what of course is wrong.

So at the moment I'm a little bit lost how to solve this issue. The 404 page
seems to work, also handling the error seems but both together doesn't.

Any suggestions what to do?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-404-page-is-not-displayed-correctly-tp4040091p4040091.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: RadioChoice model not updated in tomcat with liferay portal

2011-11-14 Thread Gabriel Landon
Portlets are supported in wicket 1.4.x.
I use wicket 1.4.19 with liferay 6.0.5 at the moment and it's working fine.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-model-not-updated-in-tomcat-with-liferay-portal-tp3565419p4040354.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket 1.5.3 Released!

2011-11-14 Thread Igor Vaynberg
gah. looks like Martin already announced it, but didnt put it on the
website...its should be on the website whenever svnpubsub catches
up...

-igor

On Mon, Nov 14, 2011 at 9:17 AM, Igor Vaynberg  wrote:
> This is the third maintenance release of the Wicket 1.5.x series. This
> release brings over 40 bug fixes and improvements.
>
> Subversion tag:
> http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5.3
>
> Changelog:
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561&version=12318550
>
> Maven:
> 
>    org.apache.wicket
>    wicket-core
>    1.5.3
> 
>
>
> Download the full distribution (including source):
> http://www.apache.org/dyn/closer.cgi/wicket/1.5.3
>
> -igor
>

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



Wicket 1.5.3 Released!

2011-11-14 Thread Igor Vaynberg
This is the third maintenance release of the Wicket 1.5.x series. This
release brings over 40 bug fixes and improvements.

Subversion tag:
http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5.3

Changelog:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561&version=12318550

Maven:

org.apache.wicket
wicket-core
1.5.3



Download the full distribution (including source):
http://www.apache.org/dyn/closer.cgi/wicket/1.5.3

-igor

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



Custom 404 page is not displayed correctly

2011-11-14 Thread Florian B.
I've implemented a custom 404 Page Not Found page for my web application
based in Wicket 1.5 following the Wicket wiki
(https://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html). I
tried to follow the tutorial as good as possible but it seems to be based on
a Wicket version before 1.5, so there seem to be some changes. 

As the HybridUrlCodingStrategy class doesn't exist any more I mounted the
page using this line of code. 

/mountPage("/404", PageNotFoundPage.class);/

The *configureResponse()* method of the PageNotFoundPage class looks like
this. 

/@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
HttpServletResponse servletResp = (HttpServletResponse)
response.getContainerResponse();
servletResp.setStatus(HttpServletResponse.SC_NOT_FOUND);
}/

*The entry in the web.xml:*

/
wicket.web
/web/*
REQUEST
ERROR


jersey
/api/*



404
/web/404

/

My application is normally accessible under the following url.
http://localhost:8080/application/web/store where "store" is a mapping to
the home page of the application. 

Now when I browse http://localhost:8080/application/web/404 the
PageNotFoundPage page is displayed as expected and everything seems to be
all right. But when I try to provoke a real 404 error by browsing an URL
(e.g. http://localhost:8080/application/web/thispagedoesntexist) which
doesn't exist something odd happens. 

I would expect some kind of redirect to the 404 error page but the URL in
the browser stays the same and the browser shows the 404 PageNotFoundPage
page with the correct title, text and so one. So the error seems to be
recognized and handled by Wicket but the whole layout of the page is
missing. Inspecting the HTML of the page shows me there are some issues with
the URLs and that's why the browser cannot load all the resources like css,
images and so on. 

E.g. when calling the 404 page manually (not by provoking an error) the path
to the css file in the HTML is "../STYLE/style.css" which is translated to
by the browser to following absolute URL:
"http://localhost/application/STYLE/style.css";

Now when provoking an 404 error the path to the css file in the HTML is
"../../../../STYLE/style.css" which is translated by the browser to
"http://localhost/STYLE/style.css"; what of course is wrong. 

So at the moment I'm a little bit lost how to solve this issue. The 404 page
seems to work, also handling the error seems but both together doesn't.

Any suggestions what to do?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-404-page-is-not-displayed-correctly-tp4040091p4040091.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to create a download link that is not cached by the browsers?

2011-11-14 Thread Chantal Ackermann
Hi Ismael,

here is the code for a non-cached download link. (I don't know whether
this really solves your problem but just in case.)


final NamesCsvStreamWriter stream = new NamesCsvStreamWriter();
ResourceStreamResource rsr = new ResourceStreamResource(stream) {
@Override
protected ResourceResponse newResourceResponse(Attributes attributes) {
stream.initContent(provider.getFilteredList());
return super.newResourceResponse(attributes);
}

@Override
protected void configureCache(ResourceResponse data,
Attributes attributes) {
Response response = attributes.getResponse();
((WebResponse)response).disableCaching();
}
};
rsr.setContentDisposition(ContentDisposition.ATTACHMENT);
rsr.setTextEncoding(UTF_8);
rsr.setFileName("export.csv");
form.add(new ResourceLink("export", rsr));


Cheers,
Chantal


On Mon, 2011-11-14 at 12:39 +0100, Ismael Hasan wrote:
> Hello,
> 
> I want to make a DownloadLink for a dynamic resource, a file generated on
> the fly; to do this, I overwrite the "onClick" method of DownloadLink so
> the file is generated whenever the link is clicked. In the context of my
> problem, it should happen that 2 clicks on the link should return different
> files without reloading the page.
> 
> The problem I am facing is that the browser caches the link by its "src"
> attribute, so the "onClick" method is only called the first time: with the
> next clicks the browser directly returns the file generated in the first
> "onClick" (and previously downloaded).
> 
> Is there a clean solution to this problem? The solutions I thought so far
> are pretty dirty:
> 
> 1.- Instead of having a link, have a list of links, generate a new link
> whenever the link is clicked, and refresh the list via Ajax, so instead of
> a "dynamic" link there will be a new link each time.
> 2.- Add to the link a "foo" parameter each time it is clicked, so the
> browser sees it as a different link. I don't know how to do this, any
> insight will be appreciated.
> 
> 
> Thank you for your attention,
> 
> Ismael.


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



Re: Capture the response of a page request and displays another page as result

2011-11-14 Thread Martin Grigorov
Link#onClick() {
String pageAsString = doItLikeInTheExample();

scheduleRequestHandlerAfterCurrent(new TextRequestHandler(pasAsString));

}

On Mon, Nov 14, 2011 at 5:15 PM, Dirk Forchel  wrote:
> Oh dear, I still don't get it. I miss the forest through the trees ... where
> and how should I implement the forward to the other static result page? And
> what is the equivalent for
> CapturingBookmarkablePageRequestTarget#onCapture(stringResponse)?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Capture-the-response-of-a-page-request-and-displays-another-page-as-result-tp4039468p4039748.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Capture the response of a page request and displays another page as result

2011-11-14 Thread Dirk Forchel
Oh dear, I still don't get it. I miss the forest through the trees ... where
and how should I implement the forward to the other static result page? And
what is the equivalent for
CapturingBookmarkablePageRequestTarget#onCapture(stringResponse)?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Capture-the-response-of-a-page-request-and-displays-another-page-as-result-tp4039468p4039748.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Capture the response of a page request and displays another page as result

2011-11-14 Thread Martin Grigorov
On Mon, Nov 14, 2011 at 4:04 PM, Dirk Forchel  wrote:
> I know this example, but in my opinion this is not really the same use-case,
> isn't it? Or I don't fully understand this example. The mailtemplate example
> uses a link to generate an email (e.g. generated by the rendering of the
> TemplateBaseOnPage) and replaces the content of the MultiLineLabel
> afterwards.
> I wanna call the following request
> http://localhost:8080/shop/de/generate?suffix=01 and forward to a static
> result page afterwards, e.g. generate some stuff and display a result
> message if the generation was successful.

The only difference I see is that instead of displaying the generated
html (as MailTemplate does) you want to check whether it was generated
or not...

>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Capture-the-response-of-a-page-request-and-displays-another-page-as-result-tp4039468p4039567.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Capture the response of a page request and displays another page as result

2011-11-14 Thread Dirk Forchel
I know this example, but in my opinion this is not really the same use-case,
isn't it? Or I don't fully understand this example. The mailtemplate example
uses a link to generate an email (e.g. generated by the rendering of the
TemplateBaseOnPage) and replaces the content of the MultiLineLabel
afterwards. 
I wanna call the following request
http://localhost:8080/shop/de/generate?suffix=01 and forward to a static
result page afterwards, e.g. generate some stuff and display a result
message if the generation was successful. 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Capture-the-response-of-a-page-request-and-displays-another-page-as-result-tp4039468p4039567.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Capture the response of a page request and displays another page as result

2011-11-14 Thread Martin Grigorov
See the source of
http://www.wicket-library.com/wicket-examples/mailtemplate example

On Mon, Nov 14, 2011 at 3:31 PM, Dirk Forchel  wrote:
> With Wicket 1.4 we used the CapturingBookmarkablePageRequestTarget (and the
> belonging CapturingBookmarkablePageRequestTargetUrlCodingStrategy) from the
> static examples to capture the response of a page request and display
> another page as result instead. I still don't know how to achieve the same
> with Wicket 1.5.
>
> public abstract class CapturingBookmarkablePageRequestTarget extends
> BookmarkablePageRequestTarget
> {
>        ...
>
>        @Override
>        public void respond(final RequestCycle requestCycle)
>        {
>                final StringResponse stringResponse = new StringResponse();
>                final WebResponse originalResponse =
> (WebResponse)RequestCycle.get().getResponse();
>                RequestCycle.get().setResponse(stringResponse);
>                super.respond(requestCycle);
>                // handle the string response
>                onCapture(stringResponse);
>                RequestCycle.get().setResponse(originalResponse);
>                RequestCycle.get().setRequestTarget(new
> BookmarkablePageRequestTarget(displayedPageClass, getPageParameters()));
>        }
>
>        protected abstract void onCapture(StringResponse stringResponse);
> }
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Capture-the-response-of-a-page-request-and-displays-another-page-as-result-tp4039468p4039468.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Capture the response of a page request and displays another page as result

2011-11-14 Thread Dirk Forchel
With Wicket 1.4 we used the CapturingBookmarkablePageRequestTarget (and the
belonging CapturingBookmarkablePageRequestTargetUrlCodingStrategy) from the
static examples to capture the response of a page request and display
another page as result instead. I still don't know how to achieve the same
with Wicket 1.5. 

public abstract class CapturingBookmarkablePageRequestTarget extends
BookmarkablePageRequestTarget
{
...

@Override
public void respond(final RequestCycle requestCycle)
{
final StringResponse stringResponse = new StringResponse();
final WebResponse originalResponse =
(WebResponse)RequestCycle.get().getResponse();
RequestCycle.get().setResponse(stringResponse);
super.respond(requestCycle);
// handle the string response
onCapture(stringResponse);
RequestCycle.get().setResponse(originalResponse);
RequestCycle.get().setRequestTarget(new
BookmarkablePageRequestTarget(displayedPageClass, getPageParameters()));
}

protected abstract void onCapture(StringResponse stringResponse);
}


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Capture-the-response-of-a-page-request-and-displays-another-page-as-result-tp4039468p4039468.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: User is still logged in after session should have been expired

2011-11-14 Thread Martin Grigorov
On Mon, Nov 14, 2011 at 3:01 PM, Florian B.  wrote:
> Thanks for the fast reply. It works now!
>
> Adding
>
> getSecuritySettings().setAuthenticationStrategy(new
> NoOpAuthenticationStrategy());
>
> to the application class's init method did the trick. Unfortunately the
> whole topic is very undocumented so it was a little bit hard to find some
> information about it.

We accept patches for documentation too in our Jira :-)

>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/User-is-still-logged-in-after-session-should-have-been-expired-tp4039285p4039379.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: User is still logged in after session should have been expired

2011-11-14 Thread Florian B.
Thanks for the fast reply. It works now!

Adding 

getSecuritySettings().setAuthenticationStrategy(new
NoOpAuthenticationStrategy());

to the application class's init method did the trick. Unfortunately the
whole topic is very undocumented so it was a little bit hard to find some
information about it.  

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/User-is-still-logged-in-after-session-should-have-been-expired-tp4039285p4039379.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to create a download link that is not cached by the browsers?

2011-11-14 Thread Martin Grigorov
https://issues.apache.org/jira/browse/WICKET-4225

On Mon, Nov 14, 2011 at 2:10 PM, Martin Grigorov  wrote:
> Hi,
>
> Today another user complained to me with the same problem.
> I'm working on an improvement.
>
> On Mon, Nov 14, 2011 at 1:39 PM, Ismael Hasan  wrote:
>> Hello,
>>
>> I want to make a DownloadLink for a dynamic resource, a file generated on
>> the fly; to do this, I overwrite the "onClick" method of DownloadLink so
>> the file is generated whenever the link is clicked. In the context of my
>> problem, it should happen that 2 clicks on the link should return different
>> files without reloading the page.
>>
>> The problem I am facing is that the browser caches the link by its "src"
>> attribute, so the "onClick" method is only called the first time: with the
>> next clicks the browser directly returns the file generated in the first
>> "onClick" (and previously downloaded).
>>
>> Is there a clean solution to this problem? The solutions I thought so far
>> are pretty dirty:
>>
>> 1.- Instead of having a link, have a list of links, generate a new link
>> whenever the link is clicked, and refresh the list via Ajax, so instead of
>> a "dynamic" link there will be a new link each time.
>> 2.- Add to the link a "foo" parameter each time it is clicked, so the
>> browser sees it as a different link. I don't know how to do this, any
>> insight will be appreciated.
>>
>>
>> Thank you for your attention,
>>
>> Ismael.
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: abort loading lazy components

2011-11-14 Thread Martin Grigorov
Ticket + quickstart

On Mon, Nov 14, 2011 at 2:39 PM, Michal Wegrzyn
 wrote:
> Just tried with 1.5.3 - unfortunately I still get an exception.
>
>> -Original Message-
>> From: Martin Grigorov [mailto:mgrigo...@apache.org]
>> Sent: Thursday, November 10, 2011 14:50
>> To: users@wicket.apache.org
>> Subject: Re: abort loading lazy components
>>
>> This is fixed in 1.5.3 (currently in voting)
>>
>> On Thu, Nov 10, 2011 at 3:37 PM, Michal Wegrzyn
>>  wrote:
>> >> -Original Message-
>> >> From: Martin Grigorov [mailto:mgrigo...@apache.org]
>> >> Sent: Thursday, November 10, 2011 9:48
>> >> To: users@wicket.apache.org
>> >> Subject: Re: abort loading lazy components
>> >>
>> >> Hi,
>> >>
>> >> I see no solution for your case.
>> >> Using BookmarkablePageLink works as you confirmed but I'm not aware
>> of
>> >> clean way to cancel running Ajax requests and replace them with
>> >> completely new one.
>> >>
>> >> XMLHttpRequest has #abort() method which cancels the request but
>> this
>> >> will lead co "socket close exception"s in the server side.
>> >>
>> >
>> > Right, I've already looked at XMLHttpRequest#abort(). It wouldn't be
>> a "clean" solution anyway.
>> >
>> >> The best approach I see is to use the same AjaxChannel name for all
>> >> LazyLoadPanels and the AjaxLinks. The LazyLoadPanels should use type
>> >> QUEUE and the AjaxLinks - type DROP. This way all LazyLoadPanels
>> will
>> >> load sequencially and if you click an AjaxLink it will cancel all
>> >> pending LazyLoadPanels and will schedule the execution of the
>> AjaxLink
>> >> after the end of the currently loading LazyLoadPanel
>> >>
>> >> HTH
>> >
>> > That's what I've already done - Wicket schedules and executes
>> AjaxLink action (it does not wait for other lazy panels - so far, so
>> good ), but then (already during handling new ajax request) Wicket
>> throws exception. Isn't it a Wicket bug?
>> >
>> > 15:31:11.847 user [http--2] WARN
>>  o.a.w.r.h.render.WebPageRenderer - The Buffered response should be
>> handled by BufferedResponseRequestHandler
>> > 15:32:24.028 user [http--5] ERROR
>> o.a.wicket.DefaultExceptionMapper - Unexpected error occurred
>> > org.apache.wicket.request.handler.ComponentNotFoundException: Could
>> not find component
>> 'folders:listContainer:itemList:29:itemPanel:folder:children' on page
>> 'class package.MyPage
>> >        at
>> org.apache.wicket.request.handler.PageAndComponentProvider.getComponent
>> (PageAndComponentProvider.java:167)
>> >        at
>> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getCo
>> mponent(ListenerInterfaceRequestHandler.java:92)
>> >        at
>> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respo
>> nd(ListenerInterfaceRequestHandler.java:169)
>> >        at
>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(Re
>> questCycle.java:750)
>> >        at
>> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerSta
>> ck.java:64)
>> >        at
>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:
>> 252)
>> >        at
>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycl
>> e.java:209)
>> >        at
>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(Re
>> questCycle.java:280)
>> >        at
>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilte
>> r.java:162)
>> >        at
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
>> :218)
>> >        at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
>> ationFilterChain.java:235)
>> >        at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
>> terChain.java:206)
>> >        at
>> package.MyRequestContextFilter.doFilter(MyRequestContextFilter.java:43)
>> >        at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
>> ationFilterChain.java:235)
>> >        at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
>> terChain.java:206)
>> >        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
>> Filter(FilterChainProxy.java:368)
>> >        at
>> org.springframework.security.web.access.intercept.FilterSecurityInterce
>> ptor.invoke(FilterSecurityInterceptor.java:109)
>> >        at
>> org.springframework.security.web.access.intercept.FilterSecurityInterce
>> ptor.doFilter(FilterSecurityInterceptor.java:83)
>> >        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
>> Filter(FilterChainProxy.java:380)
>> >        at
>> org.springframework.security.web.access.ExceptionTranslationFilter.doFi
>> lter(ExceptionTranslationFilter.java:97)
>> >        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
>> Filter(FilterChainProxy.java:380)
>> >        at
>> org.springframework.security.web.session.SessionManagementFilter.doFilt
>> er(SessionManagementFilter.java:100)

RE: abort loading lazy components

2011-11-14 Thread Michal Wegrzyn
Just tried with 1.5.3 - unfortunately I still get an exception.

> -Original Message-
> From: Martin Grigorov [mailto:mgrigo...@apache.org]
> Sent: Thursday, November 10, 2011 14:50
> To: users@wicket.apache.org
> Subject: Re: abort loading lazy components
>
> This is fixed in 1.5.3 (currently in voting)
>
> On Thu, Nov 10, 2011 at 3:37 PM, Michal Wegrzyn
>  wrote:
> >> -Original Message-
> >> From: Martin Grigorov [mailto:mgrigo...@apache.org]
> >> Sent: Thursday, November 10, 2011 9:48
> >> To: users@wicket.apache.org
> >> Subject: Re: abort loading lazy components
> >>
> >> Hi,
> >>
> >> I see no solution for your case.
> >> Using BookmarkablePageLink works as you confirmed but I'm not aware
> of
> >> clean way to cancel running Ajax requests and replace them with
> >> completely new one.
> >>
> >> XMLHttpRequest has #abort() method which cancels the request but
> this
> >> will lead co "socket close exception"s in the server side.
> >>
> >
> > Right, I've already looked at XMLHttpRequest#abort(). It wouldn't be
> a "clean" solution anyway.
> >
> >> The best approach I see is to use the same AjaxChannel name for all
> >> LazyLoadPanels and the AjaxLinks. The LazyLoadPanels should use type
> >> QUEUE and the AjaxLinks - type DROP. This way all LazyLoadPanels
> will
> >> load sequencially and if you click an AjaxLink it will cancel all
> >> pending LazyLoadPanels and will schedule the execution of the
> AjaxLink
> >> after the end of the currently loading LazyLoadPanel
> >>
> >> HTH
> >
> > That's what I've already done - Wicket schedules and executes
> AjaxLink action (it does not wait for other lazy panels - so far, so
> good ), but then (already during handling new ajax request) Wicket
> throws exception. Isn't it a Wicket bug?
> >
> > 15:31:11.847 user [http--2] WARN
>  o.a.w.r.h.render.WebPageRenderer - The Buffered response should be
> handled by BufferedResponseRequestHandler
> > 15:32:24.028 user [http--5] ERROR
> o.a.wicket.DefaultExceptionMapper - Unexpected error occurred
> > org.apache.wicket.request.handler.ComponentNotFoundException: Could
> not find component
> 'folders:listContainer:itemList:29:itemPanel:folder:children' on page
> 'class package.MyPage
> >at
> org.apache.wicket.request.handler.PageAndComponentProvider.getComponent
> (PageAndComponentProvider.java:167)
> >at
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getCo
> mponent(ListenerInterfaceRequestHandler.java:92)
> >at
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respo
> nd(ListenerInterfaceRequestHandler.java:169)
> >at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(Re
> questCycle.java:750)
> >at
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerSta
> ck.java:64)
> >at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:
> 252)
> >at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycl
> e.java:209)
> >at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(Re
> questCycle.java:280)
> >at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilte
> r.java:162)
> >at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
> :218)
> >at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> ationFilterChain.java:235)
> >at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> terChain.java:206)
> >at
> package.MyRequestContextFilter.doFilter(MyRequestContextFilter.java:43)
> >at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> ationFilterChain.java:235)
> >at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> terChain.java:206)
> >at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
> Filter(FilterChainProxy.java:368)
> >at
> org.springframework.security.web.access.intercept.FilterSecurityInterce
> ptor.invoke(FilterSecurityInterceptor.java:109)
> >at
> org.springframework.security.web.access.intercept.FilterSecurityInterce
> ptor.doFilter(FilterSecurityInterceptor.java:83)
> >at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
> Filter(FilterChainProxy.java:380)
> >at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFi
> lter(ExceptionTranslationFilter.java:97)
> >at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
> Filter(FilterChainProxy.java:380)
> >at
> org.springframework.security.web.session.SessionManagementFilter.doFilt
> er(SessionManagementFilter.java:100)
> >at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.do
> Filter(FilterChainProxy.java:380)
> >at
> org.springframework.security.web.authentication.AnonymousAuth

Re: User is still logged in after session should have been expired

2011-11-14 Thread Martin Grigorov
Hi,

With WICKET-4014 Wicket will not throw PageExpiredException if the
mount path is available and a new page may be instantiated.
For example if the link url looks like:
/mountPoint?3-2.ILinkListener.0 then Wicket will look for page
with id == 3 and if it is not found then it will use 'mountPoint' to
instantiate a new instance of that page class.

But if the link doesn't bring information that can be used to create a
new instance then PageExpiredException will be thrown.
For example: /wicket/page?3-2.ILinkListener.0 will throw PEX.

In both cases the user session must be gone. If you have configured
IAuthenticationStrategy then Wicket will lead you to your login page.

On Mon, Nov 14, 2011 at 2:14 PM, Florian B.  wrote:
> I've got some problems with the session of my Wicket web application.
>
> After adding custom error pages to my web application I did some test to see
> whether they work as expected.
>
> During the test I encountered some strange behavior. In the web.xml I set
> the session timeout to 1 minute
>  using the following xml.
> 
>    1
> 
>
> For the test I started the web application, and logged into the application
> using a test user. Then I waited for several minutes and clicked a link in
> the menu to provoke an page expired error to see my custom error page. But
> this never happens. After clicking the link the page loads normally and the
> user is still logged in.
>
> I expected the following. Clicking the link leads to a page expiration
> therefore the custom expiration page  would be shown and then when clicking
> the link on the expiration page the login page would be shown as the user's
> session has ended.
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/User-is-still-logged-in-after-session-should-have-been-expired-tp4039285p4039285.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread Ernesto Reinaldo Barreiro
ArrayItemOptions is just an array list. Something like

ArrayItemOptions options =
new ArrayItemOptions();
options.add(new IntegerItemOptions(value1));
options.add(new IntegerItemOptions(value2));

should do it.

Ernesto

On Mon, Nov 14, 2011 at 1:15 PM, odin568  wrote:
> Ok thanks. But I have one problem implementing this:
>
> setValues needs parameter of type ArrayItemOptions
>
> How do I put my int's into this type?? Don't know how to handle that :-S
> sorry
>
> Thanks!
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039287.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread Ernesto Reinaldo Barreiro
I just added to head a method

public Slider setValues(Integer value1, Integer value2)

that simplifies things.

Ernesto


On Mon, Nov 14, 2011 at 1:03 PM, Ernesto Reinaldo Barreiro
 wrote:
> yes you are right. I think what you need is
>
> public Slider setValues(ArrayItemOptions values)
>        {
>                this.options.put("values", values);
>                return this;
>        }
>
> On Mon, Nov 14, 2011 at 12:57 PM, odin568  wrote:
>> Hi,
>> no, this sets the complete range of the slider as in the constructor (in my
>> example 0 and 100).
>>
>> Thanks.
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039247.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread odin568
Ok thanks. But I have one problem implementing this:

setValues needs parameter of type ArrayItemOptions 

How do I put my int's into this type?? Don't know how to handle that :-S
sorry

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039287.html
Sent from the Users forum mailing list archive at Nabble.com.

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



User is still logged in after session should have been expired

2011-11-14 Thread Florian B.
I've got some problems with the session of my Wicket web application. 

After adding custom error pages to my web application I did some test to see
whether they work as expected. 

During the test I encountered some strange behavior. In the web.xml I set
the session timeout to 1 minute 
 using the following xml. 

1


For the test I started the web application, and logged into the application
using a test user. Then I waited for several minutes and clicked a link in
the menu to provoke an page expired error to see my custom error page. But
this never happens. After clicking the link the page loads normally and the
user is still logged in. 

I expected the following. Clicking the link leads to a page expiration
therefore the custom expiration page  would be shown and then when clicking
the link on the expiration page the login page would be shown as the user's
session has ended. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/User-is-still-logged-in-after-session-should-have-been-expired-tp4039285p4039285.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to create a download link that is not cached by the browsers?

2011-11-14 Thread Martin Grigorov
Hi,

Today another user complained to me with the same problem.
I'm working on an improvement.

On Mon, Nov 14, 2011 at 1:39 PM, Ismael Hasan  wrote:
> Hello,
>
> I want to make a DownloadLink for a dynamic resource, a file generated on
> the fly; to do this, I overwrite the "onClick" method of DownloadLink so
> the file is generated whenever the link is clicked. In the context of my
> problem, it should happen that 2 clicks on the link should return different
> files without reloading the page.
>
> The problem I am facing is that the browser caches the link by its "src"
> attribute, so the "onClick" method is only called the first time: with the
> next clicks the browser directly returns the file generated in the first
> "onClick" (and previously downloaded).
>
> Is there a clean solution to this problem? The solutions I thought so far
> are pretty dirty:
>
> 1.- Instead of having a link, have a list of links, generate a new link
> whenever the link is clicked, and refresh the list via Ajax, so instead of
> a "dynamic" link there will be a new link each time.
> 2.- Add to the link a "foo" parameter each time it is clicked, so the
> browser sees it as a different link. I don't know how to do this, any
> insight will be appreciated.
>
>
> Thank you for your attention,
>
> Ismael.
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: WebResponse.getOutputStream() in 1.5 ?

2011-11-14 Thread Martin Grigorov
Hi,

See how ResourceLink does it.

On Mon, Nov 14, 2011 at 12:48 PM, Neill Rosenthal  wrote:
> Hello
>
> This code was working for me in 1.4:
>
> WebResponse response = (org.apache.wicket.request.http.WebResponse)
> getResponse();
> response.setAttachmentHeader("List.xls");
> response.setContentType("application/ms-excel");
> OutputStream out = getResponse().getOutputStream();
> WritableWorkbook workbook = Workbook.createWorkbook(out);
> .
> .
> workbook.write();
> workbook.close();
>
> I see in 1.5 that there is no WebResponse.getOutputStream() - but it was
> not marked as deprecated?
>
> I have looked in the 1.5 migration guide but I can't see any obvious
> solution.
>
> Can someone please tell me how I should be doing this in 1.5.
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread Ernesto Reinaldo Barreiro
yes you are right. I think what you need is

public Slider setValues(ArrayItemOptions values)
{
this.options.put("values", values);
return this;
}

On Mon, Nov 14, 2011 at 12:57 PM, odin568  wrote:
> Hi,
> no, this sets the complete range of the slider as in the constructor (in my
> example 0 and 100).
>
> Thanks.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039247.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread odin568
Hi,
no, this sets the complete range of the slider as in the constructor (in my
example 0 and 100). 

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039247.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread Ernesto Reinaldo Barreiro
Can´t  you just use the following methods?

/**
 * Sets the maximum value of the slider.
 *
 * @param max
 * @return instance of the current component
 */
public Slider setMax(Number max)
{
this.options.put("max", max.floatValue());
return this;
}


/**  * Sets the minimum value of the slider. *   * @param min   
 *
@return instance of the current component*/ public Slider
setMin(Number min)  {   this.options.put("min",
min.floatValue());  return this;}

Regards,

Ernesto
On Mon, Nov 14, 2011 at 12:45 PM, odin568  wrote:
> Sorry, I think you missunderstood me:
> Yes, with this constructor, I set the min and max of the Slider.
>
> But I meant to set the values of the range manually.
>
> i.e. I create a range slider from 0 to 100. Then I want to set the two
> positions 10 and 90 as start for the Range.
>
> Thanks!
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039228.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



WebResponse.getOutputStream() in 1.5 ?

2011-11-14 Thread Neill Rosenthal
Hello

This code was working for me in 1.4:

WebResponse response = (org.apache.wicket.request.http.WebResponse)
getResponse();
response.setAttachmentHeader("List.xls");
response.setContentType("application/ms-excel");
OutputStream out = getResponse().getOutputStream();
WritableWorkbook workbook = Workbook.createWorkbook(out);
.
.
workbook.write();
workbook.close();

I see in 1.5 that there is no WebResponse.getOutputStream() - but it was
not marked as deprecated?

I have looked in the 1.5 migration guide but I can't see any obvious
solution.

Can someone please tell me how I should be doing this in 1.5.



How to create a download link that is not cached by the browsers?

2011-11-14 Thread Ismael Hasan
Hello,

I want to make a DownloadLink for a dynamic resource, a file generated on
the fly; to do this, I overwrite the "onClick" method of DownloadLink so
the file is generated whenever the link is clicked. In the context of my
problem, it should happen that 2 clicks on the link should return different
files without reloading the page.

The problem I am facing is that the browser caches the link by its "src"
attribute, so the "onClick" method is only called the first time: with the
next clicks the browser directly returns the file generated in the first
"onClick" (and previously downloaded).

Is there a clean solution to this problem? The solutions I thought so far
are pretty dirty:

1.- Instead of having a link, have a list of links, generate a new link
whenever the link is clicked, and refresh the list via Ajax, so instead of
a "dynamic" link there will be a new link each time.
2.- Add to the link a "foo" parameter each time it is clicked, so the
browser sees it as a different link. I don't know how to do this, any
insight will be appreciated.


Thank you for your attention,

Ismael.


Re: Question regarding wiquery Rangeslider

2011-11-14 Thread odin568
Sorry, I think you missunderstood me:
Yes, with this constructor, I set the min and max of the Slider.

But I meant to set the values of the range manually.

i.e. I create a range slider from 0 to 100. Then I want to set the two
positions 10 and 90 as start for the Range.

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4039228.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to clear PageMap in Wicket 1.5?

2011-11-14 Thread Matthias Keller

Hi Martin

Sorry for the delay, I was busy with other things recently.
Of course you're right, that clearing all pages, including the NextPage 
isn't a smart thing and I don't wanna do that anyway.
But what I need is away to redirect to a new (non-bookmarkable!) 
NextPage while clearing all other stored page instances.
I'll try to illustrate a flow; the user starts on the homepage  
HomePage. All pages are stateful:
HomePage  AnotherPage talking about> NextPage.
Now, when the user is on the NextPage of course all links on THAT page 
do have to work as expected. But all previous page instances (of 
HomePage and AnotherPage) must be cleared from the page store, so that 
if the user clicks BACK in his browser (and would go back to 
AnotherPage), a PageExpiredException must be thrown.
I can achieve that with Session.replaceSession() BEFORE calling 
setResponsePage(new NextPage()) - but this method has additional 
semantics (change the session ID) which I may not want to have.

That's why I came to

getSessionStore().invalidate(RequestCycle.get().getRequest());

which *appears* to do what I want but due to the lack of knowledge of 
the session/pagestore internals I cannot say if it's correct or 
sufficient to do that...


So the important bit is, that when calling a usable  Session.clear(), 
the current page shall not be stored in the session/pagestore anymore...


Thanks

Matt

On 2011-11-03 09:05, Martin Grigorov wrote:

Hi Matthias,

On Thu, Nov 3, 2011 at 9:30 AM, Matthias Keller
  wrote:

Hi Martin

I see this is getting in the same direction as it was with Wicket 1.4 - it
just doesn't work as expected.
The method you propose results in the next page shown as expected and going
back is not possible anymore. But so is clicking on anything on the next
page then - those links seem to be invalid then too...

The problem seems to be in the order of events:
1) The flow wishes to invalidate all current pages, so calls Session.clear()
2) Then the user is redirected to a new page with setResponsePage(new
NextPage())
3) Then the request ends and if cleaning up is performed at this stage, it
doesn't know to keep the NextPage and its links but clean everything else

No 3 could be addressed in wicket 1.4 using the internal untouch method to
tell wicket NOT to store that page anymore.

One question: what should happen when the user is redirected to
NextPage (because of setResponsePage(new NextPage())) and
the user clicks on a Link ?
Wicket will try to find the page to execute Link#onClick() but since
the page is not stored Wicket will throw PageExpiredException.
The same will happen if the user refreshes the page with F5.
How do you handle that case ?

Session.clear() removes all pages stored so far. If you use
setResponsePage(anInstance) then a new page will be stored afterwards.
If you really want to clear all pages even the NextPage instance then
you can do:

class MyRequestCycle extends RequestCycle {
   private boolean fullClean;

   public void fullClean() {
 fullClean = true;
   }

   @Override
   public void detach() {
 super.detach();

 if (fullClean) {
fullClean = false;
Session.get().clean();
 }
   }
}


What appears to work is create a public method in my session which calls:
getSessionStore().invalidate(RequestCycle.get().getRequest());

This seems to work (and is part of what replaceSession() does) but I don't
know the internals of the new PageManager et al so I'm not sure if this is
already enough and correct?

Matt

On 2011-11-02 13:27, Martin Grigorov wrote:

On Wed, Nov 2, 2011 at 2:09 PM, Matthias Keller
wrote:

Hi Martin

Thanks for the quick reply.
The fix doesn't work for me though, I can still go back and press reload



or
do anything I like.
If I use session.replaceSession() it works as expected but as a side
effect
also changes the JSESSIONID which usually isn't what you want...

I'm using it like that in an onClick event of a button (and the session
is
NOT temporary):

if (getSession().isTemporary() == false) {
getSession().getPageManager().sessionExpired(getId());
}

This code does the same as in 1.4 with page maps.
#untouchPage() as internal API in 1.4 and is not ported to 1.5.

Try by override Session#detach() and do:
super.detach();
clear();


setResponsePage(new ConfirmationPage(...));

Maybe it could be some kind of special situation like it was in Wicket
1.4
where I manually had to untouch the current page to avoid it still being
stored at the end of the request...?

Matt


On 2011-11-02 10:40, Martin Grigorov wrote:

I implemented the feature in the ticket Matt created.
Please try it.

On Wed, Nov 2, 2011 at 11:35 AM, Andrea Del Bene
  wrote:

Have you tried session.invalidate()? If you have an
AuthenticatedWebSession
you can also use signOut()

Hi

Upon logging out we need to keep the current user's session to still
display some information but we want to remove all previous pages from
the
PageMap (or however

Re: Validate form on page start

2011-11-14 Thread Ernesto Reinaldo Barreiro
Ilia,

Just an idea... What about  triggering validation via AJAX? Form is
submmited via AJAX when page is loaded... and you get your form
validated.

Regards,

Ernesto

2011/11/14 Илья Нарыжный :
> Martin,
>
> It doesn't work...
> The main reason of that in following:
> validation of required field is following:
>
> public boolean checkRequired()
>    {
>        if (isRequired())
>        {
>            final String input = getInput();
> 
>
> and getInput method operates only with RequestParameters. So, I don't see
> eny way to do that in proper way. Some deep changes in Wicket is required
> to support that case:(
>
> Ilia
>
> 2011/11/14 Martin Grigorov 
>
>> You just need to pass a populated model to the form (components).
>> If FormComponent's input is equal to NO_RAW_INPUT then the model is used.
>>
>> 2011/11/14 Илья Нарыжный :
>> > Martin,
>> >
>> > Yes. That seems to work, but for case when parameters for page were
>> > propogated by PageParameters.
>> > But what should I call in case, when value for fields initially should be
>> > populated from CompoundPropertyModel and corresponding backend object?
>> >
>> > Thanks,
>> >
>> > Ilia
>> >
>> > 2011/11/14 Martin Grigorov 
>> >
>> >> Hi,
>> >>
>> >> You need to call
>> >> org.apache.wicket.markup.html.form.FormComponent.inputChanged() before
>> >> that.
>> >> See org.apache.wicket.markup.html.form.FormComponent.inputChanged()
>> >>
>> >>
>> >>
>> >> 2011/11/14 Илья Нарыжный :
>> >> > Hi,
>> >> >
>> >> > Unfortunatly, it doesn't work too. Process doesn't propogate
>> parameters
>> >> > from Models to FormComponents, so validation just validate empty
>> >> fields...
>> >> >
>> >> > Ilia
>> >> >
>> >> > 2011/11/14 Martin Grigorov 
>> >> >
>> >> >> Hi Ilia,
>> >> >>
>> >> >> You are correct.
>> >> >> May be there is no need of #myvalidate() at all.
>> >> >> Just call form#process(null);
>> >> >>
>> >> >> 2011/11/14 Илья Нарыжный :
>> >> >> > Hello, Martin,
>> >> >> >
>> >> >> > I tried, as you propose, but that doesn't work: page is not
>> >> initilized,
>> >> >> so
>> >> >> > all validators just validate "empty" fields without propagated
>> values
>> >> to
>> >> >> it.
>> >> >> >
>> >> >> > Maybe I should done that in some onXXX method? (in onBeforeRender
>> and
>> >> >> > onComponentTag - it doesn't work)
>> >> >> >
>> >> >> > Thanks,
>> >> >> >
>> >> >> > Ilia
>> >> >> >
>> >> >> >
>> >> >> >> Hi,
>> >> >> >
>> >> >> >> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный 
>> >> wrote:
>> >> >> >
>> >> >> >> Hello,
>> >> >> >
>> >> >> >> I have following case: There is RegistrationPage in the project.
>> This
>> >> >> > page fill attributes of new User and persists in the database. But
>> for
>> >> >> > registration from social networks we want to implement following:
>> >> show to
>> >> >> > new user the same RegistrationPage with filled fields according to
>> >> data
>> >> >> > recieved from social networks and highlighted errors (for example
>> if
>> >> >> EMAIL
>> >> >> > was not filled).
>> >> >> >
>> >> >> >> So, is it possible to redirect user to some page with already
>> >> validated
>> >> >> > form?
>> >> >> >
>> >> >> >> >Extend org.apache.wicket.markup.html.form.Form and add
>> #myvalidate()
>> >> >> > that just calls org.apache.wicket.markup.html.form.Form.validate()
>> >> (it is
>> >> >> > protected final).
>> >> >> >
>> >> >> >> Instantiate that page and populate the form components' models (or
>> >> >> > populate page's pageparameters) and at the end call
>> >> myForm.myvalidate().
>> >> >> >
>> >> >> >> > Thanks, Ilia
>> >> >> >
>> >> >> >> -- Martin Grigorov jWeekend Training, Consulting, Development
>> >> >> > http://jWeekend.com 
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Martin Grigorov
>> >> >> jWeekend
>> >> >> Training, Consulting, Development
>> >> >> http://jWeekend.com
>> >> >>
>> >> >> -
>> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >>
>> >> >>
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Martin Grigorov
>> >> jWeekend
>> >> Training, Consulting, Development
>> >> http://jWeekend.com
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: Validate form on page start

2011-11-14 Thread Илья Нарыжный
Martin,

It doesn't work...
The main reason of that in following:
validation of required field is following:

public boolean checkRequired()
{
if (isRequired())
{
final String input = getInput();


and getInput method operates only with RequestParameters. So, I don't see
eny way to do that in proper way. Some deep changes in Wicket is required
to support that case:(

Ilia

2011/11/14 Martin Grigorov 

> You just need to pass a populated model to the form (components).
> If FormComponent's input is equal to NO_RAW_INPUT then the model is used.
>
> 2011/11/14 Илья Нарыжный :
> > Martin,
> >
> > Yes. That seems to work, but for case when parameters for page were
> > propogated by PageParameters.
> > But what should I call in case, when value for fields initially should be
> > populated from CompoundPropertyModel and corresponding backend object?
> >
> > Thanks,
> >
> > Ilia
> >
> > 2011/11/14 Martin Grigorov 
> >
> >> Hi,
> >>
> >> You need to call
> >> org.apache.wicket.markup.html.form.FormComponent.inputChanged() before
> >> that.
> >> See org.apache.wicket.markup.html.form.FormComponent.inputChanged()
> >>
> >>
> >>
> >> 2011/11/14 Илья Нарыжный :
> >> > Hi,
> >> >
> >> > Unfortunatly, it doesn't work too. Process doesn't propogate
> parameters
> >> > from Models to FormComponents, so validation just validate empty
> >> fields...
> >> >
> >> > Ilia
> >> >
> >> > 2011/11/14 Martin Grigorov 
> >> >
> >> >> Hi Ilia,
> >> >>
> >> >> You are correct.
> >> >> May be there is no need of #myvalidate() at all.
> >> >> Just call form#process(null);
> >> >>
> >> >> 2011/11/14 Илья Нарыжный :
> >> >> > Hello, Martin,
> >> >> >
> >> >> > I tried, as you propose, but that doesn't work: page is not
> >> initilized,
> >> >> so
> >> >> > all validators just validate "empty" fields without propagated
> values
> >> to
> >> >> it.
> >> >> >
> >> >> > Maybe I should done that in some onXXX method? (in onBeforeRender
> and
> >> >> > onComponentTag - it doesn't work)
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > Ilia
> >> >> >
> >> >> >
> >> >> >> Hi,
> >> >> >
> >> >> >> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный 
> >> wrote:
> >> >> >
> >> >> >> Hello,
> >> >> >
> >> >> >> I have following case: There is RegistrationPage in the project.
> This
> >> >> > page fill attributes of new User and persists in the database. But
> for
> >> >> > registration from social networks we want to implement following:
> >> show to
> >> >> > new user the same RegistrationPage with filled fields according to
> >> data
> >> >> > recieved from social networks and highlighted errors (for example
> if
> >> >> EMAIL
> >> >> > was not filled).
> >> >> >
> >> >> >> So, is it possible to redirect user to some page with already
> >> validated
> >> >> > form?
> >> >> >
> >> >> >> >Extend org.apache.wicket.markup.html.form.Form and add
> #myvalidate()
> >> >> > that just calls org.apache.wicket.markup.html.form.Form.validate()
> >> (it is
> >> >> > protected final).
> >> >> >
> >> >> >> Instantiate that page and populate the form components' models (or
> >> >> > populate page's pageparameters) and at the end call
> >> myForm.myvalidate().
> >> >> >
> >> >> >> > Thanks, Ilia
> >> >> >
> >> >> >> -- Martin Grigorov jWeekend Training, Consulting, Development
> >> >> > http://jWeekend.com 
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Martin Grigorov
> >> >> jWeekend
> >> >> Training, Consulting, Development
> >> >> http://jWeekend.com
> >> >>
> >> >> -
> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >> >>
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Validating HTML 4

2011-11-14 Thread Pierre Goiffon
Le 09/11/2011 11:23, Martin Grigorov a écrit :
 - DataTable : a SPAN is always added in the TD and TH.
>>> Override DataTable component and provide your own MyDataTable.html.
>>> The .java code will just call super constructors.
>> As said before, I don't feel very confident in duplicating wicket code and
>> change a very little detail in it. Is there a way to change those span to
>> div in future versions of Wicket ?
> Sure. File a ticket in Jira.
> We cannot change it in 1.5.x because it may break silently apps in
> production. So it will have to wait Wicket.next.
>

I've just created issue 4224 :
https://issues.apache.org/jira/browse/WICKET-4224

Thanks !

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread Ernesto Reinaldo Barreiro
Ins´t there a constructor

public AjaxSlider(String id, Number min, Number max)

?

Regards,

Ernesto



On Mon, Nov 14, 2011 at 10:33 AM, odin568  wrote:
> I finally found a solution. You were right - it's much easier by using
> AjaxSlider instead of normal slider.
>
> Here is the code:
>
>                                AjaxSlider slider = new AjaxSlider("slider", 
> 0, 100);
>                                slider.setRange(new SliderRange(true));
>                                //TODO: Set Slider to position again!
>                                slider.setAjaxStopEvent(new 
> AjaxSlider.ISliderAjaxEvent() {
>                                    private static final long serialVersionUID 
> = 1L;
>                                    public void onEvent(AjaxRequestTarget 
> target, AjaxSlider slider, int
> value, int[] values ) {
>                                        
> 
>                                    }
>                                });
>                                item.add(slider);
>
>
>
>
> But I have one more problem: I want to initialize the Slider with a min and
> max-value. Until now, min and max start with 0. I don't understand the
> SliderRange constructor. I can give it beside a boolean a RangeEnum. How can
> I implement that? I don't understand...
>
> Thanks a lot!
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4038916.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Validate form on page start

2011-11-14 Thread Martin Grigorov
You just need to pass a populated model to the form (components).
If FormComponent's input is equal to NO_RAW_INPUT then the model is used.

2011/11/14 Илья Нарыжный :
> Martin,
>
> Yes. That seems to work, but for case when parameters for page were
> propogated by PageParameters.
> But what should I call in case, when value for fields initially should be
> populated from CompoundPropertyModel and corresponding backend object?
>
> Thanks,
>
> Ilia
>
> 2011/11/14 Martin Grigorov 
>
>> Hi,
>>
>> You need to call
>> org.apache.wicket.markup.html.form.FormComponent.inputChanged() before
>> that.
>> See org.apache.wicket.markup.html.form.FormComponent.inputChanged()
>>
>>
>>
>> 2011/11/14 Илья Нарыжный :
>> > Hi,
>> >
>> > Unfortunatly, it doesn't work too. Process doesn't propogate parameters
>> > from Models to FormComponents, so validation just validate empty
>> fields...
>> >
>> > Ilia
>> >
>> > 2011/11/14 Martin Grigorov 
>> >
>> >> Hi Ilia,
>> >>
>> >> You are correct.
>> >> May be there is no need of #myvalidate() at all.
>> >> Just call form#process(null);
>> >>
>> >> 2011/11/14 Илья Нарыжный :
>> >> > Hello, Martin,
>> >> >
>> >> > I tried, as you propose, but that doesn't work: page is not
>> initilized,
>> >> so
>> >> > all validators just validate "empty" fields without propagated values
>> to
>> >> it.
>> >> >
>> >> > Maybe I should done that in some onXXX method? (in onBeforeRender and
>> >> > onComponentTag - it doesn't work)
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Ilia
>> >> >
>> >> >
>> >> >> Hi,
>> >> >
>> >> >> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный 
>> wrote:
>> >> >
>> >> >> Hello,
>> >> >
>> >> >> I have following case: There is RegistrationPage in the project. This
>> >> > page fill attributes of new User and persists in the database. But for
>> >> > registration from social networks we want to implement following:
>> show to
>> >> > new user the same RegistrationPage with filled fields according to
>> data
>> >> > recieved from social networks and highlighted errors (for example if
>> >> EMAIL
>> >> > was not filled).
>> >> >
>> >> >> So, is it possible to redirect user to some page with already
>> validated
>> >> > form?
>> >> >
>> >> >> >Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
>> >> > that just calls org.apache.wicket.markup.html.form.Form.validate()
>> (it is
>> >> > protected final).
>> >> >
>> >> >> Instantiate that page and populate the form components' models (or
>> >> > populate page's pageparameters) and at the end call
>> myForm.myvalidate().
>> >> >
>> >> >> > Thanks, Ilia
>> >> >
>> >> >> -- Martin Grigorov jWeekend Training, Consulting, Development
>> >> > http://jWeekend.com 
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Martin Grigorov
>> >> jWeekend
>> >> Training, Consulting, Development
>> >> http://jWeekend.com
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Question regarding wiquery Rangeslider

2011-11-14 Thread odin568
I finally found a solution. You were right - it's much easier by using
AjaxSlider instead of normal slider.

Here is the code:

AjaxSlider slider = new AjaxSlider("slider", 0, 
100);
slider.setRange(new SliderRange(true));
//TODO: Set Slider to position again!
slider.setAjaxStopEvent(new 
AjaxSlider.ISliderAjaxEvent() {
private static final long serialVersionUID 
= 1L;
public void onEvent(AjaxRequestTarget 
target, AjaxSlider slider, int
value, int[] values ) {

}
});
item.add(slider);




But I have one more problem: I want to initialize the Slider with a min and
max-value. Until now, min and max start with 0. I don't understand the
SliderRange constructor. I can give it beside a boolean a RangeEnum. How can
I implement that? I don't understand...

Thanks a lot!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Question-regarding-wiquery-Rangeslider-tp4025737p4038916.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Apache Wicket 1.5.3 is released

2011-11-14 Thread Martin Grigorov
This is the third maintenance release of the Wicket 1.5.x series.

This release brings over 25 bug fixes and 15 improvements.

Subversion tag: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5.3

Changelog: 
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561&version=12318550

To use in Maven:

  org.apache.wicket
  wicket-core
  1.5.3


Download the full distribution:
http://www.apache.org/dyn/closer.cgi/wicket/1.5.3 (including source)

The Wicket Team

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



Re: Customizing Error / Validation messages

2011-11-14 Thread Martin Grigorov
Enable DEBUG logging for
org.apache.wicket.resource.loader.ComponentStringResourceLoader and
see whether your .properties file is asked at all.

On Mon, Nov 14, 2011 at 10:44 AM,   wrote:
> I tried that it still does not work for some reason I have VendorPage.class 
> VendorPage.html and VendorPage.properties
> Containing pattern = ${label} is invalid zip. It still shows me the default 
> message. Am I missing a step or doing some thing wrong?
> --Original Message--
> From: Martin Grigorov
> To: users@wicket.apache.org
> ReplyTo: users@wicket.apache.org
> Subject: Re: Customizing Error / Validation messages
> Sent: Nov 14, 2011 1:09 AM
>
> Hi,
>
> On Mon, Nov 14, 2011 at 8:50 AM, anantasthana  wrote:
>> I am using pattern validator and i on a page named VendorPage and have a
>> properties file with keys
>> pattern= Zip
>> I am using the pattern validator to validate zip code so i want the message
>> to say ... is not a valid zip
>> I dont know if i am doing smoe thing wrong or missing some thing but i can
>> not get the message to display correctly.
>> Thanks
>
> Create file VendorPage.properties and put it next to VendorPage.html
> (make sure it is copied next to VendorPage.class at build time) and
> put a line like:
> pattern = ${label} is not a valid zip
>
>
>>
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Customizing-Error-Validation-messages-tp4038582p4038582.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Validate form on page start

2011-11-14 Thread Илья Нарыжный
Martin,

Yes. That seems to work, but for case when parameters for page were
propogated by PageParameters.
But what should I call in case, when value for fields initially should be
populated from CompoundPropertyModel and corresponding backend object?

Thanks,

Ilia

2011/11/14 Martin Grigorov 

> Hi,
>
> You need to call
> org.apache.wicket.markup.html.form.FormComponent.inputChanged() before
> that.
> See org.apache.wicket.markup.html.form.FormComponent.inputChanged()
>
>
>
> 2011/11/14 Илья Нарыжный :
> > Hi,
> >
> > Unfortunatly, it doesn't work too. Process doesn't propogate parameters
> > from Models to FormComponents, so validation just validate empty
> fields...
> >
> > Ilia
> >
> > 2011/11/14 Martin Grigorov 
> >
> >> Hi Ilia,
> >>
> >> You are correct.
> >> May be there is no need of #myvalidate() at all.
> >> Just call form#process(null);
> >>
> >> 2011/11/14 Илья Нарыжный :
> >> > Hello, Martin,
> >> >
> >> > I tried, as you propose, but that doesn't work: page is not
> initilized,
> >> so
> >> > all validators just validate "empty" fields without propagated values
> to
> >> it.
> >> >
> >> > Maybe I should done that in some onXXX method? (in onBeforeRender and
> >> > onComponentTag - it doesn't work)
> >> >
> >> > Thanks,
> >> >
> >> > Ilia
> >> >
> >> >
> >> >> Hi,
> >> >
> >> >> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный 
> wrote:
> >> >
> >> >> Hello,
> >> >
> >> >> I have following case: There is RegistrationPage in the project. This
> >> > page fill attributes of new User and persists in the database. But for
> >> > registration from social networks we want to implement following:
> show to
> >> > new user the same RegistrationPage with filled fields according to
> data
> >> > recieved from social networks and highlighted errors (for example if
> >> EMAIL
> >> > was not filled).
> >> >
> >> >> So, is it possible to redirect user to some page with already
> validated
> >> > form?
> >> >
> >> >> >Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
> >> > that just calls org.apache.wicket.markup.html.form.Form.validate()
> (it is
> >> > protected final).
> >> >
> >> >> Instantiate that page and populate the form components' models (or
> >> > populate page's pageparameters) and at the end call
> myForm.myvalidate().
> >> >
> >> >> > Thanks, Ilia
> >> >
> >> >> -- Martin Grigorov jWeekend Training, Consulting, Development
> >> > http://jWeekend.com 
> >> >
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Validate form on page start

2011-11-14 Thread Martin Grigorov
Hi,

You need to call
org.apache.wicket.markup.html.form.FormComponent.inputChanged() before
that.
See org.apache.wicket.markup.html.form.FormComponent.inputChanged()



2011/11/14 Илья Нарыжный :
> Hi,
>
> Unfortunatly, it doesn't work too. Process doesn't propogate parameters
> from Models to FormComponents, so validation just validate empty fields...
>
> Ilia
>
> 2011/11/14 Martin Grigorov 
>
>> Hi Ilia,
>>
>> You are correct.
>> May be there is no need of #myvalidate() at all.
>> Just call form#process(null);
>>
>> 2011/11/14 Илья Нарыжный :
>> > Hello, Martin,
>> >
>> > I tried, as you propose, but that doesn't work: page is not initilized,
>> so
>> > all validators just validate "empty" fields without propagated values to
>> it.
>> >
>> > Maybe I should done that in some onXXX method? (in onBeforeRender and
>> > onComponentTag - it doesn't work)
>> >
>> > Thanks,
>> >
>> > Ilia
>> >
>> >
>> >> Hi,
>> >
>> >> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный  wrote:
>> >
>> >> Hello,
>> >
>> >> I have following case: There is RegistrationPage in the project. This
>> > page fill attributes of new User and persists in the database. But for
>> > registration from social networks we want to implement following: show to
>> > new user the same RegistrationPage with filled fields according to data
>> > recieved from social networks and highlighted errors (for example if
>> EMAIL
>> > was not filled).
>> >
>> >> So, is it possible to redirect user to some page with already validated
>> > form?
>> >
>> >> >Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
>> > that just calls org.apache.wicket.markup.html.form.Form.validate() (it is
>> > protected final).
>> >
>> >> Instantiate that page and populate the form components' models (or
>> > populate page's pageparameters) and at the end call myForm.myvalidate().
>> >
>> >> > Thanks, Ilia
>> >
>> >> -- Martin Grigorov jWeekend Training, Consulting, Development
>> > http://jWeekend.com 
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Validate form on page start

2011-11-14 Thread Илья Нарыжный
Hi,

Unfortunatly, it doesn't work too. Process doesn't propogate parameters
from Models to FormComponents, so validation just validate empty fields...

Ilia

2011/11/14 Martin Grigorov 

> Hi Ilia,
>
> You are correct.
> May be there is no need of #myvalidate() at all.
> Just call form#process(null);
>
> 2011/11/14 Илья Нарыжный :
> > Hello, Martin,
> >
> > I tried, as you propose, but that doesn't work: page is not initilized,
> so
> > all validators just validate "empty" fields without propagated values to
> it.
> >
> > Maybe I should done that in some onXXX method? (in onBeforeRender and
> > onComponentTag - it doesn't work)
> >
> > Thanks,
> >
> > Ilia
> >
> >
> >> Hi,
> >
> >> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный  wrote:
> >
> >> Hello,
> >
> >> I have following case: There is RegistrationPage in the project. This
> > page fill attributes of new User and persists in the database. But for
> > registration from social networks we want to implement following: show to
> > new user the same RegistrationPage with filled fields according to data
> > recieved from social networks and highlighted errors (for example if
> EMAIL
> > was not filled).
> >
> >> So, is it possible to redirect user to some page with already validated
> > form?
> >
> >> >Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
> > that just calls org.apache.wicket.markup.html.form.Form.validate() (it is
> > protected final).
> >
> >> Instantiate that page and populate the form components' models (or
> > populate page's pageparameters) and at the end call myForm.myvalidate().
> >
> >> > Thanks, Ilia
> >
> >> -- Martin Grigorov jWeekend Training, Consulting, Development
> > http://jWeekend.com 
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Validate form on page start

2011-11-14 Thread Martin Grigorov
Hi Ilia,

You are correct.
May be there is no need of #myvalidate() at all.
Just call form#process(null);

2011/11/14 Илья Нарыжный :
> Hello, Martin,
>
> I tried, as you propose, but that doesn't work: page is not initilized, so
> all validators just validate "empty" fields without propagated values to it.
>
> Maybe I should done that in some onXXX method? (in onBeforeRender and
> onComponentTag - it doesn't work)
>
> Thanks,
>
> Ilia
>
>
>> Hi,
>
>> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный  wrote:
>
>> Hello,
>
>> I have following case: There is RegistrationPage in the project. This
> page fill attributes of new User and persists in the database. But for
> registration from social networks we want to implement following: show to
> new user the same RegistrationPage with filled fields according to data
> recieved from social networks and highlighted errors (for example if EMAIL
> was not filled).
>
>> So, is it possible to redirect user to some page with already validated
> form?
>
>> >Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
> that just calls org.apache.wicket.markup.html.form.Form.validate() (it is
> protected final).
>
>> Instantiate that page and populate the form components' models (or
> populate page's pageparameters) and at the end call myForm.myvalidate().
>
>> > Thanks, Ilia
>
>> -- Martin Grigorov jWeekend Training, Consulting, Development
> http://jWeekend.com 
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Customizing Error / Validation messages

2011-11-14 Thread anant . asty
I tried that it still does not work for some reason I have VendorPage.class 
VendorPage.html and VendorPage.properties
Containing pattern = ${label} is invalid zip. It still shows me the default 
message. Am I missing a step or doing some thing wrong?
--Original Message--
From: Martin Grigorov
To: users@wicket.apache.org
ReplyTo: users@wicket.apache.org
Subject: Re: Customizing Error / Validation messages
Sent: Nov 14, 2011 1:09 AM

Hi,

On Mon, Nov 14, 2011 at 8:50 AM, anantasthana  wrote:
> I am using pattern validator and i on a page named VendorPage and have a
> properties file with keys
> pattern= Zip
> I am using the pattern validator to validate zip code so i want the message
> to say ... is not a valid zip
> I dont know if i am doing smoe thing wrong or missing some thing but i can
> not get the message to display correctly.
> Thanks

Create file VendorPage.properties and put it next to VendorPage.html
(make sure it is copied next to VendorPage.class at build time) and
put a line like:
pattern = ${label} is not a valid zip


>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Customizing-Error-Validation-messages-tp4038582p4038582.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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




Re: Validate form on page start

2011-11-14 Thread Илья Нарыжный
Hello, Martin,

I tried, as you propose, but that doesn't work: page is not initilized, so
all validators just validate "empty" fields without propagated values to it.

Maybe I should done that in some onXXX method? (in onBeforeRender and
onComponentTag - it doesn't work)

Thanks,

Ilia


> Hi,

> On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный  wrote:

> Hello,

> I have following case: There is RegistrationPage in the project. This
page fill attributes of new User and persists in the database. But for
registration from social networks we want to implement following: show to
new user the same RegistrationPage with filled fields according to data
recieved from social networks and highlighted errors (for example if EMAIL
was not filled).

> So, is it possible to redirect user to some page with already validated
form?

> >Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
that just calls org.apache.wicket.markup.html.form.Form.validate() (it is
protected final).

> Instantiate that page and populate the form components' models (or
populate page's pageparameters) and at the end call myForm.myvalidate().

> > Thanks, Ilia

> -- Martin Grigorov jWeekend Training, Consulting, Development
http://jWeekend.com 


Re: Model isn't updated on AJAX submit link invocation

2011-11-14 Thread Martin Grigorov
Hi,

Here is another article about adding items in a repeater with Ajax:
http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/

On Sat, Nov 12, 2011 at 3:37 PM, Станислав Савульчик
 wrote:
> Hi,
>
> The form components aren't updated because form processing for AjaxSubmitLink 
> is set to false.
> See the javadoc for AjaxSubmitLink#setDefaultFormProcessing.
>
> BTW, when using ListView for rendering form components consider reading 
> WARNING section in javadoc for ListView class.
>
> - Исходное сообщение -
> От: "Sebastian80" 
> Кому: users@wicket.apache.org
> Отправленные: Суббота, 12 Ноябрь 2011 г 17:46:51
> Тема: Model isn't updated on AJAX submit link invocation
>
> Hi there,
>
> I'm trying to implement an AJAXfied Wicket list view. On my research I
> stumbled upon the code on
> http://www.oktech.hu/kb/adding-and-removing-rows-wicket-listview-via-ajax
> and modified it a bit.
>
> The model is not updated properly. So whenever a value is entered in a text
> field, it is forgotten if the AJAX submit link is invoked (the text field is
> empty again). Why does this happen? I don't see any issue with this code.
> Wicket version is 1.5.2.
>
> Here is the Java code:
>
> // Initialization of form
> ...
>
> // List all rows
> ArrayList rows = new ArrayList(2);
> rows.add(new String());
> rows.add(new String());
>
> final ListView lv = new ListView("rows", rows) {
>    @Override
>    protected void populateItem(ListItem item) {
>        int index = item.getIndex() + 1;
>        item.add(new Label("index", index + "."));
>
>        TextField text = new TextField("text",
> item.getModel());
>        item.add(text);
>    }
> };
> rowPanel.add(lv);
>
>    AjaxSubmitLink addLink = new AjaxSubmitLink("addRow", form) {
>
>    @Override
>    protected void onError(AjaxRequestTarget target, Form form) {
>        if (target != null) target.add(rowPanel);
>    }
>
>    @Override
>    protected void onSubmit(AjaxRequestTarget target, Form form) {
>        lv.getModelObject().add(new String());
>        if (target != null) target.add(rowPanel);
>    }
> };
> addLink.setDefaultFormProcessing(false);
> rowPanel.add(addLink);
> ...
>
> And the associated mark up:
> 
>
>        1.
>        
>
>     # Add row
> 
>
> Has someone any idea on this issue? I'm completely stuck on this issue.
> Thanks in advance.
>
> Best regards,
> Sebastian
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Model-isn-t-updated-on-AJAX-submit-link-invocation-tp4034095p4034095.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Migrating a ResourceStreamRequestTarget to a ResourceStreamRequestHandler (2)

2011-11-14 Thread Martin Grigorov
Hi,

On Sat, Nov 12, 2011 at 7:15 PM, hfriederichs  wrote:
> I solved the issue by many trial and error sessions. Maybe I can spare
> someone else this ordeal.
>
> In Firefox an Chrome it now works as in IE, by adding this statement in the
> init() of my WicketApplication:
>
> getResourceSettings().setDefaultCacheDuration(Duration.NONE);

So you basically disabled the caching for *all* resources just because
you need to disable the caching for one resource.
See 
org.apache.wicket.request.resource.AbstractResource.ResourceResponse.getCacheDuration()


>
> Regards, Hans Friederichs
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Migrating-a-ResourceStreamRequestTarget-to-a-ResourceStreamRequestHandler-2-tp4019661p4034881.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Customizing Error / Validation messages

2011-11-14 Thread anant . asty
Thanks I will try that. 
--Original Message--
From: Martin Grigorov
To: users@wicket.apache.org
ReplyTo: users@wicket.apache.org
Subject: Re: Customizing Error / Validation messages
Sent: Nov 14, 2011 1:09 AM

Hi,

On Mon, Nov 14, 2011 at 8:50 AM, anantasthana  wrote:
> I am using pattern validator and i on a page named VendorPage and have a
> properties file with keys
> pattern= Zip
> I am using the pattern validator to validate zip code so i want the message
> to say ... is not a valid zip
> I dont know if i am doing smoe thing wrong or missing some thing but i can
> not get the message to display correctly.
> Thanks

Create file VendorPage.properties and put it next to VendorPage.html
(make sure it is copied next to VendorPage.class at build time) and
put a line like:
pattern = ${label} is not a valid zip


>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Customizing-Error-Validation-messages-tp4038582p4038582.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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




Re: Validate form on page start

2011-11-14 Thread Martin Grigorov
Hi,

On Sun, Nov 13, 2011 at 2:20 PM, Илья Нарыжный  wrote:
> Hello,
>
> I have following case:
> There is RegistrationPage in the project. This page fill attributes of new
> User and persists in the database.
> But for registration from social networks we want to implement following:
> show to new user the same RegistrationPage with filled fields according to
> data recieved from social networks and highlighted errors (for example if
> EMAIL was not filled).
>
> So, is it possible to redirect user to some page with already validated
> form?

Extend org.apache.wicket.markup.html.form.Form and add #myvalidate()
that just calls org.apache.wicket.markup.html.form.Form.validate() (it
is protected final).

Instantiate that page and populate the form components' models (or
populate page's pageparameters) and at the end call
myForm.myvalidate().


>
> Thanks,
> Ilia
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Customizing Error / Validation messages

2011-11-14 Thread Martin Grigorov
Hi,

On Mon, Nov 14, 2011 at 8:50 AM, anantasthana  wrote:
> I am using pattern validator and i on a page named VendorPage and have a
> properties file with keys
> pattern= Zip
> I am using the pattern validator to validate zip code so i want the message
> to say ... is not a valid zip
> I dont know if i am doing smoe thing wrong or missing some thing but i can
> not get the message to display correctly.
> Thanks

Create file VendorPage.properties and put it next to VendorPage.html
(make sure it is copied next to VendorPage.class at build time) and
put a line like:
pattern = ${label} is not a valid zip


>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Customizing-Error-Validation-messages-tp4038582p4038582.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: replacing parent panel how to

2011-11-14 Thread Martin Grigorov
On Fri, Nov 11, 2011 at 11:08 PM, Igor Vaynberg  wrote:
> not exactly..you are missing a very important step
>
> Panel replacement=new RightPanel("panel");
> panel.replaceWith(replacement);
> panel=replacement; <== very important or the second time this is

or in 1.5:
panel = panel.replaceWith(replacement);


> called it will fail
>
> -igor
>
>
> On Fri, Nov 11, 2011 at 12:42 PM,   wrote:
>> So if you are doing Panel panel = new LeftPanel("panel");
>> add(panel);
>>
>> Then to replace it you can do
>> panel.replaceWith(new RightPanel("panel");
>>
>> If u want to replace through an ajav request make sure you do 
>> target.add(panel);
>> --Original Message--
>> From: pen
>> To: users@wicket.apache.org
>> ReplyTo: users@wicket.apache.org
>> Subject: replacing parent panel how to
>> Sent: Nov 11, 2011 1:15 PM
>>
>> Hi All,
>>
>> I have two panels left and right panels. I have two Ajax links on the left
>> panel, page1 and page2. clicking on either of them i can replace the right
>> panels.
>> But now I have some link on the right panel, I need to replace the whole
>> right panel itself, without changing the rest of the page.
>> I tried lot of things but didn't work. Any help would be greatly
>> appreciated.
>>
>> `Pen
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/replacing-parent-panel-how-to-tp4032603p4032603.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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