Remove busy indicator from ajax timer behavior?

2010-05-12 Thread Early Morning
Hi All,

I followed this to implement a sitewide busy indicator:
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

However, I have an ajax behavior that polls in the page every 2 seconds, and
every time it does the busy indicator flashes since the showBusysign()
javascript method is registered as the PreCallHandler. How can I remove the
busy indicator for only the polling behavior but keep it for other Ajax
requests? Thanks!


Regards,

Ces


Testing wicket pages in isolation (wickettester)

2010-05-12 Thread Vincent Lussenburg
Hi all,

I'm sending this page to check if I've drawn the correct conclusions on
testing wicket pages in isolation.

The situation is as follows: we have a number of pages that work on the same
model object. The object is passed from page to page in page transitions. So
for example, when the 'next' button is pressed, setResponsePage(new
NextPage(modelObject)); is called. The constructor of these pages explicitly
require the typed object.

We're testing these pages using WicketTester. What happens now is that if an
action is done to invoke the next page, that page is also constructed
(normal POJO behavior) and rendered (by WicketTester). This means we have to
prepare our mocks for any code executed in the next page as well. That
violates the DRY principle, we'd rather test the page in isolation and only
check that the page is constructed with the correct argument. The following
solutions came to mind:

1) Change the constructor to accept PageParameters instead in which we put
the model object we wish to pass and use the IPageFactory to construct the
page. In tests, we can mock the IPageFactory to expect the call and return a
DummyHomePage instead. Downside is that production code is less obvious -
contracts are less strict.

2) Place the code that creates the pages in a protected method we can
override in test mode. So, in production code we have:

WebPage createNextPage(final ModelObject modelObject) {
  return new NextPage(orderModel.getObject());
}

In test code we have:

class TestableNextPage extends NextPage {
[]
@Override
WebPage createNextPage(final ModelObject modelObject) {
  nextPageWasCalled = true;
  return new DummyHomePage();
}
}

3) Create our own PageFactory specialization that supports
createPage(Class? extends Page pageClass, Object...
constructorParameters))... but I have a feeling that there's a reason it's
not included in Wicket.

I find solution 2) now least intrusive in production code so we're using
this approach, currently but I'm not overly enthusiastic about it.

Are there any options I'm overlooking?

Thanks for your insights,
Vincent.


AW: Remove busy indicator from ajax timer behavior?

2010-05-12 Thread Stefan Lindner
I don't use it but i suggest something like

div class=hideBusy
   div qwicket:id=budyIndicator/
/div


and use 

div.hideBusy {
display:none;
}

in css.

Just theoretically, not tested

Stefan

-Ursprüngliche Nachricht-
Von: Early Morning [mailto:goodmorning...@gmail.com]
Gesendet: Mi 12.05.2010 09:44
An: users@wicket.apache.org
Betreff: Remove busy indicator from ajax timer behavior?
 
Hi All,

I followed this to implement a sitewide busy indicator:
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

However, I have an ajax behavior that polls in the page every 2 seconds, and
every time it does the busy indicator flashes since the showBusysign()
javascript method is registered as the PreCallHandler. How can I remove the
busy indicator for only the polling behavior but keep it for other Ajax
requests? Thanks!


Regards,

Ces



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

Re: AutoCompleteTextField uses wrong encoding?

2010-05-12 Thread Jens Zastrow

For Wicket, try setting this *:

getRequestCycleSettings().setResponseRequestEncoding(UTF-8);
getMarkupSettings().setDefaultMarkupEncoding(UTF-8);

in your Application#init

