Wicketstuff tinymce 1.5

2011-09-15 Thread Sotil Bertanzetti, Matteo
Hello,

 

I'm migrating from wicket 1.4.18 to wicket 1.5.0, but I need
wicketstuff/tinymce dependency, and I think it is not migrated to 1.5
yet; is there some prevision to do it?, or where can I find it?.

 

My dependency:

 

dependency

groupIdorg.wicketstuff/groupId

artifactIdtinymce/artifactId

  version1.4.18/version

/dependency

 

Thank you,

 

Matteo Sotil

 



static validators feedback unrendered on page with multiple forms and feedback filtered

2011-09-15 Thread manuelbarzi
hi,

got the following composite:
page
|-form1
|     |-field1
|     |     |-StringValidator.MaximumLengthValidator [1]
|     |-feedbackPanel1(ComponentFeedbackMessageFilter(form1) [3])
|-form2
      |-field2
      |     |-StringValidator.MaximumLengthValidator [2]
      |-feedbackPanel2(ComponentFeedbackMessageFilter(form2) [4])

when explicitly calling whatever feedback method (info, error) on
submit of form1/form2 feedback messages do render ok.

but when static validators [1]/[2] apply, and not pass, feedback
messages are not rendered, and output console is:

WARN  - WebSession - Component-targetted feedback message was left
unrendered. This could be because you are missing a FeedbackPanel on
the page.  Message: ...

this happens when constructing feedback panels with message filters
[3]/[4], required to permit forms differenciation on feedback output.
in other case, validators feedback messages are rendered ok, but
repeated on both feedback panels, which is not desirable.

should any other settings be applied on composite to render static
validators results on these filtered feedback panels?

thank you

ps this is wicket 1.4.17

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



Re: static validators feedback unrendered on page with multiple forms and feedback filtered

2011-09-15 Thread Martin Grigorov
You need ContainerFeedbackMessageFilter instead of
ComponentFeedbackMessageFilter.

On Thu, Sep 15, 2011 at 11:56 AM, manuelbarzi manuelba...@gmail.com wrote:
 hi,

 got the following composite:
 page
 |-form1
 |     |-field1
 |     |     |-StringValidator.MaximumLengthValidator [1]
 |     |-feedbackPanel1(ComponentFeedbackMessageFilter(form1) [3])
 |-form2
       |-field2
       |     |-StringValidator.MaximumLengthValidator [2]
       |-feedbackPanel2(ComponentFeedbackMessageFilter(form2) [4])

 when explicitly calling whatever feedback method (info, error) on
 submit of form1/form2 feedback messages do render ok.

 but when static validators [1]/[2] apply, and not pass, feedback
 messages are not rendered, and output console is:

 WARN  - WebSession - Component-targetted feedback message was left
 unrendered. This could be because you are missing a FeedbackPanel on
 the page.  Message: ...

 this happens when constructing feedback panels with message filters
 [3]/[4], required to permit forms differenciation on feedback output.
 in other case, validators feedback messages are rendered ok, but
 repeated on both feedback panels, which is not desirable.

 should any other settings be applied on composite to render static
 validators results on these filtered feedback panels?

 thank you

 ps this is wicket 1.4.17

 -
 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



Patch for Portlet support in Wicket 1.5

2011-09-15 Thread Martin Grigorov
Hi Portlet users,

At https://issues.apache.org/jira/browse/WICKET-4019 you can find an
attachment provided by Peter Pastrnak that brings back the support of
Portlets for Wicket 1.5.
If you would like to have this feature in your 1.5 applications now is
the time to test it and give feedback.

Before merging it back in Wicket distro (as wicket-portlet submodule?)
I prefer to re-incubate it as WicketStuff project for a while.
It would be nice if the code is tested with more Portlet containers
and if some kind of integration tests can be added.

If you need any kind of support just contact us at d...@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



Creating a resource from a byte array and its content type

2011-09-15 Thread Ian Marshall
In Wicket 1.4, I used an org.apache.wicket.resource.ByteArrayResource to
create a resource from a byte array and its content type. I then used this
object's getResourceStream() method to return an IResourceStream, to get an
InputStream and read it into a byte array.

(I do this as part of my prepation of an image into a NonCachingImage
component, whilst minimising the session size.)

In Wicket 1.5, I find ByteArrayResource as
org.apache.wicket.request.resource.ByteArrayResource. It is now an abstract
class and no longer has the ability to convert a byte array and its content
type into a resource stream (as far as I can see).

Can anyone recommend a good way for me to generate a resource stream from a
byte array and its content type? I would appreciate any assistance greatly.

Ian Marshall


My essential 1.4 Java code
--
  String sContentTypeWithPrefix = [...];
  byte[] baData = [...];

  ByteArrayResource barImage = new ByteArrayResource(
   sContentTypeWithPrefix, baData);
  IResourceStream rs = barImage.getResourceStream();
  long loLengthInBytes = rs.length();
  byte[] baTemp = new byte[nLengthInBytes];
  InputStream is = rs.getInputStream();
  int nReadResult = is.read(baTemp, 0, nLengthInBytes);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815188.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: Creating a resource from a byte array and its content type

2011-09-15 Thread Martin Grigorov
org.apache.wicket.request.resource.ByteArrayResource is not abstract.

you just need 
org.apache.wicket.markup.html.image.NonCachingImage.NonCachingImage(String,
IResource)

ByteArrayResource can work with static byte[] or with dynamic - see
org.apache.wicket.request.resource.ByteArrayResource.getData(Attributes)

On Thu, Sep 15, 2011 at 1:20 PM, Ian Marshall ianmarshall...@gmail.com wrote:
 In Wicket 1.4, I used an org.apache.wicket.resource.ByteArrayResource to
 create a resource from a byte array and its content type. I then used this
 object's getResourceStream() method to return an IResourceStream, to get an
 InputStream and read it into a byte array.

 (I do this as part of my prepation of an image into a NonCachingImage
 component, whilst minimising the session size.)

 In Wicket 1.5, I find ByteArrayResource as
 org.apache.wicket.request.resource.ByteArrayResource. It is now an abstract
 class and no longer has the ability to convert a byte array and its content
 type into a resource stream (as far as I can see).

 Can anyone recommend a good way for me to generate a resource stream from a
 byte array and its content type? I would appreciate any assistance greatly.

 Ian Marshall


 My essential 1.4 Java code
 --
  String sContentTypeWithPrefix = [...];
  byte[] baData = [...];

  ByteArrayResource barImage = new ByteArrayResource(
   sContentTypeWithPrefix, baData);
  IResourceStream rs = barImage.getResourceStream();
  long loLengthInBytes = rs.length();
  byte[] baTemp = new byte[nLengthInBytes];
  InputStream is = rs.getInputStream();
  int nReadResult = is.read(baTemp, 0, nLengthInBytes);

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815188.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: LocaleFirstMapper in wicket 1.5

