Re: Asynchronous construction of page

2009-11-28 Thread Kaspar Fischer
Because the requests will be sequential (a problem in general but not so much 
in my case) and because I have an auto-completion field on the same page. As I 
understand it, having some AjaxLazyLoadPanel's active on my page, the 
auto-completion requests will be queued. So if the loading of the lazy panels 
takes time, the user experiences slow response in the auto-completion field. 
Please correct me if I am wrong.

Kaspar

On 06.11.2009, at 08:47, Pieter Degraeuwe wrote:

 Why don't you use the AjaxLazyLoadPanel for each part the the screen that
 takes some time to load? (see also at
 http://www.roseindia.net/tutorials/wicket/lazy-load.shtml)
 
 Pieter


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



Re: Asynchronous construction of page

2009-11-28 Thread Johan Compagner
load that data in separate threads, dont touch any wicket components
in those threads
make a component like ajaxlazyload that polls for that data if still
not there use a timer of a few seconds to test it again

On 28/11/2009, Kaspar Fischer kaspar.fisc...@dreizak.com wrote:
 Because the requests will be sequential (a problem in general but not so
 much in my case) and because I have an auto-completion field on the same
 page. As I understand it, having some AjaxLazyLoadPanel's active on my page,
 the auto-completion requests will be queued. So if the loading of the lazy
 panels takes time, the user experiences slow response in the auto-completion
 field. Please correct me if I am wrong.

 Kaspar

 On 06.11.2009, at 08:47, Pieter Degraeuwe wrote:

 Why don't you use the AjaxLazyLoadPanel for each part the the screen that
 takes some time to load? (see also at
 http://www.roseindia.net/tutorials/wicket/lazy-load.shtml)

 Pieter


 -
 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: Asynchronous construction of page

2009-11-28 Thread Kaspar Fischer
That's what I ended up doing (basically like 
http://blog.miau.biz/2008/12/wicket-and-slow-running-process-in.html).

I just wanted to explain to Pieter why ...

On 28.11.2009, at 11:27, Johan Compagner wrote:

 load that data in separate threads, dont touch any wicket components
 in those threads
 make a component like ajaxlazyload that polls for that data if still
 not there use a timer of a few seconds to test it again
 
 On 28/11/2009, Kaspar Fischer kaspar.fisc...@dreizak.com wrote:
 Because the requests will be sequential (a problem in general but not so
 much in my case) and because I have an auto-completion field on the same
 page. As I understand it, having some AjaxLazyLoadPanel's active on my page,
 the auto-completion requests will be queued. So if the loading of the lazy
 panels takes time, the user experiences slow response in the auto-completion
 field. Please correct me if I am wrong.
 
 Kaspar
 
 On 06.11.2009, at 08:47, Pieter Degraeuwe wrote:
 
 Why don't you use the AjaxLazyLoadPanel for each part the the screen that
 takes some time to load? (see also at
 http://www.roseindia.net/tutorials/wicket/lazy-load.shtml)
 
 Pieter

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



Re: London Wicket Event at Foyles Bookshop, November 21st, 2009

2009-11-28 Thread Daan van Etten

The London Wicket Event was great!

Here you can find pictures and summaries of all presentations:
http://stuq.nl/weblog/2009-11-27/london-wicket-meetup-wicket-1-5-wiquery-brix-and-more

Overview:
• Cemal Bayramoglu: Introduction
	• Jeremy Thomerson (USA): Custom JavaScript Integrations with Wicket  
+ Auto Resolvers

• Lionel Armanet (FR): Announcing WiQuery 1.0: Introduction  Demo
• Matej Knopp (SK): BRIX CMS + Wicket 1.5 Developments QA
• Sven Meier (DE): Trees, DragDrop and more:
• Martijn Dashorst (NL): Writing Books vs Making Babies
• Wicket QA

Regards,

Daan van Etten

Op 3 nov 2009, om 00:11 heeft jWeekend het volgende geschreven:

We will hold our next London Wicket Event on Saturday, 21st  
November, from 14:45. This time we have hired The Gallery at the  
iconic Foyles Bookshop in central London.
We again welcome guests and speakers from several countries,  
including at least 3 core committers, Matej, Jeremy and of course,  
Alastair, as well as the founders of WiQuery (Wicket-jQuery  
integration), Lionel Armanet and his team.


Join us for some very interesting, high quality presentations and to  
chat with fellow Wicket users and developers at all levels. We're  
expecting this to be another popular event and since places are  
limited book and confirm early if you can make it. Details and  
registration are at the usual place [1].
There is a cool little Jazz cafe at Foyles too, where there'll be a  
live act (Femi Temowo) at 13:00 if you enjoy some Jazz guitar  
relaxation before your intellectual stimulation. They offer a decent  
range of food and drink there too.


The event schedule looks like:
Cemal Bayramoglu: Introduction
Jeremy Thomerson (USA): Custom JavaScript Integrations with Wicket +  
Auto Resolvers

Lionel Armanet (FR): Announcing WiQuery 1.0: Introduction  Demo
Matej Knopp (SK): BRIX CMS + Wicket 1.5 Developments QA
Alastair Maw (UK): The Al Talk
Our Regular General Wicket QA with Al and Cemal
We expect to formally finish by around 19:00. I would expect the  
usual suspects will be heading somewhere in the neighbourhood for  
refreshments straight after the event, and of course you are more  
than welcome to join us.

Regards - Cemal jWeekend http://jWeekend.com
Training, Consulting, Development
[1] http://jweekend.com/dev/LWUGReg/
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





Re: WicketSessionFilter and several domains

2009-11-28 Thread bgooren

Well, even if it's regional the question remains why your site is available
over two domainnames. You can solve your problem by running the site on one
of the domains and issuing a 301 redirect from the other domainname to the
main domain. Or did I misunderstand, and are you running the site from the
.com.ar and only the flash part from the .com?

Bas


Fernando Wermus-2 wrote:
 
 Bas,
  The site is regional. It is for LATAM. I will try to append the
 session
 id to the flash post.
 
 thanks
 
 On Fri, Nov 27, 2009 at 1:17 PM, bgooren b...@iswd.nl wrote:
 

 There are serveral options; The easiest is probably to append the
 sessionId
 to the URL you are accessing from the flash file; If that is not an
 option,
 host both the flash and the website on the same domain. Cross-domain
 issues
 are a hassle ;-)

 What's your reason for working with two domain names anyway?

 Bas


 Fernando Wermus-2 wrote:
 
  Bas,
  Thanks. I havent checked this behavior with other browsers. I will.
  What
  do you think is the best solution or approach to this problem?
 
  Fernando

 --
 View this message in context:
 http://old.nabble.com/WicketSessionFilter-and-several-domains-tp26502429p26543760.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


 
 
 -- 
 Fernando Wermus.
 
 www.linkedin.com/in/fernandowermus
 
 

-- 
View this message in context: 
http://old.nabble.com/WicketSessionFilter-and-several-domains-tp26502429p26547249.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: How to render panel markup to string - solved

2009-11-28 Thread Martin Makundi
Hi!

Here is a way to render panel markup to string.

It is a bit of a tweak, I admit, but what can you do.

1. Assume you have components on your page, ready to be rendered.

2. In onBeforeRender, quickly switch one of your existing components
to another that you want to render into a string

3. Let your special component render into a string.

4. Restore back to the original component that was supposed to be
rendered onto the web page.

5. It seems to work ok at least if your component is a panel.

Example code:

---8

somewhere in your page hierarchy that is actually rendered

/**
   * @see org.apache.wicket.Page#onBeforeRender()
   */
  @Override
  protected void onBeforeRender() {
System.out.println(\n-\n
+ MarkupUtils.renderToString(loginForm, new
IntroductionPanel(loginForm.getId(;
super.onBeforeRender();
  }

---8

MarkupUtils.public static String renderToString(final Component
parentDonorComponent, final Component component) {
if (!component.getId().equals(parentDonorComponent.getId())) {
  throw new IllegalStateException(Component will try to
substitute parentDonorComponent to render. Donor and string render
Component id's must be equal.);
}

final Response originalResponse = RequestCycle.get().getResponse();
StringResponse stringResponse = new StringResponse();
RequestCycle.get().setResponse(stringResponse);
MarkupContainer parentComponent = parentDonorComponent.getParent();
parentComponent.remove(parentDonorComponent);

try {
  parentComponent.add(component);

  try {
component.prepareForRender();
component.renderComponent();
  } catch (RuntimeException e) {
component.afterRender();
throw e;
  }
} finally {
  // Restore original component
  parentComponent.replace(parentDonorComponent);
  // Restore original response
  RequestCycle.get().setResponse(originalResponse);
}

return stringResponse.toString();
  }


**
Martin

2009/10/30 Martin Makundi martin.maku...@koodaripalvelut.com:
 Almost still needs some tweaking:

 org.apache.wicket.WicketRuntimeException: Unable to find the markup
 for the component. That may be due to transparent containers or
 components implementing IComponentResolver: [MarkupContainer
 [Component id = -]]
     at 
 org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125)
     at org.apache.wicket.Component.locateMarkupStream(Component.java:3813)
     at org.apache.wicket.Component.renderComponent(Component.java:2547)

 **
 Martin

 2009/10/30 Martin Makundi martin.maku...@koodaripalvelut.com:
 Looking at AjaxRequestTarget, maybe something like this might work?

                // substitute our encoding response for the real one so we 
 can capture
                // component's markup in a manner safe for transport inside 
 CDATA block
                final Response originalResponse = response;
                StringResponse stringResponse = new StringResponse();
                RequestCycle.get().setResponse(stringResponse);

                // Initialize temporary variables
                final Page page = component.findParent(Page.class);
                if (page == null)
                {
                        // dont throw an exception but just ignore this 
 component, somehow
                        // it got
                        // removed from the page.
                        // throw new IllegalStateException(
                        // Ajax request attempted on a component that is not 
 associated
                        // with a Page);
                        LOG.debug(component:  + component +  with 
 markupid:  + markupId +
                                 not rendered because it was already removed 
 from page);
                        return;
                }

                page.startComponentRender(component);

                try
                {
                        component.prepareForRender();

                        // render any associated headers of the component
                        respondHeaderContribution(response, component);
                }
                catch (RuntimeException e)
                {
                        try
                        {
                                component.afterRender();
                        }
                        catch (RuntimeException e2)
                        {
                                // ignore this one could be a result off.
                        }
                        // Restore original response
                        RequestCycle.get().setResponse(originalResponse);
                        stringResponse.reset();
                        throw e;
                }

                try
                {
                        component.renderComponent();
                }
                catch 

Re: How to render panel markup to string - solved

2009-11-28 Thread Jonathan Locke


don't know what you're doing exactly or if i ever tested this one, but this
might be of interest:

http://code.google.com/p/twenty-six-wicket-tricks/source/browse/trunk/twenty-six-wicket-tricks/src/main/java/com/locke/library/web/panels/caching/CachingPanel.java

   jon


MartinM wrote:
 
 Hi!
 
 Here is a way to render panel markup to string.
 
 It is a bit of a tweak, I admit, but what can you do.
 
 1. Assume you have components on your page, ready to be rendered.
 
 2. In onBeforeRender, quickly switch one of your existing components
 to another that you want to render into a string
 
 3. Let your special component render into a string.
 
 4. Restore back to the original component that was supposed to be
 rendered onto the web page.
 
 5. It seems to work ok at least if your component is a panel.
 
 Example code:
 
 ---8
 
 somewhere in your page hierarchy that is actually rendered
 
 /**
* @see org.apache.wicket.Page#onBeforeRender()
*/
   @Override
   protected void onBeforeRender() {
 System.out.println(\n-\n
 + MarkupUtils.renderToString(loginForm, new
 IntroductionPanel(loginForm.getId(;
 super.onBeforeRender();
   }
 
 ---8
 
 MarkupUtils.public static String renderToString(final Component
 parentDonorComponent, final Component component) {
 if (!component.getId().equals(parentDonorComponent.getId())) {
   throw new IllegalStateException(Component will try to
 substitute parentDonorComponent to render. Donor and string render
 Component id's must be equal.);
 }
 
 final Response originalResponse = RequestCycle.get().getResponse();
 StringResponse stringResponse = new StringResponse();
 RequestCycle.get().setResponse(stringResponse);
 MarkupContainer parentComponent = parentDonorComponent.getParent();
 parentComponent.remove(parentDonorComponent);
 
 try {
   parentComponent.add(component);
 
   try {
 component.prepareForRender();
 component.renderComponent();
   } catch (RuntimeException e) {
 component.afterRender();
 throw e;
   }
 } finally {
   // Restore original component
   parentComponent.replace(parentDonorComponent);
   // Restore original response
   RequestCycle.get().setResponse(originalResponse);
 }
 
 return stringResponse.toString();
   }
 
 
 **
 Martin
 
 2009/10/30 Martin Makundi martin.maku...@koodaripalvelut.com:
 Almost still needs some tweaking:

 org.apache.wicket.WicketRuntimeException: Unable to find the markup
 for the component. That may be due to transparent containers or
 components implementing IComponentResolver: [MarkupContainer
 [Component id = -]]
     at
 org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125)
     at
 org.apache.wicket.Component.locateMarkupStream(Component.java:3813)
     at org.apache.wicket.Component.renderComponent(Component.java:2547)

 **
 Martin

 2009/10/30 Martin Makundi martin.maku...@koodaripalvelut.com:
 Looking at AjaxRequestTarget, maybe something like this might work?

                // substitute our encoding response for the real one so
 we can capture
                // component's markup in a manner safe for transport
 inside CDATA block
                final Response originalResponse = response;
                StringResponse stringResponse = new StringResponse();
                RequestCycle.get().setResponse(stringResponse);

                // Initialize temporary variables
                final Page page = component.findParent(Page.class);
                if (page == null)
                {
                        // dont throw an exception but just ignore this
 component, somehow
                        // it got
                        // removed from the page.
                        // throw new IllegalStateException(
                        // Ajax request attempted on a component that is
 not associated
                        // with a Page);
                        LOG.debug(component:  + component +  with
 markupid:  + markupId +
                                 not rendered because it was already
 removed from page);
                        return;
                }

                page.startComponentRender(component);

                try
                {
                        component.prepareForRender();

                        // render any associated headers of the component
                        respondHeaderContribution(response, component);
                }
                catch (RuntimeException e)
                {
                        try
                        {
                                component.afterRender();
                        }
                        catch (RuntimeException e2)
                        {
                                // ignore this one could be a result off.
                        }
  

wicket:head header contribution via panel in a ModalWindow

2009-11-28 Thread Ed _

I am trying to add some javascript via a panel that gets opened in a Modal 
Window.
 
 
The same panel on a web page adds the js to the head section of the page.
 
But does not when opened in a Modal Window.
 
is there a way to do this? 
 
thx,
 
Ed
_
Bing brings you maps, menus, and reviews organized in one place.
http://www.bing.com/search?q=restaurantsform=MFESRPpubl=WLHMTAGcrea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1

Communication Layer Security

2009-11-28 Thread Jérôme Verstrynge

Hi,

I am new to Wicket and I am reading the Wicket in Action book. My 
question: how is the communication layer secured? How can one encrypt 
the communication between the server and the user?


Thanks,

Jérôme

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



Re: Communication Layer Security

2009-11-28 Thread Igor Vaynberg
ssl

-igor

On Sat, Nov 28, 2009 at 10:15 AM, Jérôme Verstrynge jvers...@gmail.com wrote:
 Hi,

 I am new to Wicket and I am reading the Wicket in Action book. My question:
 how is the communication layer secured? How can one encrypt the
 communication between the server and the user?

 Thanks,

 Jérôme

 -
 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: Communication Layer Security

2009-11-28 Thread UseTheFork

Ok, but HOW is this integrated with Wicket? What needs to be done? How does
it work with Wicket? How is this integrated?

Thanks !!!

JVerstry


igor.vaynberg wrote:
 
 ssl
 
 -igor
 

-- 
View this message in context: 
http://old.nabble.com/Communication-Layer-Security-tp2674p26555607.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: Communication Layer Security

2009-11-28 Thread Igor Vaynberg
this has nothing to do with wicket, it has to do with your servlet container

-igor

On Sat, Nov 28, 2009 at 10:21 AM, UseTheFork jvers...@gmail.com wrote:

 Ok, but HOW is this integrated with Wicket? What needs to be done? How does
 it work with Wicket? How is this integrated?

 Thanks !!!

 JVerstry


 igor.vaynberg wrote:

 ssl

 -igor


 --
 View this message in context: 
 http://old.nabble.com/Communication-Layer-Security-tp2674p26555607.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: Communication Layer Security

2009-11-28 Thread Daan van Etten

Hi Jérôme,

Check this: http://cwiki.apache.org/WICKET/how-to-switch-to-ssl-mode.html

Regards,

Daan van Etten

Op 28 nov 2009, om 19:21 heeft UseTheFork het volgende geschreven:



Ok, but HOW is this integrated with Wicket? What needs to be done?  
How does

it work with Wicket? How is this integrated?

Thanks !!!

JVerstry


igor.vaynberg wrote:


ssl

-igor



--
View this message in context: 
http://old.nabble.com/Communication-Layer-Security-tp2674p26555607.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



Hide feedback when there are no messages

2009-11-28 Thread Николай Кучумов
Hello.
I'm currently developing a sign up form using Wicket.
I've stylized the error feedback panel to make it look red, and now i see
this red panel even when there are no messages at all.
Can you advice me something to make the feedback panel div invisible when
there are no messages?
*You can get the idea by going to http://vostrets.ru/register/ - the error
panel is empty but is still visible...


Re: CompoundPropertyModel

2009-11-28 Thread Николай Кучумов
Today I've finally worked out the cause of the error - that was the NginX
caching server which was somehow caching data.
It was set up incorrectly.
Today I've corrected my NginX configuration files, and everything works now,
even with the bookmarks.

2009/11/20 Николай Кучумов kuchum...@gmail.com

 Hello, Alex, Jeremy and others.

 That's weird. Really weird.
 You know what?
 Seems that my browser was causing the error...
 If i open my site via a bookmark, it outputs the error.
 However if i open a new tab and type in the URL manually, the error doesn't
 appear.
 So, an advice to all of the Firefox users: don't bookmark the link to your
 web application!


 2009/11/14 Alex Rass a...@itbsllc.com

 Kolya,

 2 things:
 1) If you still have the old setup:
  Try stopping server, deploying your stuff to it, starting server.
  I've had issues with redeploying at runtime (hot deploy) with Tomcat
 (which is what Glassfish is based on).  This is where Jeremy's advice to
 run
 Jetty is a good idea.

 2) Make sure that you refresh the form in your web browser before you try
 to
 enter data and submit.  Wicket needs to do stuff to that form before you
 can
 submit it and if you keep same browser open between deployments, you are
 sending data back to wicket that it knows nothing about, so it blows up
 with
 pageexpired.

 The fact that you don't get serialization errors in the log (if it wasn't
 serialized) is b/c it didn't get that far yet, so problems are elsewhere.

 Hope this helps,
 - Alex.

 -Original Message-
 From: Николай Кучумов [mailto:kuchum...@gmail.com]
 Sent: Saturday, November 14, 2009 9:33 AM
 To: users@wicket.apache.org
 Subject: Re: CompoundPropertyModel

 Hi, Jeremy.
 No, the log contained only this error...
 But to be honest, although it didn't fix the error, your advice is still
 valuable, because not all of the classes were Serializable.
 And you know what?
 I think I'll reinstall my application server.
 I used Glassfish 2 before, and this time I tried Glassfish 3, but it
 appeared to be a bitch...
 It hangs oftenly and operates strangely...
 So maybe it somehow messes with the sessions...
 I'll install Glassfish 2 back then, when I have more time for this (maybe
 tomorrow), and then I'll post the results here.
 Thanks for your reply.

 On Sat, Nov 14, 2009 at 5:11 PM, Jeremy Thomerson 
 jer...@wickettraining.com
  wrote:

  Do both Person and Credentials (and everything else Person holds on to)
  implement Serializable?
 
  Watch the logs to see if there are serialization errors.  It's a problem
 of
  the page not being in the session - which means it either didn't make it
  there or the session is somehow gone.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Sat, Nov 14, 2009 at 7:26 AM, Николай Кучумов kuchum...@gmail.com
  wrote:
 
   Hello.
   I have a Person class, describing a person, which has a member
   credentials of type Credentials (username/password).
   I tried to make a registration page in this way:
  
   Page
   {
  super();
  
  Person person = [create a person with empty credentials];
  
  Form form = new Form(form, new CompoundPropertyModel(person));
  
  add(form);
  
  form.add(new TextField(familyName));
  form.add(new TextField(givenName));
  
  form.add(new TextField(credentials.userName));
  form.add(new TextField(credentials.passWord));
  
  // also add a submit button
   }
  
   And now when I push the Submit button, it outputs this error:
  
   org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
   rendered page in session
 [pagemap=null,componentPath=0,versionNumber=0]
  
   I like the idea of compound object model, and I wouldn't like to
 deprive
   myself from using it just because of this strange error...
   Can you give me a hint on what have I done wrong in the code above?
  
 


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





Re: Hide feedback when there are no messages

2009-11-28 Thread Major Péter
Hi,

How does your markup looks like?

Peter

2009-11-28 20:26 keltezéssel, Николай Кучумов írta:
 Hello.
 I'm currently developing a sign up form using Wicket.
 I've stylized the error feedback panel to make it look red, and now i see
 this red panel even when there are no messages at all.
 Can you advice me something to make the feedback panel div invisible when
 there are no messages?
 *You can get the idea by going to http://vostrets.ru/register/ - the error
 panel is empty but is still visible...

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



Re: How to render panel markup to string - solved

2009-11-28 Thread Martin Makundi
I'm just rendering a panel to a string for other purposes, sending
out in an email, attaching recurring markup into javascript variables
etc.

**
Martin

2009/11/28 Jonathan Locke jonathan.lo...@gmail.com:


 don't know what you're doing exactly or if i ever tested this one, but this
 might be of interest:

 http://code.google.com/p/twenty-six-wicket-tricks/source/browse/trunk/twenty-six-wicket-tricks/src/main/java/com/locke/library/web/panels/caching/CachingPanel.java

   jon


 MartinM wrote:

 Hi!

 Here is a way to render panel markup to string.

 It is a bit of a tweak, I admit, but what can you do.

 1. Assume you have components on your page, ready to be rendered.

 2. In onBeforeRender, quickly switch one of your existing components
 to another that you want to render into a string

 3. Let your special component render into a string.

 4. Restore back to the original component that was supposed to be
 rendered onto the web page.

 5. It seems to work ok at least if your component is a panel.

 Example code:

 ---8

 somewhere in your page hierarchy that is actually rendered

 /**
    * @see org.apache.wicket.Page#onBeforeRender()
    */
   @Override
   protected void onBeforeRender() {
     System.out.println(\n-\n
         + MarkupUtils.renderToString(loginForm, new
 IntroductionPanel(loginForm.getId(;
     super.onBeforeRender();
   }

 ---8

 MarkupUtils.public static String renderToString(final Component
 parentDonorComponent, final Component component) {
     if (!component.getId().equals(parentDonorComponent.getId())) {
       throw new IllegalStateException(Component will try to
 substitute parentDonorComponent to render. Donor and string render
 Component id's must be equal.);
     }

     final Response originalResponse = RequestCycle.get().getResponse();
     StringResponse stringResponse = new StringResponse();
     RequestCycle.get().setResponse(stringResponse);
     MarkupContainer parentComponent = parentDonorComponent.getParent();
     parentComponent.remove(parentDonorComponent);

     try {
       parentComponent.add(component);

       try {
         component.prepareForRender();
         component.renderComponent();
       } catch (RuntimeException e) {
         component.afterRender();
         throw e;
       }
     } finally {
       // Restore original component
       parentComponent.replace(parentDonorComponent);
       // Restore original response
       RequestCycle.get().setResponse(originalResponse);
     }

     return stringResponse.toString();
   }


 **
 Martin

 2009/10/30 Martin Makundi martin.maku...@koodaripalvelut.com:
 Almost still needs some tweaking:

 org.apache.wicket.WicketRuntimeException: Unable to find the markup
 for the component. That may be due to transparent containers or
 components implementing IComponentResolver: [MarkupContainer
 [Component id = -]]
     at
 org.apache.wicket.MarkupFragmentFinder.find(MarkupFragmentFinder.java:125)
     at
 org.apache.wicket.Component.locateMarkupStream(Component.java:3813)
     at org.apache.wicket.Component.renderComponent(Component.java:2547)

 **
 Martin

 2009/10/30 Martin Makundi martin.maku...@koodaripalvelut.com:
 Looking at AjaxRequestTarget, maybe something like this might work?

                // substitute our encoding response for the real one so
 we can capture
                // component's markup in a manner safe for transport
 inside CDATA block
                final Response originalResponse = response;
                StringResponse stringResponse = new StringResponse();
                RequestCycle.get().setResponse(stringResponse);

                // Initialize temporary variables
                final Page page = component.findParent(Page.class);
                if (page == null)
                {
                        // dont throw an exception but just ignore this
 component, somehow
                        // it got
                        // removed from the page.
                        // throw new IllegalStateException(
                        // Ajax request attempted on a component that is
 not associated
                        // with a Page);
                        LOG.debug(component:  + component +  with
 markupid:  + markupId +
                                 not rendered because it was already
 removed from page);
                        return;
                }

                page.startComponentRender(component);

                try
                {
                        component.prepareForRender();

                        // render any associated headers of the component
                        respondHeaderContribution(response, component);
                }
                catch (RuntimeException e)
                {
                        try
                        {
                                component.afterRender();
                 

Re: Hide feedback when there are no messages

2009-11-28 Thread Николай Кучумов
Hello, Major.

It looks like this:

body
wicket:extend

div wicket:id=feedback class=error
/div

br/br/br/

form wicket:id=form


/form
/wicket:extend
/body

and the CSS is:

.error
{

width: auto;
margin-left: 25%;
margin-right: 25%;

border: 1px solid #fc908c;

background-image: url('../pictures/icons/error_64x64.png');
background-color: #ffeceb;
}

You can view the bookmark on the link provided above (vostrets.ru/register/)
- just open the page in Firefox, right click and View page source.


Re: Hide feedback when there are no messages

2009-11-28 Thread Major Péter
well, if you put in the class=error by deafult, of course it will show
the div. ;)
Delete from your markup the class=error, then see when your validation
fails, what css class will be generated via wicket, and override that
from your css file.

Peter

2009-11-28 20:46 keltezéssel, Николай Кучумов írta:
 Hello, Major.
 
 It looks like this:
 
 body
 wicket:extend
 
 div wicket:id=feedback class=error
 /div
 
 br/br/br/
 
 form wicket:id=form
 
 
 /form
 /wicket:extend
 /body
 
 and the CSS is:
 
 .error
 {
 
 width: auto;
 margin-left: 25%;
 margin-right: 25%;
 
 border: 1px solid #fc908c;
 
 background-image: url('../pictures/icons/error_64x64.png');
 background-color: #ffeceb;
 }
 
 You can view the bookmark on the link provided above (vostrets.ru/register/)
 - just open the page in Firefox, right click and View page source.

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



Re: Communication Layer Security

2009-11-28 Thread UseTheFork

Thanks Daan, that's the hook I was looking for !!!

Jérôme


Daan (StuQ) wrote:
 
 Hi Jérôme,
 
 Check this: http://cwiki.apache.org/WICKET/how-to-switch-to-ssl-mode.html
 
 Regards,
 
 Daan van Etten
 
 

-- 
View this message in context: 
http://old.nabble.com/Communication-Layer-Security-tp2674p26556598.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: Hide feedback when there are no messages

2009-11-28 Thread Николай Кучумов
Oh, really.
Thank you, Major Obvious : )
The class is feedbackPanel:

ul wicket:id=feedbackul class=feedbackPanel

I think i'll try to somehow subclass it tomorrow to get it output something
like errorFeedbackPanel.


2009/11/28 Major Péter majorpe...@sch.bme.hu

 well, if you put in the class=error by deafult, of course it will show
 the div. ;)
 Delete from your markup the class=error, then see when your validation
 fails, what css class will be generated via wicket, and override that
 from your css file.

 Peter

 2009-11-28 20:46 keltezéssel, Николай Кучумов írta:
  Hello, Major.
 
  It looks like this:
 
  body
  wicket:extend
 
  div wicket:id=feedback class=error
  /div
 
  br/br/br/
 
  form wicket:id=form
 
  
  /form
  /wicket:extend
  /body
 
  and the CSS is:
 
  .error
  {
 
  width: auto;
  margin-left: 25%;
  margin-right: 25%;
 
  border: 1px solid #fc908c;
 
  background-image: url('../pictures/icons/error_64x64.png');
  background-color: #ffeceb;
  }
 
  You can view the bookmark on the link provided above (
 vostrets.ru/register/)
  - just open the page in Firefox, right click and View page source.

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




Re: Hide feedback when there are no messages

2009-11-28 Thread Major Péter
You're welcome. :)
Why do you want to subclass it?

Check out our solution:
In your page add:
add(new FeedbackPanel(pagemessages));

in html:
span wicket:id=pagemessages id=pagemessages/span

in css:
#pagemessages ul li {
list-style: none;
background: #D9EBF9 url('../images/bckgNotice.gif') top left repeat-x;
}
#pagemessages ul li .feedbackPanelERROR, #pagemessages ul li
.feedbackPanelINFO {
display: block;
padding: 6px 0 6px 36px;
}
#pagemessages ul li .feedbackPanelERROR { background:
url('../images/iconError.gif') top left no-repeat; }
#pagemessages ul li .feedbackPanelINFO { background:
url('../images/iconInfo.gif') top left no-repeat; }
#pagemessages ul {
border: 1px solid #CBE5F7;
width: 480px;
margin-top: 15px;
position: relative;
right: -200px;
}

for example. Like this you can use FBP both for validations and simple
messaging with user (via info(), error() and warning() functions of page).

Peter

2009-11-28 21:33 keltezéssel, Николай Кучумов írta:
 Oh, really.
 Thank you, Major Obvious : )
 The class is feedbackPanel:
 
 ul wicket:id=feedbackul class=feedbackPanel
 
 I think i'll try to somehow subclass it tomorrow to get it output something
 like errorFeedbackPanel.
 
 
 2009/11/28 Major Péter majorpe...@sch.bme.hu
 
 well, if you put in the class=error by deafult, of course it will show
 the div. ;)
 Delete from your markup the class=error, then see when your validation
 fails, what css class will be generated via wicket, and override that
 from your css file.

 Peter

 2009-11-28 20:46 keltezéssel, Николай Кучумов írta:
 Hello, Major.

 It looks like this:

 body
 wicket:extend

 div wicket:id=feedback class=error
 /div

 br/br/br/

 form wicket:id=form

 
 /form
 /wicket:extend
 /body

 and the CSS is:

 .error
 {

 width: auto;
 margin-left: 25%;
 margin-right: 25%;

 border: 1px solid #fc908c;

 background-image: url('../pictures/icons/error_64x64.png');
 background-color: #ffeceb;
 }

 You can view the bookmark on the link provided above (
 vostrets.ru/register/)
 - just open the page in Firefox, right click and View page source.

 -
 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: Hide feedback when there are no messages

2009-11-28 Thread Николай Кучумов
Thanks Peter, it works.

2009/11/28 Major Péter majorpe...@sch.bme.hu

 You're welcome. :)
 Why do you want to subclass it?

 Check out our solution:
 In your page add:
 add(new FeedbackPanel(pagemessages));

 in html:
 span wicket:id=pagemessages id=pagemessages/span

 in css:
 #pagemessages ul li {
list-style: none;
background: #D9EBF9 url('../images/bckgNotice.gif') top left repeat-x;
 }
 #pagemessages ul li .feedbackPanelERROR, #pagemessages ul li
 .feedbackPanelINFO {
display: block;
padding: 6px 0 6px 36px;
 }
 #pagemessages ul li .feedbackPanelERROR { background:
 url('../images/iconError.gif') top left no-repeat; }
 #pagemessages ul li .feedbackPanelINFO { background:
 url('../images/iconInfo.gif') top left no-repeat; }
 #pagemessages ul {
border: 1px solid #CBE5F7;
width: 480px;
margin-top: 15px;
position: relative;
right: -200px;
 }

 for example. Like this you can use FBP both for validations and simple
 messaging with user (via info(), error() and warning() functions of page).

 Peter

 2009-11-28 21:33 keltezéssel, Николай Кучумов írta:
  Oh, really.
  Thank you, Major Obvious : )
  The class is feedbackPanel:
 
  ul wicket:id=feedbackul class=feedbackPanel
 
  I think i'll try to somehow subclass it tomorrow to get it output
 something
  like errorFeedbackPanel.
 
 
  2009/11/28 Major Péter majorpe...@sch.bme.hu
 
  well, if you put in the class=error by deafult, of course it will show
  the div. ;)
  Delete from your markup the class=error, then see when your validation
  fails, what css class will be generated via wicket, and override that
  from your css file.
 
  Peter
 
  2009-11-28 20:46 keltezéssel, Николай Кучумов írta:
  Hello, Major.
 
  It looks like this:
 
  body
  wicket:extend
 
  div wicket:id=feedback class=error
  /div
 
  br/br/br/
 
  form wicket:id=form
 
  
  /form
  /wicket:extend
  /body
 
  and the CSS is:
 
  .error
  {
 
  width: auto;
  margin-left: 25%;
  margin-right: 25%;
 
  border: 1px solid #fc908c;
 
  background-image: url('../pictures/icons/error_64x64.png');
  background-color: #ffeceb;
  }
 
  You can view the bookmark on the link provided above (
  vostrets.ru/register/)
  - just open the page in Firefox, right click and View page source.
 
  -
  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: Wicket YUI - Integration (Slider Question)