If you don't set the default markup encoding explicitly, the default for it is 
the 'os provided encoding' (see:
IMarkupSettings#getDefaultMarkupEncoding)

If Tomcat, add URIEncoding=UTF-8 to your connector.



Am 10.05.2010 15:49, schrieb Eike Kettner:

Hi Matt

some long time ago I had a similiar problem with AjaxEditableLabel. I 
used tomcat and there you need to configure the connector using 
useBodyEncodingForURI=true to make tomcat use utf8 for encoding ajax 
requests.




Connector port=8009  protocol=AJP/1.3
   redirectPort=8443
   useBodyEncodingForURI=true  /




eike

On 10.05.2010 15:27, Matthias Keller wrote:

Hi

I'm using an autocompletefield and it works fine so far. Except that 
when entering special characters, they don't get encoded correctly.
The query String is correct and sends the special character in 
encoded UTF-8:

GET http://localhost:9080/.../...q=%C3%B6random=...
%C3%B6 is UTF8 for ö

But in:
org.apache.wicket.extensions.ajax.markup.html.autocomplete.AbstractAutoCompleteBehavior.respond(AjaxRequestTarget) 


The following line
final String val = requestCycle.getRequest().getParameter(q);
returns an incorrect string: ö which would be the %C3%B6 in 
ISO-8859-1 (which happens to be my platform encoding)...
Thus the input parameter to my getChoices() call contains strange 
characters in this case...


It appears that the request isn't read out as UTF-8 somehow.. Since I 
don't know the AJAX internals, it's hard to find the culprit for me


I'm using Wicket 1.4.8

Matt






--
dipl. inform jens zastrow

phone | +49.152.04840108
mail  | m...@jens-zastrow.de
web   | http://jens-zastrow.de
xing  | http://www.xing.com/profile/Jens_Zastrow


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



Required error message pointing to different FeedBackPanel

2010-05-12 Thread Rubén khanser
Hi,

I've been searching through this but I can't seem to find anything.

I have a general porpouse FeedBackPanel in my Page so the required error
messages go automatically to this feedbackpanel. Now i needed to do some
dynamic appending subpanels in my page and i need required error messages to
appear at the feedback panels i have in every subpanel but i don't know how
to do it. I tried new FeedbackPanel(,new
ContainerFeedbackMessageFilter(this)) passing that feedback message filter
but all it does is redirecting to my main feedback panel.

Can anyone help me please?

Thanks!


Re: Remove busy indicator from ajax timer behavior?

2010-05-12 Thread Early Morning
Hi Stefan,

Currently there is a javascript method hideBusysign() which is registered as
the PostCallHandler for all Wicket Ajax requests, which  is how the busy
sign is hidden. However, for the timer behavior, I don't want the indicator
to show at all, since it flashes every 2 seconds and is very distracting ^^
Is there a method that I can call/override so that the Ajax PreCallHandler
is not called/changed for this particular behavior? Thanks!


Regards,

Ces

On Wed, May 12, 2010 at 4:28 PM, Stefan Lindner lind...@visionet.de wrote:

 I don't use it but i suggest something like

 div class=hideBusy
   div qwicket:id=budyIndicator/
 /div


 and use

 div.hideBusy {
display:none;
 }

 in css.

 Just theoretically, not tested

 Stefan

 -Ursprüngliche Nachricht-
 Von: Early Morning [mailto:goodmorning...@gmail.com]
 Gesendet: Mi 12.05.2010 09:44
 An: users@wicket.apache.org
 Betreff: Remove busy indicator from ajax timer behavior?

 Hi All,

 I followed this to implement a sitewide busy indicator:

 https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

 However, I have an ajax behavior that polls in the page every 2 seconds,
 and
 every time it does the busy indicator flashes since the showBusysign()
 javascript method is registered as the PreCallHandler. How can I remove the
 busy indicator for only the polling behavior but keep it for other Ajax
 requests? Thanks!


 Regards,

 Ces




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



Re: Image Upload Using TinyMCE Within Wicket Framework

2010-05-12 Thread Muro Copenhagen
Hi Michael,

That is a great example. But you mentioned that you have commited the sample
to wicket-stuff.

I can't find it anywhere so can you please send a link or something...

Best regards
Muro

On Tue, May 4, 2010 at 2:49 PM, Robert Kimotho kimot...@gmail.com wrote:

 You are right I have a wicket path in src and it looks like this

 'resources/wicket.contrib.tinymce.InPlaceEditBehavior/tiny_mce/plugins/emotions/img/smiley-cool.gif'
 this is what you get submitted to the server, but the image does not get
 displayed.
 Can you guide me to using the IResourceListener or getting the emoticon
 displayed at the client side.

 Regards,
 Kimotho.

 2010/5/4 Michał Letyński mletyn...@consol.pl

  Hi.
  If you have images in tiny with external src it should work but if you
 have
  in src a wicket path you must change it (to component which will get the
  image look at IResourceListener)  before displainng image in label,
  multilinelabel, etc.
 
 
  W dniu 2010-05-03 09:10, Robert Kimotho pisze:
 
   When I submit a form with an emoticon from the fullfeatured tinymce, the
  image doesn't get displayed in the destination
  only the text.
  any suggestions, I've been stuck here for a while now.
 
  2010/5/1 新希望软件 -- 俞宏伟nhsoft@gmail.com
 
 
 
  image upload example run failuer, the application
  throwsNoClassDefFoundError
  .
 
  WicketMessage: Can't instantiate page using constructor public
  wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()
 
  Root cause:
 
  java.lang.NoClassDefFoundError:
  wicket/contrib/tinymce/image/ImageUploadPanel
  at
 
 
 wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage.init(ImageUploadTinyMCEPage.java:42)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
  Method)
 
  at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
 
  at
 
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
  at
 
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 
  at
 
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
  at
 
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 
  at
 
 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
 
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
  at
 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
  at
 
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
 
  at
 
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  at
 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
  at
 
 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 
  at
 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  at
 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  at
  org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
 
  at
 
 
 org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
  at
 
 
 org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
  at
 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 
  at org.mortbay.jetty.Server.handle(Server.java:326)
  at
  org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  at
 
 
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
 
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
 
  at
 
 
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
  at
 
 
 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
 
  Complete stack:
 
  org.apache.wicket.WicketRuntimeException: Can't instantiate page using
  constructor public
  wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()
 
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
  at
 
 
 

Re: Image Upload Using TinyMCE Within Wicket Framework

2010-05-12 Thread Michał Letyński

Hi.
Its one of tiny examples:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/tinymce-parent/tinymce-examples

W dniu 2010-05-12 12:40, Muro Copenhagen pisze:

Hi Michael,

That is a great example. But you mentioned that you have commited the sample
to wicket-stuff.

I can't find it anywhere so can you please send a link or something...

Best regards
Muro

On Tue, May 4, 2010 at 2:49 PM, Robert Kimothokimot...@gmail.com  wrote:

   

You are right I have a wicket path in src and it looks like this

'resources/wicket.contrib.tinymce.InPlaceEditBehavior/tiny_mce/plugins/emotions/img/smiley-cool.gif'
this is what you get submitted to the server, but the image does not get
displayed.
Can you guide me to using the IResourceListener or getting the emoticon
displayed at the client side.

Regards,
Kimotho.

2010/5/4 Michał Letyńskimletyn...@consol.pl

 

Hi.
If you have images in tiny with external src it should work but if you
   

have
 

in src a wicket path you must change it (to component which will get the
image look at IResourceListener)  before displainng image in label,
multilinelabel, etc.


W dniu 2010-05-03 09:10, Robert Kimotho pisze:

  When I submit a form with an emoticon from the fullfeatured tinymce, the
   

image doesn't get displayed in the destination
only the text.
any suggestions, I've been stuck here for a while now.

2010/5/1 新希望软件 -- 俞宏伟nhsoft@gmail.com



 

image upload example run failuer, the application
throwsNoClassDefFoundError
.