2011-09-15 Thread Bas Gooren
Another question regarding LocaleFirstMapper: in mapHandler() it always 
adds the locale as the first segment.


In wicket 1.4 a url could start with ../-strings in the 
IRequestCodingStrategy.encode() call.

Wicket would generate a relative url to the wicket filter.

Since LocaleFirstMapper always puts the locale at the front, is this no 
longer the case in 1.5?


Sebastian

Op 14-9-2011 21:32, schreef Igor Vaynberg:

yes, good catch Bas. please open a jira ticket.

-igor

On Wed, Sep 14, 2011 at 12:12 PM, Bas Goorenb...@iswd.nl  wrote:

Hi all,

I'm in the process of migrating our internal code library to 1.5.
So far the main feeling is: wow, most things became a lot easier and
cleaner.
In other words: thanks wicket team!

Now on to my question: If I look at the LocaleFirstMapper [1] in
wicket-examples, I see that in #getCompatibilityScore() it forwards the call
to the chain.
For as far as I can see this would not work, since most mappers (if not all)
have their own getCompatibilityScore() based on the amount of matching
segments from the start of the url.

So in other words: by not stripping the locale from the request url before
forwarding the call to the chain, will this not result in a 0 score for all
mappers?

Sebastian

[1]
http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source


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



Re: LocaleFirstMapper in wicket 1.5

2011-09-15 Thread Martin Grigorov
The code that makes the Url relative is executed after
#mapHandler(IRequestHandler)

On Thu, Sep 15, 2011 at 2:49 PM, Bas Gooren b...@iswd.nl wrote:
 Another question regarding LocaleFirstMapper: in mapHandler() it always adds
 the locale as the first segment.

 In wicket 1.4 a url could start with ../-strings in the
 IRequestCodingStrategy.encode() call.
 Wicket would generate a relative url to the wicket filter.

 Since LocaleFirstMapper always puts the locale at the front, is this no
 longer the case in 1.5?

 Sebastian

 Op 14-9-2011 21:32, schreef Igor Vaynberg:

 yes, good catch Bas. please open a jira ticket.

 -igor

 On Wed, Sep 14, 2011 at 12:12 PM, Bas Goorenb...@iswd.nl  wrote:

 Hi all,

 I'm in the process of migrating our internal code library to 1.5.
 So far the main feeling is: wow, most things became a lot easier and
 cleaner.
 In other words: thanks wicket team!

 Now on to my question: If I look at the LocaleFirstMapper [1] in
 wicket-examples, I see that in #getCompatibilityScore() it forwards the
 call
 to the chain.
 For as far as I can see this would not work, since most mappers (if not
 all)
 have their own getCompatibilityScore() based on the amount of matching
 segments from the start of the url.

 So in other words: by not stripping the locale from the request url
 before
 forwarding the call to the chain, will this not result in a 0 score for
 all
 mappers?

 Sebastian

 [1]

 http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source

 -
 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: LocaleFirstMapper in wicket 1.5

2011-09-15 Thread Bas Gooren
So does that mean that all urls generated by mapHandler() are relative 
to the wicket filter, and are later made relative to the current page url?


When looking at RequestCycle.urlFor() and UrlRenderer it appears this way.

Op 15-9-2011 14:00, schreef Martin Grigorov:

The code that makes the Url relative is executed after
#mapHandler(IRequestHandler)

On Thu, Sep 15, 2011 at 2:49 PM, Bas Goorenb...@iswd.nl  wrote:

Another question regarding LocaleFirstMapper: in mapHandler() it always adds
the locale as the first segment.

In wicket 1.4 a url could start with ../-strings in the
IRequestCodingStrategy.encode() call.
Wicket would generate a relative url to the wicket filter.

Since LocaleFirstMapper always puts the locale at the front, is this no
longer the case in 1.5?

Sebastian

Op 14-9-2011 21:32, schreef Igor Vaynberg:

yes, good catch Bas. please open a jira ticket.

-igor

On Wed, Sep 14, 2011 at 12:12 PM, Bas Goorenb...@iswd.nlwrote:

Hi all,

I'm in the process of migrating our internal code library to 1.5.
So far the main feeling is: wow, most things became a lot easier and
cleaner.
In other words: thanks wicket team!

Now on to my question: If I look at the LocaleFirstMapper [1] in
wicket-examples, I see that in #getCompatibilityScore() it forwards the
call
to the chain.
For as far as I can see this would not work, since most mappers (if not
all)
have their own getCompatibilityScore() based on the amount of matching
segments from the start of the url.

So in other words: by not stripping the locale from the request url
before
forwarding the call to the chain, will this not result in a 0 score for
all
mappers?

Sebastian

[1]

http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.wicket/wicket-examples/1.5-M3/org/apache/wicket/examples/requestmapper/LocaleFirstMapper.java/?v=source


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






Re: static validators feedback unrendered on page with multiple forms and feedback filtered

2011-09-15 Thread Andrea Del Bene

Hi,

are form1 and form2 nested inside another form?

hi,

got the following composite:
page
|-form1
| |-field1
| | |-StringValidator.MaximumLengthValidator [1]
| |-feedbackPanel1(ComponentFeedbackMessageFilter(form1) [3])
|-form2
   |-field2
   | |-StringValidator.MaximumLengthValidator [2]
   |-feedbackPanel2(ComponentFeedbackMessageFilter(form2) [4])

when explicitly calling whatever feedback method (info, error) on
submit of form1/form2 feedback messages do render ok.

but when static validators [1]/[2] apply, and not pass, feedback
messages are not rendered, and output console is:

WARN  - WebSession - Component-targetted feedback message was left
unrendered. This could be because you are missing a FeedbackPanel on
the page.  Message: ...

this happens when constructing feedback panels with message filters
[3]/[4], required to permit forms differenciation on feedback output.
in other case, validators feedback messages are rendered ok, but
repeated on both feedback panels, which is not desirable.

should any other settings be applied on composite to render static
validators results on these filtered feedback panels?

thank you

ps this is wicket 1.4.17