2009-11-28 Thread Joshua Lim
Hi J.D.

the tick marks on the background does not generate automatically
unfortunately, because it's a css background image. In order to make it
strechable I used a repeating background image for that. you can however,
try overriding the Yui*Settings to provide your own background image that
correspond to your Tick settings. That might work.

Regarding the getOnChangeJSFunc() {...} for the YuiSlider, please note that
this is the JavaScript running on the client and does not make wicket ajax
callbacks to the components.


HTH
Josh



2009/11/21 Corbin, James jcor...@iqnavigator.com

 In regards to ajaxy question below, the reason I needed this was to
 update a label when the slider value was changed.  I looked at the
 example and noticed that this could be done by overriding the following
 method on the slider:

 Protected String getOnChangeJSFunc() {...}

 I still have the question on rendering the tick marks, but will continue
 looking at that one as well.

 J.D.

 -Original Message-
 From: Corbin, James [mailto:jcor...@iqnavigator.com]
 Sent: Friday, November 20, 2009 8:48 AM
 To: users@wicket.apache.org
 Subject: Wicket YUI - Integration (Slider Question)

 Hello,



 I am using the framework off the wicket-stuff trunk that wraps yui to
 work with wicket.  I must say it works pretty well.



 I did have a few questions on the slider that I hoped someone had
 experience with at solving,



 1. I cannot seem to get the tick marks to show up on the control?  Is
 this not supported in the current implementation of the framework
 wrapper?

 2. Does the slider component support attaching ajax behaviors?  I am
 looking to bind an ajax behavior (onchange) that updates a label with a
 current value of the slider.  I assume this is possible and will try it
 this morning but wanted to check the forum to see if its wasted effort.



 Thanks,
 J.D.


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