WicketMessage: Can't instantiate page using constructor public
wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()

Root cause:

java.lang.NoClassDefFoundError:
wicket/contrib/tinymce/image/ImageUploadPanel
 at


   

wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage.init(ImageUploadTinyMCEPage.java:42)
 

 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at


   

org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
 

 at


   

org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
 

 at


   

org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 

 at


   

org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 

 at


   

org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 

 at


   

org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 

 at


   

org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
 

 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)

 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at

   

org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
 

 at


   

org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
 

 at


   

org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 

 at

   

org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
 

 at


   

org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 

 at

   

org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
 

 at

   

org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
 

 at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

 at


   

org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 

 at


   

org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
 

 at

   

org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 

 at org.mortbay.jetty.Server.handle(Server.java:326)
 at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 at


   

org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
 

 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

 at


   

org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
 

 at


   


Re: Image Upload Using TinyMCE Within Wicket Framework

2010-05-12 Thread Muro Copenhagen
Hi,

Cool...thats nice...

Best regards
Muro

2010/5/12 Michał Letyński mletyn...@consol.pl

 Hi.
 Its one of tiny examples:

 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/tinymce-parent/tinymce-examples

 W dniu 2010-05-12 12:40, Muro Copenhagen pisze:

 Hi Michael,

 That is a great example. But you mentioned that you have commited the
 sample
 to wicket-stuff.

 I can't find it anywhere so can you please send a link or something...

 Best regards
 Muro

 On Tue, May 4, 2010 at 2:49 PM, Robert Kimothokimot...@gmail.com
  wrote:



 You are right I have a wicket path in src and it looks like this


 'resources/wicket.contrib.tinymce.InPlaceEditBehavior/tiny_mce/plugins/emotions/img/smiley-cool.gif'
 this is what you get submitted to the server, but the image does not get
 displayed.
 Can you guide me to using the IResourceListener or getting the emoticon
 displayed at the client side.

 Regards,
 Kimotho.

 2010/5/4 Michał Letyńskimletyn...@consol.pl



 Hi.
 If you have images in tiny with external src it should work but if you


 have


 in src a wicket path you must change it (to component which will get the
 image look at IResourceListener)  before displainng image in label,
 multilinelabel, etc.


 W dniu 2010-05-03 09:10, Robert Kimotho pisze:

  When I submit a form with an emoticon from the fullfeatured tinymce,
 the


 image doesn't get displayed in the destination
 only the text.
 any suggestions, I've been stuck here for a while now.

 2010/5/1 新希望软件 -- 俞宏伟nhsoft@gmail.com





 image upload example run failuer, the application
 throwsNoClassDefFoundError
 .

 WicketMessage: Can't instantiate page using constructor public
 wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()

 Root cause:

 java.lang.NoClassDefFoundError:
 wicket/contrib/tinymce/image/ImageUploadPanel
 at





 wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage.init(ImageUploadTinyMCEPage.java:42)


 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)

 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at





 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)


 at





 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)


 at





 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)


 at





 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)


 at





 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)


 at





 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)


 at





 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)


 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)

 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at




 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)


 at





 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)


 at





 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)


 at




 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)


 at





 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)


 at




 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)


 at




 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)


 at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

 at





 org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)


 at





 org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)


 at




 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)


 at org.mortbay.jetty.Server.handle(Server.java:326)
 at

 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 at





 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)


 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
 at
 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
 at
 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

 at





 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)


 at





 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


 Complete stack:

 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor public
 wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()

   

E-commerce with wicket

2010-05-12 Thread Rangel Preis
Hi,

About two month ago we launch http://ewmix.com, a brazilian e-commerce. With
the core finished we will make a new layout. Unfortunately we just sell to
Brazil at this moment.

All time people ask what technologic the project use so:
Wicket 1.4.8
Postgres
Compass (search)
Spring Security with wicket auto-roles
Wicket merged resources
Jetty and Apache

Later we plan to show more details on this project: the objectives, choices,
difficulties and recommendations. We hope that those comments will help
people on planning new projects using wicket, also receive ideas for the
mistakes that we are doing.

Thank Wicketeers again.

Rangel Preis


Re: Image Upload Using TinyMCE Within Wicket Framework

2010-05-12 Thread Muro Copenhagen
Hi again...

I guess a new release of wicket-stuff tinymce has to be made in order to use
it...

The current release 1.4-rc7 misses the changes you have commited...

Who can make a new release of wicket-stuff tinymce so we can use the
commited code ?

Best Regards
Muro

2010/5/12 Michał Letyński mletyn...@consol.pl

 Hi.
 Its one of tiny examples:

 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/tinymce-parent/tinymce-examples

 W dniu 2010-05-12 12:40, Muro Copenhagen pisze:

 Hi Michael,

 That is a great example. But you mentioned that you have commited the
 sample
 to wicket-stuff.

 I can't find it anywhere so can you please send a link or something...

 Best regards
 Muro

 On Tue, May 4, 2010 at 2:49 PM, Robert Kimothokimot...@gmail.com
  wrote:



 You are right I have a wicket path in src and it looks like this


 'resources/wicket.contrib.tinymce.InPlaceEditBehavior/tiny_mce/plugins/emotions/img/smiley-cool.gif'
 this is what you get submitted to the server, but the image does not get
 displayed.
 Can you guide me to using the IResourceListener or getting the emoticon
 displayed at the client side.

 Regards,
 Kimotho.

 2010/5/4 Michał Letyńskimletyn...@consol.pl



 Hi.
 If you have images in tiny with external src it should work but if you


 have


 in src a wicket path you must change it (to component which will get the
 image look at IResourceListener)  before displainng image in label,
 multilinelabel, etc.


 W dniu 2010-05-03 09:10, Robert Kimotho pisze:

  When I submit a form with an emoticon from the fullfeatured tinymce,
 the


 image doesn't get displayed in the destination
 only the text.
 any suggestions, I've been stuck here for a while now.

 2010/5/1 新希望软件 -- 俞宏伟nhsoft@gmail.com





 image upload example run failuer, the application
 throwsNoClassDefFoundError
 .

 WicketMessage: Can't instantiate page using constructor public
 wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage()

 Root cause:

 java.lang.NoClassDefFoundError:
 wicket/contrib/tinymce/image/ImageUploadPanel
 at





 wicket.contrib.examples.tinymce.ImageUploadTinyMCEPage.init(ImageUploadTinyMCEPage.java:42)


 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)

 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at





 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)


 at





 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)


 at





 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)


 at





 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)


 at





 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)


 at





 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)


 at





 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)


 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)

 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at




 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)


 at





 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)


 at





 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)


 at




 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)


 at





 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)


 at




 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)


 at




 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)


 at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)

 at





 org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)


 at





 org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)


 at




 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)


 at org.mortbay.jetty.Server.handle(Server.java:326)
 at

 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 at





 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)


 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
 at
 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
 at
 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

 at





 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)


 at





 