-
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



GAE, DataView and performance

2011-09-15 Thread Chris Merrill
I'm using Objectify for datastore access in GAE, though the problem would
be the same if I was using the datastore API directly.

For optimal performance, Google recommends doing batch requests to the
datastore whenever possible - they say making the requests in parallel
is much faster than serial.  They also recommend retrieving keys instead
of the entire entity whenever you may not need each entity right away -
such as for a paginated list.  I've seen some posts indicating that the
performance improvement can be a factory of 10x - e.g. serially fetching
20 items will be 20x a single fetch, but fetching them in parallel
might only be 2x a single fetch.

I'm having difficulty seeing how I would follow those recommendations when
using a DataView with PagingNavigator.  My initial query for all the entities
in the list should be for the keys, since only a fraction of the entities will
be displayed at a time. However, since populateItem() is called serially for
each list item, I cannot batch the requests that resolve the keys to their
entities. For best performance, I need to get a callback when a group of items
will be rendered so that I can fetch them all at once - and then call
populateItem() with the resulting items one at a time.

I'm guessing I'll need to dig into DataView and extend it, or perhaps
roll my own implementation?


As an example, here is my current, non-optimal, implementation:

ListKeyMyEntity keys = db.getMyEntityKeys();
DataViewKeyMyEntity list = new DataViewKeyMyEntity(entity_list, new
ListDataProviderKeyMyEntity(keys)
  {
  protected void populateItem(final ItemKeyMyEntity item)
{
KeyMyEntity key = item.getModel().getObject();
MyEntity entity = db.getMyEntity(key);
 add components for the entity
}
  }
list.setItemsPerPage(20);
add(list);
add(new PagingNavigator(paginator, list);


The optimized version would perhaps look something like the example below,
which resolves all the keys to their entities in one method and then the
populateItem() expects the entity, rather than the key:

ListKeyMyEntity keys = db.getMyEntityKeys();
DataViewKeyMyEntity list = new DataViewKeyMyEntity(entity_list, new
ListDataProviderKeyMyEntity(keys)
  {
  protected ListMyEntity getPageOfEntities(ListKeyMyEntity keys)
{
return db.getEntitiesForKeys(keys);
}
  protected void populateItem(final ItemMyEntity item)
{
MyEntity entity = item.getModel().getObject();
 add components for the entity
}
  }
list.setItemsPerPage(20);
add(list);
add(new PagingNavigator(paginator, list);


Anyone have any suggestions how I can do this without essentially 
re-implementing
DataView?  I probably should have looked further into the DataView code before
posting...but the Wicket community seems to have already solved every other 
problem
I've come across, so I though I'd ask here first :

TIA!
Chris


-- 
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Web Performance: Website Load Testing Software  Services
 -

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



Re: GAE, DataView and performance

2011-09-15 Thread manuelbarzi
may you execute the query db in IDataProvider.iterator, instead of
populateItem. see IDataProvider javadoc.
.



On Thu, Sep 15, 2011 at 3:16 PM, Chris Merrill ch...@webperformance.com wrote:
 I'm using Objectify for datastore access in GAE, though the problem would
 be the same if I was using the datastore API directly.

 For optimal performance, Google recommends doing batch requests to the
 datastore whenever possible - they say making the requests in parallel
 is much faster than serial.  They also recommend retrieving keys instead
 of the entire entity whenever you may not need each entity right away -
 such as for a paginated list.  I've seen some posts indicating that the
 performance improvement can be a factory of 10x - e.g. serially fetching
 20 items will be 20x a single fetch, but fetching them in parallel
 might only be 2x a single fetch.

 I'm having difficulty seeing how I would follow those recommendations when
 using a DataView with PagingNavigator.  My initial query for all the entities
 in the list should be for the keys, since only a fraction of the entities will
 be displayed at a time. However, since populateItem() is called serially for
 each list item, I cannot batch the requests that resolve the keys to their
 entities. For best performance, I need to get a callback when a group of items
 will be rendered so that I can fetch them all at once - and then call
 populateItem() with the resulting items one at a time.

 I'm guessing I'll need to dig into DataView and extend it, or perhaps
 roll my own implementation?


 As an example, here is my current, non-optimal, implementation:

 ListKeyMyEntity keys = db.getMyEntityKeys();
 DataViewKeyMyEntity list = new DataViewKeyMyEntity(entity_list, new
 ListDataProviderKeyMyEntity(keys)
  {
  protected void populateItem(final ItemKeyMyEntity item)
    {
    KeyMyEntity key = item.getModel().getObject();
    MyEntity entity = db.getMyEntity(key);
     add components for the entity
    }
  }
 list.setItemsPerPage(20);
 add(list);
 add(new PagingNavigator(paginator, list);


 The optimized version would perhaps look something like the example below,
 which resolves all the keys to their entities in one method and then the
 populateItem() expects the entity, rather than the key:

 ListKeyMyEntity keys = db.getMyEntityKeys();
 DataViewKeyMyEntity list = new DataViewKeyMyEntity(entity_list, new
 ListDataProviderKeyMyEntity(keys)
  {
  protected ListMyEntity getPageOfEntities(ListKeyMyEntity keys)
    {
    return db.getEntitiesForKeys(keys);
    }
  protected void populateItem(final ItemMyEntity item)
    {
    MyEntity entity = item.getModel().getObject();
     add components for the entity
    }
  }
 list.setItemsPerPage(20);
 add(list);
 add(new PagingNavigator(paginator, list);


 Anyone have any suggestions how I can do this without essentially 
 re-implementing
 DataView?  I probably should have looked further into the DataView code before
 posting...but the Wicket community seems to have already solved every other 
 problem
 I've come across, so I though I'd ask here first :

 TIA!
 Chris


 --
  -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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: Creating a resource from a byte array and its content type

2011-09-15 Thread Ian Marshall
I don't know why I said that ByteArrayResource was abstract. Sorry about
that; I got it mixed up with another class.

I need to keep my byte array wrapped in a LoadableDetachableModel, in order
to prevent the array being stored in the page and session, so I do not
supply an IResource to the NonCachingImage component constructor; I use
NonCachingImage(String id, IModel? myLDM) instead.

After looking at what my use of the Wicket and Java classes did, which,
despite all the streams and content type, was just to copy an image byte
array, I shall now do a direct copy and see what happens.

Thank you very much for your pointers, Martin; in my view, two minds do
indeed make three.

Ian

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815697.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: Creating a resource from a byte array and its content type

2011-09-15 Thread Martin Grigorov
On Thu, Sep 15, 2011 at 5:13 PM, Ian Marshall ianmarshall...@gmail.com wrote:
 I don't know why I said that ByteArrayResource was abstract. Sorry about
 that; I got it mixed up with another class.

 I need to keep my byte array wrapped in a LoadableDetachableModel, in order
 to prevent the array being stored in the page and session, so I do not
 supply an IResource to the NonCachingImage component constructor; I use
 NonCachingImage(String id, IModel? myLDM) instead.
With the dynamic nature of ByteArrayResource you also can load the
byte[] on demand without storing it.

 After looking at what my use of the Wicket and Java classes did, which,
 despite all the streams and content type, was just to copy an image byte
 array, I shall now do a direct copy and see what happens.

 Thank you very much for your pointers, Martin; in my view, two minds do
 indeed make three.

 Ian

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815697.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: Creating a resource from a byte array and its content type

2011-09-15 Thread Ian Marshall
I used my other method instead of using ByteArrayResource directly, in order
to reduce session size. I therefore presume that I was using
ByteArrayResource incorrectly for that reduction to happen!



Martin Grigorov-4 wrote:
 
 On Thu, Sep 15, 2011 at 5:13 PM, Ian Marshall
 lt;ianmarshall...@gmail.comgt; wrote:
 I don't know why I said that ByteArrayResource was abstract. Sorry about
 that; I got it mixed up with another class.

 I need to keep my byte array wrapped in a LoadableDetachableModel, in
 order
 to prevent the array being stored in the page and session, so I do not
 supply an IResource to the NonCachingImage component constructor; I use
 NonCachingImage(String id, IModel? myLDM) instead.
 With the dynamic nature of ByteArrayResource you also can load the
 byte[] on demand without storing it.

 After looking at what my use of the Wicket and Java classes did, which,
 despite all the streams and content type, was just to copy an image byte
 array, I shall now do a direct copy and see what happens.

 Thank you very much for your pointers, Martin; in my view, two minds do
 indeed make three.

 Ian

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815697.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
 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Creating-a-resource-from-a-byte-array-and-its-content-type-tp3815188p3815727.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



Display HTML in Label with validation

2011-09-15 Thread Daniel Stoch
Hi,

How to display dynamic HTML content on page which can be invalid
(because this HTML is entered by a user). I can use
Label.setEscapeModelStrings(false), but with invalid HTML content the
page will not be rendered (because of HTML parsing error). So maybe I
can use some of standard Wicket mechanisms to parse this HTML first to
check if I can display it on page? There are some parsers within
framework...

--
Daniel

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



Panel Loop

2011-09-15 Thread Fred
Hello,

I have a panel to which I want to add multiple items. I have put it into a
loop and as long as I have only one panel I am good, with more than one it
errorsI get why it errors, it has a panel with that name already, however I
have no idea how to solve this.

Can I create a list of the EmployeePanel and then somehow merge them
together and then add?

Here is what I am trying to do:

for(People person : searchResponse.getAll())
{   
for(Employees employee : person.getEmployees())
{
for(District dis : person.getDistrict())
{
form.add(new EmployeePanel(people, employee, dis));
 // make this a list instead???
}
}   
}
//now merge EmployeePanel list and add?


Thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-Loop-tp3815879p3815879.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: Panel Loop

2011-09-15 Thread Bas Gooren

Have a look at repeaters (e.g. RepeatingView and ListView).

Op 15-9-2011 17:10, schreef Fred:

Hello,

I have a panel to which I want to add multiple items. I have put it into a
loop and as long as I have only one panel I am good, with more than one it
errorsI get why it errors, it has a panel with that name already, however I
have no idea how to solve this.

Can I create a list of the EmployeePanel and then somehow merge them
together and then add?

Here is what I am trying to do:

for(People person : searchResponse.getAll())
{   
for(Employees employee : person.getEmployees())
{
for(District dis : person.getDistrict())
{
form.add(new EmployeePanel(people, employee, dis));
 // make this a list instead???
}
}   
}
//now merge EmployeePanel list and add?


Thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-Loop-tp3815879p3815879.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: Panel Loop

2011-09-15 Thread manuelbarzi
may you need a RepeatingView. see javadoc.
.



On Thu, Sep 15, 2011 at 5:10 PM, Fred smiths...@hotmail.com wrote:
 Hello,

 I have a panel to which I want to add multiple items. I have put it into a
 loop and as long as I have only one panel I am good, with more than one it
 errorsI get why it errors, it has a panel with that name already, however I
 have no idea how to solve this.

 Can I create a list of the EmployeePanel and then somehow merge them
 together and then add?

 Here is what I am trying to do:

 for(People person : searchResponse.getAll())
 {
        for(Employees employee : person.getEmployees())
        {
                for(District dis : person.getDistrict())
                {
                        form.add(new EmployeePanel(people, employee, dis));
                         // make this a list instead???
                }
        }
 }
 //now merge EmployeePanel list and add?


 Thanks




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Panel-Loop-tp3815879p3815879.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



Default Captcha Implementation in Wicket 1.5

2011-09-15 Thread Erinc Arikan
Hi everybody;

I am a newbie, so I hope my question won't be too trivial, I've been going
through some examples, I am currently using Wicket 1.5 and I just included
latest wicket extensions jar to my build path(which is 3 years old)

String imagePass = randomString(6, 8);
add(new Image(challenge, new CaptchaImageResource(imagePass)));

I am receiving type wicket.markup.html.image.resource.DynamicImageResource
can not be resolved, it is indirectly referenced error, which is the true,
since we have BufferedDynamicImageResource instead.

Do we have another way of implementing a captcha component using wicket 1.5?
Or do I have to go with Recaptcha?

Erinc


Re: Display HTML in Label with validation

2011-09-15 Thread manuelbarzi
may HtmlDocumentValidator help you.
.



On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch daniel.st...@gmail.com wrote:
 Hi,

 How to display dynamic HTML content on page which can be invalid
 (because this HTML is entered by a user). I can use
 Label.setEscapeModelStrings(false), but with invalid HTML content the
 page will not be rendered (because of HTML parsing error). So maybe I
 can use some of standard Wicket mechanisms to parse this HTML first to
 check if I can display it on page? There are some parsers within
 framework...

 --
 Daniel

 -
 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: Panel Loop

2011-09-15 Thread Fred
Thanks!

worked with:

RepeatingView view = new RepeatingView(people);

for(People person : searchResponse.getAll()) 
{ 
for(Employees employee : person.getEmployees()) 
{ 
for(District dis : person.getDistrict()) 
{
 view.add(new EmployeePanel(view.newChildId(), employee, dis));
} 
} 
}
form.add(view);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panel-Loop-tp3815879p3816023.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



Minor typo in the Migration to Wicket 1.5 guide?

2011-09-15 Thread Ian Marshall
Under the final section List of renamed classes and methods, should the
first 1.4 class listed not be

  org.apache.wicket.request.resource.ResourceReference

but

  org.apache.wicket.ResourceReference?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816035.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



HomePage with PageParameters wicket 1.5

2011-09-15 Thread Mikko Pukki
Hi,

Is there any reasonable way to set PageParameters for home page. In wicket 1.4
it was possible to override WebRequestCycleProcessor's resolveHomePageTarget 
method
and add RequestParameters for the request.
We do use this functionality because application has customizable home pages 
per user and
some pages do need parameters to show correct view for the user.

I tried to implement my own version of HomePageMapper (and provider) and use it 
with the Application
but so far no success.

Is there anywhere a diagram of new request handling cycle? I have debugged and 
tried to
read the code to understand the inner workings of wicket 1.5 but there are 
still some things
that are not clear for me.

Reqards,
 Mikko Pukki


Re: Default Captcha Implementation in Wicket 1.5

2011-09-15 Thread Igor Vaynberg
wicket 1.5 jars are not three years old, so you probably have the wrong jar

to see how to implement the catcha see the captcha example in
wicket-examples. live one here:
http://www.wicketstuff.org/wicket/captcha

-igor

On Thu, Sep 15, 2011 at 8:31 AM, Erinc Arikan erincari...@gmail.com wrote:
 Hi everybody;

 I am a newbie, so I hope my question won't be too trivial, I've been going
 through some examples, I am currently using Wicket 1.5 and I just included
 latest wicket extensions jar to my build path(which is 3 years old)

 String imagePass = randomString(6, 8);
 add(new Image(challenge, new CaptchaImageResource(imagePass)));

 I am receiving type wicket.markup.html.image.resource.DynamicImageResource
 can not be resolved, it is indirectly referenced error, which is the true,
 since we have BufferedDynamicImageResource instead.

 Do we have another way of implementing a captcha component using wicket 1.5?
 Or do I have to go with Recaptcha?

 Erinc


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



Re: HomePage with PageParameters wicket 1.5

2011-09-15 Thread Igor Vaynberg
i dont really understand your question. homepage should be accessible
without parameters, but in any case

urlfor(homepage.class, pageparameters) should generate a correct url...

-igor

On Thu, Sep 15, 2011 at 9:06 AM, Mikko Pukki
mikko.pu...@syncrontech.com wrote:
 Hi,

 Is there any reasonable way to set PageParameters for home page. In wicket 1.4
 it was possible to override WebRequestCycleProcessor's resolveHomePageTarget 
 method
 and add RequestParameters for the request.
 We do use this functionality because application has customizable home pages 
 per user and
 some pages do need parameters to show correct view for the user.

 I tried to implement my own version of HomePageMapper (and provider) and use 
 it with the Application
 but so far no success.

 Is there anywhere a diagram of new request handling cycle? I have debugged 
 and tried to
 read the code to understand the inner workings of wicket 1.5 but there are 
 still some things
 that are not clear for me.

 Reqards,
     Mikko Pukki


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



Re: Default Captcha Implementation in Wicket 1.5

2011-09-15 Thread Erinc Arikan
Hi Igor;

Thanks for the response.

Jar file that is three years old isn't wicket 1.5.0 jar, it's the
wicket-extensions jar.

I already checked the example that you posted, it's importing from

import org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource
;

I am using wicket-1.5-RC7, My quickstart project is not able to reference
neither CaptchaImageResource nor anything from
org.apache.wicket.extensions.*.

So I went ahead and googled wicket extensions, newest version that I can
find was from 2008 which is wicket-extensions-1.2.7.

If you know where/how I can get a newer wicket-extensions.jar, I'd really
appreciate it.

Erinc

Erinc



On Thu, Sep 15, 2011 at 12:57 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 wicket 1.5 jars are not three years old, so you probably have the wrong jar

 to see how to implement the catcha see the captcha example in
 wicket-examples. live one here:
 http://www.wicketstuff.org/wicket/captcha

 -igor

 On Thu, Sep 15, 2011 at 8:31 AM, Erinc Arikan erincari...@gmail.com
 wrote:
  Hi everybody;
 
  I am a newbie, so I hope my question won't be too trivial, I've been
 going
  through some examples, I am currently using Wicket 1.5 and I just
 included
  latest wicket extensions jar to my build path(which is 3 years old)
 
  String imagePass = randomString(6, 8);
  add(new Image(challenge, new CaptchaImageResource(imagePass)));
 
  I am receiving type
 wicket.markup.html.image.resource.DynamicImageResource
  can not be resolved, it is indirectly referenced error, which is the
 true,
  since we have BufferedDynamicImageResource instead.
 
  Do we have another way of implementing a captcha component using wicket
 1.5?
  Or do I have to go with Recaptcha?
 
  Erinc
 

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




Re: Default Captcha Implementation in Wicket 1.5

2011-09-15 Thread Dan Retzlaff
http://repo1.maven.org/maven2/org/apache/wicket/wicket-extensions/

On Thu, Sep 15, 2011 at 10:13 AM, Erinc Arikan erincari...@gmail.comwrote:

 Hi Igor;

 Thanks for the response.

 Jar file that is three years old isn't wicket 1.5.0 jar, it's the
 wicket-extensions jar.

 I already checked the example that you posted, it's importing from

 import
 org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource
 ;

 I am using wicket-1.5-RC7, My quickstart project is not able to reference
 neither CaptchaImageResource nor anything from
 org.apache.wicket.extensions.*.

 So I went ahead and googled wicket extensions, newest version that I can
 find was from 2008 which is wicket-extensions-1.2.7.

 If you know where/how I can get a newer wicket-extensions.jar, I'd really
 appreciate it.

 Erinc

 Erinc



 On Thu, Sep 15, 2011 at 12:57 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:

  wicket 1.5 jars are not three years old, so you probably have the wrong
 jar
 
  to see how to implement the catcha see the captcha example in
  wicket-examples. live one here:
  http://www.wicketstuff.org/wicket/captcha
 
  -igor
 
  On Thu, Sep 15, 2011 at 8:31 AM, Erinc Arikan erincari...@gmail.com
  wrote:
   Hi everybody;
  
   I am a newbie, so I hope my question won't be too trivial, I've been
  going
   through some examples, I am currently using Wicket 1.5 and I just
  included
   latest wicket extensions jar to my build path(which is 3 years old)
  
   String imagePass = randomString(6, 8);
   add(new Image(challenge, new CaptchaImageResource(imagePass)));
  
   I am receiving type
  wicket.markup.html.image.resource.DynamicImageResource
   can not be resolved, it is indirectly referenced error, which is the
  true,
   since we have BufferedDynamicImageResource instead.
  
   Do we have another way of implementing a captcha component using wicket
  1.5?
   Or do I have to go with Recaptcha?
  
   Erinc
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: HomePage with PageParameters wicket 1.5

2011-09-15 Thread Martin Grigorov
The home page cannot have indexed parameters (/indexed1/indexed2)
because this way it will match every request which is not matched by
another mapper with higher compatibility score. But it should work
with query parameters (/?param1=value1...)

On Thu, Sep 15, 2011 at 7:06 PM, Mikko Pukki
mikko.pu...@syncrontech.com wrote:
 Hi,

 Is there any reasonable way to set PageParameters for home page. In wicket 1.4
 it was possible to override WebRequestCycleProcessor's resolveHomePageTarget 
 method
 and add RequestParameters for the request.
 We do use this functionality because application has customizable home pages 
 per user and
 some pages do need parameters to show correct view for the user.

 I tried to implement my own version of HomePageMapper (and provider) and use 
 it with the Application
 but so far no success.

 Is there anywhere a diagram of new request handling cycle? I have debugged 
 and tried to
 read the code to understand the inner workings of wicket 1.5 but there are 
 still some things
 that are not clear for me.

 Reqards,
     Mikko Pukki




-- 
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: Minor typo in the Migration to Wicket 1.5 guide?

2011-09-15 Thread Martin Grigorov
fixed

the wiki is editable by everyone. improve it! ;-)

On Thu, Sep 15, 2011 at 7:03 PM, Ian Marshall ianmarshall...@gmail.com wrote:
 Under the final section List of renamed classes and methods, should the
 first 1.4 class listed not be

  org.apache.wicket.request.resource.ResourceReference

 but

  org.apache.wicket.ResourceReference?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816035.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: Minor typo in the Migration to Wicket 1.5 guide?

2011-09-15 Thread Ian Marshall
Good point, Martin. I never noticed the Edit Page link at the top of the
migration guide until your post.

Next time, I'll (register and) log on to the Apache Software Foundation and
submit minor typo corrections myself.



Martin Grigorov-4 wrote:
 
 fixed
 
 the wiki is editable by everyone. improve it! ;-)
 
 On Thu, Sep 15, 2011 at 7:03 PM, Ian Marshall
 lt;ianmarshall...@gmail.comgt; wrote:
 Under the final section List of renamed classes and methods, should the
 first 1.4 class listed not be

  org.apache.wicket.request.resource.ResourceReference

 but

  org.apache.wicket.ResourceReference?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816035.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
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Minor-typo-in-the-Migration-to-Wicket-1-5-guide-tp3816035p3816542.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



Stateful pages without page Id in the url

2011-09-15 Thread hok
Hello,
I have an application where all the pages are stateful (have ajax components
in them). However, most of the pages are also bookmarkable and can be fully
restored via the PageParameters. In addition to this, some of pages with
input forms contain unmanaged hibernate entities (unmanaged, because they
can be modified via ajax) and I would prefer to refresh every time the page
is requested from the server, instead of retrieving the page from the page
store. When wicket 1.5 was released I created the following class:

public class NoPageIdMountedMapper extends MountedMapper {

...

@Override
protected void encodePageComponentInfo(Url url, PageComponentInfo info)
{
super.encodePageComponentInfo(url, null);
}
}

which removed the page Id from the url and this didn't result in any other
change in the behavior. However in the latest wicket revisions (currently in
1.5-SNAPSHOT) this technique doesn't work anymore - the ajax in the pages
using NoPageIdMountedMapper is not working, because the ajax request url
doesn't contain the page id anymore. 

Is it still possible to have stateful pages without having the page id in
the url? Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816663.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: Stateful pages without page Id in the url

2011-09-15 Thread Pedro Santos
Hi, yes you can, but F5 will instance the page again and its state will get
lost.
I think the problem is related to
https://issues.apache.org/jira/browse/WICKET-4014
Can you open a ticket so we can track it?

2011/9/15 hok ivanvasi...@gmail.com

 Hello,
 I have an application where all the pages are stateful (have ajax
 components
 in them). However, most of the pages are also bookmarkable and can be fully
 restored via the PageParameters. In addition to this, some of pages with
 input forms contain unmanaged hibernate entities (unmanaged, because they
 can be modified via ajax) and I would prefer to refresh every time the page
 is requested from the server, instead of retrieving the page from the page
 store. When wicket 1.5 was released I created the following class:

 public class NoPageIdMountedMapper extends MountedMapper {

...

@Override
protected void encodePageComponentInfo(Url url, PageComponentInfo info)
 {
super.encodePageComponentInfo(url, null);
}
 }

 which removed the page Id from the url and this didn't result in any other
 change in the behavior. However in the latest wicket revisions (currently
 in
 1.5-SNAPSHOT) this technique doesn't work anymore - the ajax in the pages
 using NoPageIdMountedMapper is not working, because the ajax request url
 doesn't contain the page id anymore.

 Is it still possible to have stateful pages without having the page id in
 the url? Thanks in advance.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816663.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Stateful pages without page Id in the url

2011-09-15 Thread hok
Thanks for the fast response. In my case though, I have pages that are
defined by their page parameters, so even if the page is expired, pressing
F5 would reload the same page from the server (and it's not important if the
state is lost). However if I'm using the aforementioned
NoPageIdMountedMapper the ajax in the page is not working. So is there
another way besides this for achieving stateful page without page id in the
url?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816779.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



MixedParamUrlCodingStrategy and form submit

2011-09-15 Thread Alexander Gubin

Googled around, but no clear answer:

In my app I mount a page like this:

mount(new MixedParamUrlCodingStrategy(/store/product, ItemPage.class, 
new String[]{itemId, itemName}));


which gives me a URL

store/product/45336/some-name

I have a form on the resulting page, which on submit sends me to

store/?wicket:interface=:3:itemForm::IFormSubmitListener::

hence 404

looking at form's action I see 
../../?wicket:interface=:3:itemForm::IFormSubmitListener::,


but I think I need ../?wicket:interface=:3:itemForm::IFormSubmitListener::

What am I doing wrong? Last two elements are parameters and should be 
discounted, but seems like Wicket add's one extra ../ and misses 
mounted page.


Are there better way of configuring Mounting / forms ?

Sincerely,

Alexander

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



Re: Stateful pages without page Id in the url

2011-09-15 Thread Martin Grigorov
If WICKET-4014 is the reason then the following workaround should revert it:

@Override
public Url mapHandler(IRequestHandler requestHandler)
{
if (requestHandler instanceof ListenerInterfaceRequestHandler) {
return null;
} else {
 return super.mapHandler(requestHandler);
}
}


Why you are so keen to not have page id in the url ?

On Fri, Sep 16, 2011 at 12:00 AM, hok ivanvasi...@gmail.com wrote:
 Thanks for the fast response. In my case though, I have pages that are
 defined by their page parameters, so even if the page is expired, pressing
 F5 would reload the same page from the server (and it's not important if the
 state is lost). However if I'm using the aforementioned
 NoPageIdMountedMapper the ajax in the page is not working. So is there
 another way besides this for achieving stateful page without page id in the
 url?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816779.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: Wicket 1.5: request mapper to make all urls absolute

2011-09-15 Thread Bas Gooren

Ok, I've been playing around with this, and it doesn't work.

WebPageRenderer#respond() compares the current url to the target url.
The current url is always normalized (without context path), so if my 
absolute mapper generates a target url which is absolute, and as such 
includes the context path and the filter path, wicket initiates a redirect.


Then, on the next request, the exact same thing happens, so we end up in 
a redirect loop.


It appears that the only way to achieve what I want is to override the 
UrlRenderer and it's method #renderRelativeUrl(). Basically, all that is 
required there is to prefix the context path and filter path.


Op 15-9-2011 1:58, schreef Igor Vaynberg:

that sounds correct.

essentially this is the same as running the url through
requestcycle.geturlrenderer().renderFullUrl(url) but with a different
prefix

-igor

On Wed, Sep 14, 2011 at 4:54 PM, Bas Goorenb...@iswd.nl  wrote:

Hi,

Another wicket 1.5 migration question:
In 1.4 we created a IRequestCodingStrategy decorator which, in encode(),
translates all urls to be absolute.
We did this by checking if the url started with /, and if not, removing
all occurrences of ../ and ./.

To handle being behind a reverse proxy, the constructor optionally accepted
a prefix which was always prepended.

In 1.5 it seems this could be implemented as an IRequestMapper which
decorates the root mapper.
However, since we are passed a Url instead of a String, and a lot has
changed surrounding url generation, what is the best way to make all urls
absolute?

I'm thinking:
- check Url.isAbsolute()
- remove segments which are .. or .
- prepend prefix segments

Is this the correct way?

Sebastian


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



Re: Stateful pages without page Id in the url

2011-09-15 Thread hok
Thanks Martin,
your solution seems to work. There are two cases where I need stateful pages
without page id. 
The first one is for purely aesthetic reasons and concerns bookmarkable
pages which can be opened with page parameters.
The second is a bit more important. I have a user profile page, where a user
can edit it's profile. This is a (relatively) complex form and, for example,
each user can add/remove contacts from a list (via ajax) and after this to
submit the form and the changes go to the database. Because of the ajax
lists I'm unable to use LoadableDetachableModel for the User object (which
is hibernate entity) and I'm using a regular Model. In this case, if the
page has id the user can make some changes to the profile and then to save
them. However, he can also return to an earlier version of the same page,
which also contains the same unmananged user object, but with older state
and not synchronized with the database (because of the newer changes).
This is a case I'm trying to avoid and by making the page not cache-able and
removing the id I can guarantee that whenever the user opens this page it'll
always be instantiated again with the correct state of the entity. In this
case though, the back functionality provided by the page id's is lost. Do
you know of a more elegant solution to the problem of having forms,
containing ajax lists? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3817023.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: Stateful pages without page Id in the url

2011-09-15 Thread Dan Retzlaff
We have use cases similar to this. For explanation purposes, consider a User
class that has a collection of Features.

We have an IModelListFeature implementation called
EntityListModelFeature. This class maintains a list of feature IDs within
its implementation (the actual list of Features is transient). It's
essentially the same as LDM, but has logic in onDetach() that replaces its
ID list with IDs for the list's contents at the end of the current request.

So during the editing process, the contents of this list are changed, *but
at no point are any entities serialized into the session.* When the user
eventually clicks Save, the User entity's collection is replaced with the
EntityListModel's collection and pushed to the database.

When I first started with Wicket I did a lot of entity serialization tricks
like you mention. I've since taken a hard and fast rule against it since it
causes a myriad of problems. But of course your mileage may vary. :)

Regards,
Dan

On Thu, Sep 15, 2011 at 4:24 PM, hok ivanvasi...@gmail.com wrote:

 Thanks Martin,
 your solution seems to work. There are two cases where I need stateful
 pages
 without page id.
 The first one is for purely aesthetic reasons and concerns bookmarkable
 pages which can be opened with page parameters.
 The second is a bit more important. I have a user profile page, where a
 user
 can edit it's profile. This is a (relatively) complex form and, for
 example,
 each user can add/remove contacts from a list (via ajax) and after this to
 submit the form and the changes go to the database. Because of the ajax
 lists I'm unable to use LoadableDetachableModel for the User object (which
 is hibernate entity) and I'm using a regular Model. In this case, if the
 page has id the user can make some changes to the profile and then to save
 them. However, he can also return to an earlier version of the same page,
 which also contains the same unmananged user object, but with older state
 and not synchronized with the database (because of the newer changes).
 This is a case I'm trying to avoid and by making the page not cache-able
 and
 removing the id I can guarantee that whenever the user opens this page
 it'll
 always be instantiated again with the correct state of the entity. In this
 case though, the back functionality provided by the page id's is lost. Do
 you know of a more elegant solution to the problem of having forms,
 containing ajax lists?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3817023.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: Create a stand-alone link and get its URL

2011-09-15 Thread Alec Swan
Great idea, worked like a charm.

Thanks!

On Tue, Sep 13, 2011 at 8:19 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 create a single metadata key that holds a mapstring,object where
 string is a uuid.

 -igor

 On Tue, Sep 13, 2011 at 5:40 PM, Alec Swan alecs...@gmail.com wrote:
 Great idea, thanks.

 As I was working on passing template information as a part of the link
 URL I started thinking that it would be nice if I could store this
 information in session metadata and pass the metadata key as a part of
 the link URL. However, I am not sure if I can pass metadata key in the
 URL somehow.

 Thoughts?

 Thanks,

 Alec

 On Tue, Sep 13, 2011 at 10:44 AM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 add a single link to your page. expose its url as a variable to the
 templating engine and append some sort of id to the url to
 differentiate which template should be used. since you have to put the
 link into markup put it inside an invisible div.

 -igor

 On Tue, Sep 13, 2011 at 8:37 AM, Alec Swan alecs...@gmail.com wrote:
 I don't think this will work because the template could be a method
 invocation, e.g.

 a wicket:id=${var.getLinkToStudentReportWithColumns('First Name',
 'Last Name')}Download/a

 Template-evaluation approach works great for generating HTML reports,
 i.e. the template evaluates to a string that contains raw HTML
 table../table and can be included on any page. So, here is what
 a page containing HTML report looks like:

 div wicket:id=editableLabel
  ${var.studentReportWithColumnsHTML('First Name', 'Last Name')}
 /div

 My code runs templating engine on the content of the editableLabel
 before rendering it.

 However, the new requirement is to expose the same reports for
 download as CSV files and I would like to continue using the
 templating mechanism and be able to support something like:

 div wicket:id=editableLabel
  a wicket:id=${var.getLinkToStudentReportWithColumns('First Name',
 'Last Name')}Download/a
 /div

 Thoughts?

 Thanks,

 Alec

 On Tue, Sep 13, 2011 at 1:00 AM, Sven Meier s...@meiers.net wrote:
 Why don't you just use a component for this, e.g. DownloadLink?

 a wicket:id=${var.wellKnownWicketId}Download/a

 No stable url involved.

 Sven

 On 09/13/2011 04:45 AM, Alec Swan wrote:
 Our templating engine is the one that needs to generate the link by
 evaluating a template similar to a
 href='${var.reportLink}'Download/a. The engine does not have
 access to any Wicket components but can access Thread local
 properties, such as RequestCycle.get(). I guess we could add a
 behavior to RequestCycle.get().getResponsePage().

 Is this what you are suggesting or there is a more elegant way to
 implement this in Wicket?

 Thanks,

 Alec

 On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 the problem is when you say build a url to an instance of this
 request target wicket doesnt hold on to the instance, nor does it
 have any way to recreate it.

 what you can do is add a behavior to the page and construct a url to
 that behavior.

 -igor


 On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan alecs...@gmail.com wrote:
 I don't really need a stable URL. In fact, I would prefer if the link
 URL was session or page-specific so that it cannot be accessed by
 anybody unless they first accessed the page that contains the link.

 I would like to do something along the lines of the code in my
 original post. In other words, I would like to create a new
 RequestTarget and get its URL and display that URL to the user.

 Thanks,

 Alec


 On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg 
 igor.vaynb...@gmail.com wrote:
 create a resource and register it in shared resources, this will allow
 you to create a stable url. the filename and reportdata you will have
 to pass on the url.

 -igor

 On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 We use a templating engine which generates parts of our pages.
 Templates can be included on any page. We need the engine to be able
 to generate a link which will display a report when clicked. I tried
 using the following code, but it returns null from
 RequestTarget.urlFor(..):

 public String getReportLink() {
        return  + RequestCycle.get().urlFor(new
 DownloadCsvRequestTarget(fileName, reportData));
 }

 Where DownloadCsvRequestTarget implements respond() method to write
 reportData our in CSV format.

 Thanks,

 Alec

 -
 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: 

IHeaderContributor#renderHead does not inject CSS on panel swap

2011-09-15 Thread Alec Swan
Hello,

Our app uses panel swapping as a tabbing implementation.

I noticed that if I inject CSS using
component.add(CSSPackageResource.getHeaderContribution(resourceRef,
media)) during panel construction, then the CSS is included correctly
and takes effect after the panel swap. However, if I inject the same
CSS in IHeaderContributor#renderHead() using
response.renderCSSReference(resourceRef, media) then CSS is not
included after the panel swap and hence does not take effect.

How can I get CSS injection to work in IHeaderContributor#renderHead()?

Thanks,

Alec

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



Re: IHeaderContributor#renderHead does not inject CSS on panel swap

2011-09-15 Thread Igor Vaynberg
that should work, please create a quickstart.

-igor

On Thu, Sep 15, 2011 at 8:06 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Our app uses panel swapping as a tabbing implementation.

 I noticed that if I inject CSS using
 component.add(CSSPackageResource.getHeaderContribution(resourceRef,
 media)) during panel construction, then the CSS is included correctly
 and takes effect after the panel swap. However, if I inject the same
 CSS in IHeaderContributor#renderHead() using
 response.renderCSSReference(resourceRef, media) then CSS is not
 included after the panel swap and hence does not take effect.

 How can I get CSS injection to work in IHeaderContributor#renderHead()?

 Thanks,

 Alec

 -
 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



AjaxSubmitLink 1.4.18 issue/not working

2011-09-15 Thread Wayne W
Hi,

I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
AjaxSubmitLink is not working  (at least with one form).

The form doesn't get submitted - the problem in wicket-ajax.js is (~line 1120):

// Submits a form using ajax.
// This method serializes a form and sends it as POST body.
submitForm: function(form, submitButton) {
var submittingAttribute = 'data-wicket-submitting';
if (form.onsubmit  !form.getAttribute(submittingAttribute)) {
form.setAttribute(submittingAttribute, 
submittingAttribute);
var retValue = form.onsubmit();
form.removeAttribute(submittingAttribute);
if (!retValue) return;
}


The problem is var retValue = form.onsubmit(); does not return any
value (retValue remains undefined) and hence it returns and doesn't do
the submit. I don't know enough about javascript to really understand
whats happening here. The form is fairly unremarkable.

For now I've patch the wicket-ajax.js code and comment out the return,
and it works fine again. I notice this code here was not in 1.4.8. But
obviously this is not the solution.

So I imagine it something to do with the form, but I don't know where
to start and look - what is normally returned by form.onsubmit();?
what can I look for?

many thanks

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