AutoCompleteTextField Problem Submitting

2010-05-12 Thread Sebastian Gabriel
Hello,
I have an AutoCompleteTextField which works just fine. But when I select any of 
the given values from the list the validator tells me : xxx is not a valid 
value... perhaps you have any idea what I can do.

Code:

 private AutoCompleteTextFieldSubject subject = new 
AutoCompleteTextFieldSubject(subject,
new ModelSubject(event.getSubject()), autoCompleteRenderer) {

/**
 * generated UID.
 */
private static final long serialVersionUID = -928631288762101540L;

@Override
protected IteratorSubject getChoices(String term) {

ListSubject ret = new LinkedListSubject();
ListSubject subjects = controller.getAllSubjects();
for (Subject subject : subjects) {
if (subject.getName().startsWith(term)) {
ret.add(subject);
}
}

return ret.iterator();
}
};

Thanks,
Sebastian

setOutputMarkupPlaceholderTag + value

2010-05-12 Thread Ivoneta

Hello!
I need to manage the locale (choose from a combobox) in javascript. So I
will create a hidden field  and then get in javascript.
 I create a hidden text field:

TextField locale = new TextField(hiddenLocale,new
Model(getSession().getLocale().getLanguage()));
locale.setVisible(false);
locale.setOutputMarkupId(true);
add(locale); 
   
in the html :
input type=text id=hiddenLocale wicket:id=hiddenLocale/ 

The problem is when this texfield is render,  the value (of the text field) 
is not in the html input, so in javascript the value is undefined.

is there any way to render the value??

I don't know this is the best option to set a value in javascript, but is
the only way to found to do it!

pleaseee, help meee!!

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setOutputMarkupPlaceholderTag-value-tp2196140p2196140.html
Sent from the Wicket - User 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



loadable detached models and versioning

2010-05-12 Thread David Sheth
Hi all.  I'm new to wicket.  I was reading in the Wicket In Action book on
LoadableDetachedModels...particularly how when the model is detached, just
the id of the actual database persistent object is stored.  Then, in the
load method, you retrieve the persistent object from the database.  That all
makes sense.

However, I then read one use case for this, at
http://stronglytypedblog.blogspot.com/2009/03/wicket-patterns-and-pitfalls-1.html.
 The idea is that you retrieve the object from the database to present
in
a form, and then when a person submits the form, you retrieve the object
from the database again, apply any needed changes, and then persist the
object.

Isn't there a problem here related to versioning of objects?  Specifically,
the first time I retrieve an object, it could be at version 1.  The next
time I retrieve the object, to apply the values from the form, I could be
retrieving version 4.  I would then apply the changes from the form, and
hibernate would happily persist the object, because version 4 is the most
current.

On the other hand, if I kept the version 1 model in the session, and then
applied the form values to it, and then tried to persist it, and in the
meantime other changes had caused the version in the database to increase to
4, hibernate would (properly) throw an error because I am not persisting a
change to the most current version.

David


Re: loadable detached models and versioning

2010-05-12 Thread James Carman
On Wed, May 12, 2010 at 10:52 AM, David Sheth da...@dsheth.com wrote:
 Hi all.  I'm new to wicket.  I was reading in the Wicket In Action book on
 LoadableDetachedModels...particularly how when the model is detached, just
 the id of the actual database persistent object is stored.  Then, in the
 load method, you retrieve the persistent object from the database.  That all
 makes sense.

 However, I then read one use case for this, at
 http://stronglytypedblog.blogspot.com/2009/03/wicket-patterns-and-pitfalls-1.html.
  The idea is that you retrieve the object from the database to present
 in
 a form, and then when a person submits the form, you retrieve the object
 from the database again, apply any needed changes, and then persist the
 object.

 Isn't there a problem here related to versioning of objects?  Specifically,
 the first time I retrieve an object, it could be at version 1.  The next
 time I retrieve the object, to apply the values from the form, I could be
 retrieving version 4.  I would then apply the changes from the form, and
 hibernate would happily persist the object, because version 4 is the most
 current.

Yes, Hibernate's automatic optimistic locking fails in this scenario.
You can add your own validator onto the form (with a hidden field for
the version) if you want.

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



Re: loadable detached models and versioning

2010-05-12 Thread Michael O'Cleirigh

Hello,

Another option would be to make your detachable model aware of the 
version aswell as the id which will allow you to catch this case.


Process:

Cache the version aswell as the object id.

Then either do a query to make sure the cached version is still valid or 
wait until after the object is materialized and then check the version like:


Object dbBackedObject = loadFromDataBase (objectId);

if (!dbBackedObject.getVersion().equals (cachedVersion))
throw new  RuntimeException(stale version excetption);

I'm not sure if you can catch the exception within the form processing 
or if it will bubble up to the request cycle exception handling logic 
(where you can redirect to another page).


Regards,

Mike


Hi all.  I'm new to wicket.  I was reading in the Wicket In Action book on
LoadableDetachedModels...particularly how when the model is detached, just
the id of the actual database persistent object is stored.  Then, in the
load method, you retrieve the persistent object from the database.  That all
makes sense.

However, I then read one use case for this, at
http://stronglytypedblog.blogspot.com/2009/03/wicket-patterns-and-pitfalls-1.html.
  The idea is that you retrieve the object from the database to present
in
a form, and then when a person submits the form, you retrieve the object
from the database again, apply any needed changes, and then persist the
object.

Isn't there a problem here related to versioning of objects?  Specifically,
the first time I retrieve an object, it could be at version 1.  The next
time I retrieve the object, to apply the values from the form, I could be
retrieving version 4.  I would then apply the changes from the form, and
hibernate would happily persist the object, because version 4 is the most
current.
 

Yes, Hibernate's automatic optimistic locking fails in this scenario.
You can add your own validator onto the form (with a hidden field for
the version) if you want.

-
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: AutoCompleteTextField Problem Submitting

2010-05-12 Thread Zilvinas Vilutis
I had the same problem, its something related to converters or how your text
value is converted to ( in your case ) Subject - and as there is no
converter for that - it is just failing.

What I've done is set the model to null and added a method getChoice
which does the conversion.

This is not very convenient way but it works.

Maybe Igor would have any suggestions how to solve this in a better way?


Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


On Wed, May 12, 2010 at 7:22 AM, Sebastian Gabriel 
sebastian.gabr...@hs-augsburg.de wrote:

 Hello,
 I have an AutoCompleteTextField which works just fine. But when I select
 any of the given values from the list the validator tells me : xxx is not a
 valid value... perhaps you have any idea what I can do.

 Code:

  private AutoCompleteTextFieldSubject subject = new
 AutoCompleteTextFieldSubject(subject,
new ModelSubject(event.getSubject()), autoCompleteRenderer) {

/**
 * generated UID.
 */
private static final long serialVersionUID = -928631288762101540L;

@Override
protected IteratorSubject getChoices(String term) {

ListSubject ret = new LinkedListSubject();
ListSubject subjects = controller.getAllSubjects();
for (Subject subject : subjects) {
if (subject.getName().startsWith(term)) {
ret.add(subject);
}
}

return ret.iterator();
}
};

 Thanks,
 Sebastian


Re: setOutputMarkupPlaceholderTag + value

2010-05-12 Thread Zilvinas Vilutis
Why don't you use input type=hidden / ?

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


On Wed, May 12, 2010 at 7:41 AM, Ivoneta ietaraz...@gmail.com wrote:


 Hello!
 I need to manage the locale (choose from a combobox) in javascript. So I
 will create a hidden field  and then get in javascript.
  I create a hidden text field:

TextField locale = new TextField(hiddenLocale,new
 Model(getSession().getLocale().getLanguage()));
locale.setVisible(false);
locale.setOutputMarkupId(true);
add(locale);

in the html :
input type=text id=hiddenLocale wicket:id=hiddenLocale/

 The problem is when this texfield is render,  the value (of the text field)
 is not in the html input, so in javascript the value is undefined.

 is there any way to render the value??

 I don't know this is the best option to set a value in javascript, but is
 the only way to found to do it!

 pleaseee, help meee!!

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/setOutputMarkupPlaceholderTag-value-tp2196140p2196140.html
 Sent from the Wicket - User 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: Remove busy indicator from ajax timer behavior?

2010-05-12 Thread Igor Vaynberg
have that polling behavior set some javascript flag that your handlers
are aware of.

-igor

On Wed, May 12, 2010 at 12:44 AM, Early Morning
goodmorning...@gmail.com wrote:
 Hi All,

 I followed this to implement a sitewide busy indicator:
 https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

 However, I have an ajax behavior that polls in the page every 2 seconds, and
 every time it does the busy indicator flashes since the showBusysign()
 javascript method is registered as the PreCallHandler. How can I remove the
 busy indicator for only the polling behavior but keep it for other Ajax
 requests? Thanks!


 Regards,

 Ces


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



Re: CheckGroup and ListView

2010-05-12 Thread msalman

Hi,

Was any one able to test the quick start? 

Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CheckGroup-and-ListView-tp1886879p2196464.html
Sent from the Wicket - User 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: Testing wicket pages in isolation (wickettester)

2010-05-12 Thread Igor Vaynberg
i would go with 2

the problem here is that wicket tester is designed to render the
pages, if it didnt then all you would have to do is make sure that a
pagerequesttarget with the correct page was set on the request cycle.

-igor

On Wed, May 12, 2010 at 1:06 AM, Vincent Lussenburg
vincent.lussenb...@gmail.com wrote:
 Hi all,

 I'm sending this page to check if I've drawn the correct conclusions on
 testing wicket pages in isolation.

 The situation is as follows: we have a number of pages that work on the same
 model object. The object is passed from page to page in page transitions. So
 for example, when the 'next' button is pressed, setResponsePage(new
 NextPage(modelObject)); is called. The constructor of these pages explicitly
 require the typed object.

 We're testing these pages using WicketTester. What happens now is that if an
 action is done to invoke the next page, that page is also constructed
 (normal POJO behavior) and rendered (by WicketTester). This means we have to
 prepare our mocks for any code executed in the next page as well. That
 violates the DRY principle, we'd rather test the page in isolation and only
 check that the page is constructed with the correct argument. The following
 solutions came to mind:

 1) Change the constructor to accept PageParameters instead in which we put
 the model object we wish to pass and use the IPageFactory to construct the
 page. In tests, we can mock the IPageFactory to expect the call and return a
 DummyHomePage instead. Downside is that production code is less obvious -
 contracts are less strict.

 2) Place the code that creates the pages in a protected method we can
 override in test mode. So, in production code we have:

 WebPage createNextPage(final ModelObject modelObject) {
  return new NextPage(orderModel.getObject());
 }

 In test code we have:

 class TestableNextPage extends NextPage {
 []
 @Override
 WebPage createNextPage(final ModelObject modelObject) {
  nextPageWasCalled = true;
  return new DummyHomePage();
 }
 }

 3) Create our own PageFactory specialization that supports
 createPage(Class? extends Page pageClass, Object...
 constructorParameters))... but I have a feeling that there's a reason it's
 not included in Wicket.

 I find solution 2) now least intrusive in production code so we're using
 this approach, currently but I'm not overly enthusiastic about it.

 Are there any options I'm overlooking?

 Thanks for your insights,
 Vincent.


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



Re: setOutputMarkupPlaceholderTag + value

2010-05-12 Thread Igor Vaynberg
see HiddenField component...

-igor

On Wed, May 12, 2010 at 7:41 AM, Ivoneta ietaraz...@gmail.com wrote:

 Hello!
 I need to manage the locale (choose from a combobox) in javascript. So I
 will create a hidden field  and then get in javascript.
  I create a hidden text field:

        TextField locale = new TextField(hiddenLocale,new
 Model(getSession().getLocale().getLanguage()));
        locale.setVisible(false);
        locale.setOutputMarkupId(true);
        add(locale);

        in the html :
        input type=text id=hiddenLocale wicket:id=hiddenLocale/

 The problem is when this texfield is render,  the value (of the text field)
 is not in the html input, so in javascript the value is undefined.

 is there any way to render the value??

 I don't know this is the best option to set a value in javascript, but is
 the only way to found to do it!

 pleaseee, help meee!!

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/setOutputMarkupPlaceholderTag-value-tp2196140p2196140.html
 Sent from the Wicket - User 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: AutoCompleteTextField Problem Submitting

2010-05-12 Thread Sebastian Gabriel
Thanks for your fast answer. 
I have a question about your solution. You say setting the model to null and 
adding a getChoice method would solve the problem. This means that I set the 
AutoCompleteTextField type to String and the String in the 
AutoCompleteTextField has to be unique in order to identify the right object, 
hasn't it?

Thanks
Sebastian


Am 12.05.2010 um 19:26 schrieb Zilvinas Vilutis:

 I had the same problem, its something related to converters or how your text
 value is converted to ( in your case ) Subject - and as there is no
 converter for that - it is just failing.
 
 What I've done is set the model to null and added a method getChoice
 which does the conversion.
 
 This is not very convenient way but it works.
 
 Maybe Igor would have any suggestions how to solve this in a better way?
 
 
 Žilvinas Vilutis
 
 Mobile:   (+370) 652 38353
 E-mail:   cika...@gmail.com
 
 
 On Wed, May 12, 2010 at 7:22 AM, Sebastian Gabriel 
 sebastian.gabr...@hs-augsburg.de wrote:
 
 Hello,
 I have an AutoCompleteTextField which works just fine. But when I select
 any of the given values from the list the validator tells me : xxx is not a
 valid value... perhaps you have any idea what I can do.
 
 Code:
 
 private AutoCompleteTextFieldSubject subject = new
 AutoCompleteTextFieldSubject(subject,
   new ModelSubject(event.getSubject()), autoCompleteRenderer) {
 
   /**
* generated UID.
*/
   private static final long serialVersionUID = -928631288762101540L;
 
   @Override
   protected IteratorSubject getChoices(String term) {
 
   ListSubject ret = new LinkedListSubject();
   ListSubject subjects = controller.getAllSubjects();
   for (Subject subject : subjects) {
   if (subject.getName().startsWith(term)) {
   ret.add(subject);
   }
   }
 
   return ret.iterator();
   }
   };
 
 Thanks,
 Sebastian


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



Re: AutoCompleteTextField Problem Submitting

2010-05-12 Thread Zilvinas Vilutis
Wait, I lied a little :)

I use new ModelType( null ), so no value is being set to model object.

Actually I've ported the impl of AbstractAutoCompleteTextField as described
in https://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html so
and use the findChoice method for selected value resolution.

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


On Wed, May 12, 2010 at 11:32 AM, Sebastian Gabriel 
sebastian.gabr...@hs-augsburg.de wrote:

 Thanks for your fast answer.
 I have a question about your solution. You say setting the model to null
 and adding a getChoice method would solve the problem. This means that I
 set the AutoCompleteTextField type to String and the String in the
 AutoCompleteTextField has to be unique in order to identify the right
 object, hasn't it?

 Thanks
 Sebastian


 Am 12.05.2010 um 19:26 schrieb Zilvinas Vilutis:

  I had the same problem, its something related to converters or how your
 text
  value is converted to ( in your case ) Subject - and as there is no
  converter for that - it is just failing.
 
  What I've done is set the model to null and added a method getChoice
  which does the conversion.
 
  This is not very convenient way but it works.
 
  Maybe Igor would have any suggestions how to solve this in a better way?
 
 
  Žilvinas Vilutis
 
  Mobile:   (+370) 652 38353
  E-mail:   cika...@gmail.com
 
 
  On Wed, May 12, 2010 at 7:22 AM, Sebastian Gabriel 
  sebastian.gabr...@hs-augsburg.de wrote:
 
  Hello,
  I have an AutoCompleteTextField which works just fine. But when I select
  any of the given values from the list the validator tells me : xxx is
 not a
  valid value... perhaps you have any idea what I can do.
 
  Code:
 
  private AutoCompleteTextFieldSubject subject = new
  AutoCompleteTextFieldSubject(subject,
new ModelSubject(event.getSubject()), autoCompleteRenderer)
 {
 
/**
 * generated UID.
 */
private static final long serialVersionUID = -928631288762101540L;
 
@Override
protected IteratorSubject getChoices(String term) {
 
ListSubject ret = new LinkedListSubject();
ListSubject subjects = controller.getAllSubjects();
for (Subject subject : subjects) {
if (subject.getName().startsWith(term)) {
ret.add(subject);
}
}
 
return ret.iterator();
}
};
 
  Thanks,
  Sebastian




localizing images

2010-05-12 Thread Ed _


Hi,
Wanted to see how one could localize images. Esp if they are not in the same 
folder as the src code.
wicket:link seems to only want to look in the local folder. If I specify the 
path in the src attribute that doesn't work. 
wicket:link
  img src=/go/to/a/different/location/myimg.gif 
/
/wicket:link

thx,
Ed
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

Re: localizing images

2010-05-12 Thread Zilvinas Vilutis
Use parameterized ResourceReference's

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


On Wed, May 12, 2010 at 3:38 PM, Ed _ ed_b...@hotmail.com wrote:



 Hi,
 Wanted to see how one could localize images. Esp if they are not in the
 same folder as the src code.
 wicket:link seems to only want to look in the local folder. If I specify
 the path in the src attribute that doesn't work.
 wicket:link
  img src=/go/to/a/different/location/myimg.gif
 /
 /wicket:link

 thx,
 Ed
 _
 The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
 Hotmail.

 http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5



RE: localizing images

2010-05-12 Thread Ed _

Could you explain that a bit. 
thx!

 From: cika...@gmail.com
 Date: Wed, 12 May 2010 15:47:56 -0700
 Subject: Re: localizing images
 To: users@wicket.apache.org
 
 Use parameterized ResourceReference's
 
 Žilvinas Vilutis
 
 Mobile:   (+370) 652 38353
 E-mail:   cika...@gmail.com
 
 
 On Wed, May 12, 2010 at 3:38 PM, Ed _ ed_b...@hotmail.com wrote:
 
 
 
  Hi,
  Wanted to see how one could localize images. Esp if they are not in the
  same folder as the src code.
  wicket:link seems to only want to look in the local folder. If I specify
  the path in the src attribute that doesn't work.
  wicket:link
   img src=/go/to/a/different/location/myimg.gif
  /
  /wicket:link
 
  thx,
  Ed
  _
  The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
  Hotmail.
 
  http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
 
  
_
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

Re: localizing images

2010-05-12 Thread Zilvinas Vilutis
First, create an ExternalImage class as described in
https://cwiki.apache.org/WICKET/how-to-load-an-external-image.html

Add img wicket:id=localizedImage / to your markup

Then in your code:

ResourceReference imageReference = new ResourceReference( ScopeClass.class,
image_file_name, locale, style);

String url = RequestCycle.get().urlFor( imageReference ).toString();

add( new ExternalImage( localizedImage, url ) );


Not if ResourceReference will localize automatically - or you'll have to
construct the localized filename yourself, in any case - that should do
the trick.



Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


2010/5/12 Ed _ ed_b...@hotmail.com


 Could you explain that a bit.
 thx!

  From: cika...@gmail.com
  Date: Wed, 12 May 2010 15:47:56 -0700
  Subject: Re: localizing images
  To: users@wicket.apache.org
 
  Use parameterized ResourceReference's
 
  Žilvinas Vilutis
 
  Mobile:   (+370) 652 38353
  E-mail:   cika...@gmail.com
 
 
  On Wed, May 12, 2010 at 3:38 PM, Ed _ ed_b...@hotmail.com wrote:
 
  
  
   Hi,
   Wanted to see how one could localize images. Esp if they are not in the
   same folder as the src code.
   wicket:link seems to only want to look in the local folder. If I
 specify
   the path in the src attribute that doesn't work.
   wicket:link
img src=/go/to/a/different/location/myimg.gif
   /
   /wicket:link
  
   thx,
   Ed
   _
   The New Busy think 9 to 5 is a cute idea. Combine multiple calendars
 with
   Hotmail.
  
  
 http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
  

 _
 Hotmail has tools for the New Busy. Search, chat and e-mail from your
 inbox.

 http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1



Re: is possible that CryptedUrlWebRequestCodingStrategy not working

2010-05-12 Thread Zilvinas Vilutis
There are no locks which thieves couldn't unlock or break - nevertheless the
locks keep 99% of them not to try - that is why we lock our doors at home.

The same is here, I believe that at least some security will make more than
90% spam / scrap bots fail, while the other few percent does not matter SO
much - that it couldn't be handled manually.

Another question is - is it worth trying so hard?

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com


On Tue, May 11, 2010 at 10:17 PM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 You're subscribing to a mythical line of reasoning.  You're trying to
 protect against page-scraping by using URL obfuscation to hide the meaning
 of query string parameters.  I have actually done (legitimate, legal,
 purposefui) page scraping in the past for a couple of tasks - believe me -
 you are only going to slow down a page scraper by about thirty seconds.  If
 you really have data worth scraping, it doesn't matter if I have to do
 this:

 1 - pull up homepage
 2 - determine that I can change /foo/1 to /foo/2 to get the second page

 or this:

 1 - pull up homepage
 2 - determine that I have to look for a link by search pattern .someclass
 someelement a#next-page and use the href of that link to get second page of
 results

 And (as a page scraper) - I wouldn't even care that I need to have a
 session
 for the crypted url strategy to work.  I can easily do that with any number
 of http bot clients (including httpunit, etc).

 Bottom line is: if you use security by obscurity, you're only fooling
 yourself into thinking it's secure.  If you need something secured, put a
 paywall in front of it.  (Of course, then I'll just buy an account and
 scrape it any way if I'm a determined competitor).

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



 On Tue, May 11, 2010 at 9:13 AM, Fernando Wermus
 fernando.wer...@gmail.comwrote:

  Jeremy,
  There is a database with huge amount of data that could be collected
 by
  someone else. If the url has a clear meaning, to say: /data/0, /data/1.
  They
  can get all the data from there. I would like to have fixed and encripted
  urls.
 
  On Mon, May 10, 2010 at 4:17 PM, Jeremy Thomerson 
  jer...@wickettraining.com
   wrote:
 
   What is a hacker going to get from a URL like /somepage?
  
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
  
   On Mon, May 10, 2010 at 2:06 PM, Fernando Wermus
   fernando.wer...@gmail.comwrote:
  
Igor,
   Wicket in Action explains
... Using this code, Wicket will encrypt all your URLs—including
bookmarkable URLs. 
   
I need fixed entry point for my stateless page,  but not readable for
humans, because some hacker would like to extract all the information
   from
the site.
   
How can I achieve this?
   
   
On Mon, May 10, 2010 at 4:01 PM, Igor Vaynberg 
  igor.vaynb...@gmail.com
wrote:
   
 afair crypted strategy only encodes non-bookmarkable urls. it does
  not
 encode bookmarkable urls because those are meant as entrypoints
 into
 your application.

 -igor

 On Mon, May 10, 2010 at 11:38 AM, Fernando Wermus
 fernando.wer...@gmail.com wrote:
  Hi all,
 I create a PagingNavigator stateless. Instead of using a model
  to
have
  the number page shown, my StatelessPagingNavigator shows the
 number
 through
  parameters. I hope that the page number wouldnt have been showed
   using
  CryptedUrlWebRequestCodingStrategy, but It does. This is rather
   weird;
I
  hope any could point me out some solution. Is my class written
   wrongly
in
  some way?
 
 
  public class StatelessPagingNavigator extends PagingNavigator {
  private static final long serialVersionUID =
 3576836044400027436L;
 
  public StatelessPagingNavigator(String id, DataView dataView) {
  super(id, dataView);
  }
 
   @Override
  protected Link newPagingNavigationIncrementLink(final String id,
 IPageable
  pageable, int increment) {
  * **PageParameters p=new PageParameters();*
  *
  *
  * **p.add(increment, String.valueOf(increment));*
  * **p.add(pageNumber,
  String.valueOf(pageable.getCurrentPage()));*
  Link link= new BookmarkablePageIncrementLink(id, pageable,
  getPage().getClass(), p){
  private static final long serialVersionUID = 1L;
 
  public boolean isEnabled()
  {
  return super.isEnabled() 
  StatelessPagingNavigator.this.isEnabled()

  StatelessPagingNavigator.this.isEnableAllowed();
  }
  };
   return link;
  }
 
  @Override
  protected Link newPagingNavigationLink(final String id, final
   IPageable
  pageable, int pageNumber) {
  * **PageParameters p=new PageParameters();*
  * **p.add(pageNumber, String.valueOf(pageNumber));*
   return new BookmarkablePagingNavigationLink(id, pageable,
  

Re: Testing wicket pages in isolation (wickettester)

2010-05-12 Thread Vincent Lussenburg

Ok, thanks for your reply Igor!

Regards,
Vincent

On May 12, 2010, at 17:44, Igor Vaynberg igor.vaynb...@gmail.com  
wrote:



i would go with 2

the problem here is that wicket tester is designed to render the
pages, if it didnt then all you would have to do is make sure that a
pagerequesttarget with the correct page was set on the request cycle.

-igor

On Wed, May 12, 2010 at 1:06 AM, Vincent Lussenburg
vincent.lussenb...@gmail.com wrote:

Hi all,

I'm sending this page to check if I've drawn the correct  
conclusions on

testing wicket pages in isolation.

The situation is as follows: we have a number of pages that work on  
the same
model object. The object is passed from page to page in page  
transitions. So

for example, when the 'next' button is pressed, setResponsePage(new
NextPage(modelObject)); is called. The constructor of these pages  
explicitly

require the typed object.

We're testing these pages using WicketTester. What happens now is  
that if an

action is done to invoke the next page, that page is also constructed
(normal POJO behavior) and rendered (by WicketTester). This means  
we have to
prepare our mocks for any code executed in the next page as well.  
That
violates the DRY principle, we'd rather test the page in isolation  
and only
check that the page is constructed with the correct argument. The  
following

solutions came to mind:

1) Change the constructor to accept PageParameters instead in which  
we put
the model object we wish to pass and use the IPageFactory to  
construct the
page. In tests, we can mock the IPageFactory to expect the call and  
return a
DummyHomePage instead. Downside is that production code is less  
obvious -

contracts are less strict.

2) Place the code that creates the pages in a protected method we can
override in test mode. So, in production code we have:

WebPage createNextPage(final ModelObject modelObject) {
 return new NextPage(orderModel.getObject());
}

In test code we have:

class TestableNextPage extends NextPage {
[]
@Override
WebPage createNextPage(final ModelObject modelObject) {
 nextPageWasCalled = true;
 return new DummyHomePage();
}
}

3) Create our own PageFactory specialization that supports
createPage(Class? extends Page pageClass, Object...
constructorParameters))... but I have a feeling that there's a  
reason it's

not included in Wicket.

I find solution 2) now least intrusive in production code so we're  
using

this approach, currently but I'm not overly enthusiastic about it.

Are there any options I'm overlooking?

Thanks for your insights,
Vincent.



-
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