Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Matthew Young
Sorry I can't help you with your question.  But may I ask where you get the
PhoneFormatter?

On Wed, May 14, 2008 at 5:58 PM, Sam Barnum [EMAIL PROTECTED] wrote:

 Using the tips in this PDF
 http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf

 I created the simple RequiredBorder class as follows:

 public class RequiredBorder extends MarkupComponentBorder {
public void renderAfter(Component component) {
FormComponent fc = (FormComponent) component;
if (fc.isRequired()) {
super.renderAfter(component);
}
}
 }

 This basically adds a * after any required fields.  It seemed to work
 great until I used it with an ajax phone formatter behavior:

 new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
Object oldValue = component.getValue();
String formatted = new PhoneFormatter().format(oldValue);
component.setModelObject(formatted);
target.addComponent(component);
}
 }


 This caused duplicate * indicators to appear after my phone field when
 the phone number changed, one per onchange request.  I tried adding a
 boolean field to the RequiredBorder so it only gets processed once.  This
 fixed the phone formatter duplicates, but if the form submits and stays on
 the same page, all the * marks disappear from the required fields.

 This is definitely some sort of lifecycle problem, but how do you fix it?

 On a related note, is it generally a bad idea to mix AJAX and non-ajax
 actions?  It seems like this is one of many issues I've run into when doing
 this.

 Thanks,

 -Sam Barnum


Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Gerolf Seitz
Sam,
a similar issue happened to the WicketAjaxIndicatorAppender.
take a look at WicketAjaxIndicatorAppender#renderHead to see
how this is solved there.
maybe you can do something similar with your RequiredBorder.

regards,
  Gerolf

On Thu, May 15, 2008 at 2:58 AM, Sam Barnum [EMAIL PROTECTED] wrote:

 Using the tips in this PDF
 http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf

 I created the simple RequiredBorder class as follows:

 public class RequiredBorder extends MarkupComponentBorder {
public void renderAfter(Component component) {
FormComponent fc = (FormComponent) component;
if (fc.isRequired()) {
super.renderAfter(component);
}
}
 }

 This basically adds a * after any required fields.  It seemed to work
 great until I used it with an ajax phone formatter behavior:

 new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
Object oldValue = component.getValue();
String formatted = new PhoneFormatter().format(oldValue);
component.setModelObject(formatted);
target.addComponent(component);
}
 }


 This caused duplicate * indicators to appear after my phone field when
 the phone number changed, one per onchange request.  I tried adding a
 boolean field to the RequiredBorder so it only gets processed once.  This
 fixed the phone formatter duplicates, but if the form submits and stays on
 the same page, all the * marks disappear from the required fields.

 This is definitely some sort of lifecycle problem, but how do you fix it?

 On a related note, is it generally a bad idea to mix AJAX and non-ajax
 actions?  It seems like this is one of many issues I've run into when doing
 this.

 Thanks,

 -Sam Barnum


Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Sebastiaan van Erk

Igor Vaynberg wrote:

well, apparently johan ran into a situation where component? is too
restrictive...


As I understand it, Johan ran into a situation where Component? causes 
*warnings* for users who use raw types. Which I've been arguing all 
along that they SHOULD get: they should use ComponentObject or 
ComponentVoid instead of raw types, or live-with/suppress the warning.


To make it clear, I made the following test class:

public class TestT {

public void doTest(Test? extends Test? test) {
System.out.println(test);
}

public static void main(String[] args) {
TestTestInteger test1 = newInstance(); // fine - no 
warnings.
TestTest test2 = newInstance(); // not fine, use of raw type, 
warning
Test test3 = newInstance(); // not fine, use of raw type, 
warning

test1.doTest(test1); // fine - no warnings.
		test1.doTest(test2); // error - generic types don't match, can be 
fixed by line below

test1.doTest((Test) test2); // warning - unchecked conversion
test1.doTest(test3); // warning - unchecked conversion
}

public static T TestT newInstance() {
return new TestT();
}
}

As you can see, there is only one case when you get a compile error when 
using the ? extends Test? generic type, and that is a case where 
there is on the user side an incorrect generic type: TestTest. The 
user here declares he's using generics, but then inserts a raw type of a 
known generic type - a situation that should not happen.


Regards,
Sebastiaan


-igor


On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

Igor Vaynberg wrote:

since then the thread has evolved into whether or not we should use ?
extends Component or ? extends Component?

-igor

I don't understand how that changes any of my points. The first is incorrect
(from a generics point of view) since you're referencing an unparameterized
generic type.

So the second gives warnings only in code that is not properly generified...

Regards,
Sebastiaan



On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk [EMAIL PROTECTED]
wrote:

Igor Vaynberg wrote:


i do like generics. did i ever say otherwise? the problem here is that
if we scope something as Class? extends Component then even though
you ARE using generics in your code you will still get a warning
because we did not scope the class as Class? extends Component?.

on the other hand if we do scope it as Class? extends Component?
then you can no longer pass a raw reference when calling the function.

But that's exactly the point isn't it? If you're using generics then you
shouldn't be using raw Components anymore...


so we are screwed if we do and we are screwed if we dont, i expected
generics to be better.

Well they definitely could have been better (erasure is terrible if you
ask
me), but I don't see what's wrong in this case. It warns you if you
should
be using a parameterized type but you don't.


And especially if you look at the vote result, I think the majority
wants
the generics...

that vote was before we uncovered this issue. we voted on the idea of
generics, not on the implementation.

That's true, but I wonder if this issue would change the vote much. I
don't
really understand why it's an issue, because you can use generified
Components always: ComponentObject if you don't want to constrain the
model object, and ComponentVoid if you don't need a model.

The question that started the thread was about StringResourceModel which
was
not yet generified, and in that case, the warning seems to me to be
perfectly ok: it just says StringResourceModel should be generified. It's
not a release yet, so that some users who use the current snapshot run
into
these kind of warnings which cannot be removed seems to be fine to me...

Regards,
Sebastiaan



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



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



smime.p7s
Description: S/MIME Cryptographic Signature


Re: overriding getAssociatedMarkupStream

2008-05-15 Thread Eyal Golan
wow !! this wicket is sooo cool :)
I did exactly what you suggested and it works like a charm.
public IResourceStream getMarkupResourceStream(MarkupContainer
container,
Class containerClass) {
if (html == null) {
final DefaultMarkupResourceStreamProvider
markupResourceStreamProvider =
new DefaultMarkupResourceStreamProvider();
return
markupResourceStreamProvider.getMarkupResourceStream(container,
containerClass);
} else {
StringResourceStream myhtml = new StringResourceStream(new
StringBuilder(html));

// The following line is the line that caused the problem of non inserted
header contributers
//MarkupResourceStream m = new MarkupResourceStream(myhtml);

// The following is the fix
return new MarkupResourceStream(myhtml, new
ContainerInfo(container),
containerClass);
}
}

// In order to keep in my cache the real markup, here is what I did
public String getCacheKey(MarkupContainer container, Class
containerClass) {
if (html == null) {
DefaultMarkupCacheKeyProvider cacheKeyProvider = new
DefaultMarkupCacheKeyProvider();
return cacheKeyProvider.getCacheKey(container, containerClass);
} else {
return null;
}
}


Thanks Igor

On Wed, May 14, 2008 at 5:29 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 if you do not want the markup to be cached you have to also implement
 IMarkupCacheKeyProvider. returning null from getcachekey will prevent
 wicket from caching the markup.

 -igor


 On Wed, May 14, 2008 at 5:42 AM, Eyal Golan [EMAIL PROTECTED] wrote:
  Hi,
  I tried implementing the IMarkupResourceStreamProvider in my web page:
 public IResourceStream getMarkupResourceStream(MarkupContainer
  container,
 Class containerClass) {
 if (html != null) {
 StringResourceStream myhtml = new StringResourceStream(new
  StringBuilder(html));
 MarkupResourceStream m = new MarkupResourceStream(myhtml);
 return m;
 } else {
 final DefaultMarkupResourceStreamProvider
  markupResourceStreamProvider =
 new DefaultMarkupResourceStreamProvider();
 return
  markupResourceStreamProvider.getMarkupResourceStream(container,
 containerClass);
 }
 }
 
  (html is a class member that may or may not be available)
 
  It did not work:
  1. The Cache keeps the last html markup, so if I open this page once WITH
  html != null I get what I want (but with the same problem. look at next
  note). If then I open the page and the html  IS null, the cache returns
 the
  earlier page. So this approach is no good.
 
  2. In any case, HeaderContributers that are on components that in the
 page
  are not added to the output markup.
 
  Are the 2 lines:
 StringResourceStream myhtml = new StringResourceStream(new
  StringBuilder(html));
 MarkupResourceStream m = new MarkupResourceStream(myhtml);
   The problem ?
 
  Thanks
 
  On Thu, May 8, 2008 at 6:41 AM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:
 
  you shouldnt be overriding that method, try implementing
  IMarkupResourceStreamProvider instead.
 
  -igor
 
 
  On Tue, May 6, 2008 at 11:20 PM, Eyal Golan [EMAIL PROTECTED] wrote:
   ok, maybe I wasn't clear enough.
The simple question is, why the add(HeaderContributor.forCss...));
is not added to the output markup when I override
  getAssociatedMarkupStream?
  
Thanks
  
  
  
On Tue, May 6, 2008 at 4:08 PM, Eyal Golan [EMAIL PROTECTED]
 wrote:
  
 Hi all,
 We have this method:
 @Override
 public MarkupStream getAssociatedMarkupStream(final boolean
 throwException)
 {
 if(html != null) {
 return GUIUtis.getMarkupStream(this, html);
 }
 return super.getAssociatedMarkupStream(throwException);
 }

 and:
 static public MarkupStream getMarkupStream(Page page,String
  htmlText){
 try
 {
 StringResourceStream myhtml = new
 StringResourceStream(new
 StringBuilder(htmlText));
 MarkupResourceStream m = new
 MarkupResourceStream(myhtml);
 Markup myMarkup =

 
 page.getApplication().getMarkupSettings().getMarkupParserFactory().newMarkupParser(m).parse();
 MarkupStream markupStream = new MarkupStream(myMarkup);
 return markupStream;
 }
 catch (Exception ex)
 {
 throw new RuntimeException(Fail to parse
 markup:\n+htmlText);
 }
 }

 The problem:
 When the html is not null (and we enter GUIUtis.getMarkupStream),
 css that where added using HeaderContributer are not added to the
  output
 HTML markup.
 I have something like this in a component:
 

Re: FYI: new wicket site

2008-05-15 Thread wicket user
Hi Lars,

Very good site, i like it its, pretty cool

Dipu

On Wed, May 14, 2008 at 9:36 AM, lars vonk [EMAIL PROTECTED] wrote:

 Hi all,

 A new Wicket site is born! It's a Dutch site on which you can search for
 day
 trips and such. See: www.eropuit.nl.

 Thanks to the user- and dev-group for answering any questions we had during
 the process.

 Lars



Page expired using LazyLoadPanel and clustering

2008-05-15 Thread richardwilko

Hi,

I almost have clustering working now - thanks for all the help people have
given me.

However keep seeing page exprired errors, specifically on a page that has an
ajax lazy load panel on it.  the page will load fine, but when the lazy load
code executes the app throws a page expired error, a bit of digging arround
shows me that wicket cannot find the page it has just created in session.  I
am sure that its the ajax request from the lazy load panel as if I turn off
javascript the page loads fine.

This does not happen when I dont use terracotta clustering.

We are using jetty 6.1.9, terracotta 2.5.4, wicket 1.3.3.  Whats strange is
that even after I get the page expired error and go back into my app I still
have the same jsessionid and looking at the session data in terracotta I see
that I still have the same session.  Also this doesn't occur on every page
with lazy loaded components, just one of them.

Its like the session isnt updated before the ajax lazy load panel call is
made.

Can anyone shed any light on this?  I've spent way too much time getting
clustering to work already...

Thanks,

Richard
-- 
View this message in context: 
http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17249134.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



WicketStuff YUI simple editor

2008-05-15 Thread Nino Saturnino Martinez Vazquez Wael

Hi

Im dabbling with using a rich editor.

I have a page where I have several ajax tabs, one of them are to contain 
a editor. I first tried using tinceMCE, but that has troubles with ajax 
and the header contributions (tinyMCE cant handle it).


Then I switched to YUI, but if I add the component again, via 
ajaxtarget. It actually shows 2 edit windows etc...


Also the YUI editor implementation in wicket stuff is not that 
customizatiable, I cant change the titlebar. It could be a small patch 
depending on the solution... We could turn our faces at datepicker, 
which has some facilities for customization.


--
-Wicket for love

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


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



ErrorPage won't render

2008-05-15 Thread Sergey Podatelev
Hello,

I have a custom error page BaseErrorPage:

public class BaseErrorPage extends WebPage {

private final static long serialVersionUID = 1L;

public BaseErrorPage() {
super();
}

protected void configureResponse() {
String acceptHeader = getWebRequestCycle().getWebRequest().
getHttpServletRequest().getHeader(Accept);

String contentType = ;charset=UTF-8;

if (acceptHeader.contains(application/xhtml+xml)) {
contentType = application/xhtml+xml + contentType;
} else {
contentType = text/html + contentType;
}
getResponse().setContentType(contentType);
}
}

It's configured to be displayed in case of a runtime exception:

MyApplication.init():

...
getApplicationSettings().setInternalErrorPage(BaseErrorPage.class);
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
...

I'm testing what happens if MySQL server goes down.
When it happens, first I got a SocketException which is caught and
BaseErrorPage is displayed.
But if I wait for a while (perhaps, until session expires?), I get just a
blank page in browser and in server log I see the following:

unexpected exception when handling another exception: Can't instantiate page
using constructor public com.mycorp.myapp.web.page.BaseErrorPage()
org.apache.wicket.WicketRuntimeException: Can't instantiate page using
constructor public com.mycorp.myapp.web.page.BaseErrorPage()
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
...

Why does this happen and how can I prevent this?
I checked the DefaultPageFactory source and found that there's either an
Abort-, Initialization- or MarkupException, but I'm not sure how to deal
with any of those.

-- 
sp


Scheduler in wicket

2008-05-15 Thread adrienleroy

Hello,

For the application that i am currently developing i need to schedule some
task.
I am planning to use quartz, but before starting to integrate it in my
wicket's app 
i would like to know if anybody have used it or another scheduler with
wicket.

Thanks
-- 
View this message in context: 
http://www.nabble.com/Scheduler-in-wicket-tp17249740p17249740.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: ErrorPage won't render

2008-05-15 Thread Johan Compagner
do you have more stacktrace like Cause : x

On Thu, May 15, 2008 at 11:22 AM, Sergey Podatelev 
[EMAIL PROTECTED] wrote:

 Hello,

 I have a custom error page BaseErrorPage:

 public class BaseErrorPage extends WebPage {

private final static long serialVersionUID = 1L;

public BaseErrorPage() {
super();
}

protected void configureResponse() {
String acceptHeader = getWebRequestCycle().getWebRequest().
getHttpServletRequest().getHeader(Accept);

String contentType = ;charset=UTF-8;

if (acceptHeader.contains(application/xhtml+xml)) {
contentType = application/xhtml+xml + contentType;
} else {
contentType = text/html + contentType;
}
getResponse().setContentType(contentType);
}
 }

 It's configured to be displayed in case of a runtime exception:

 MyApplication.init():

 ...
 getApplicationSettings().setInternalErrorPage(BaseErrorPage.class);

 getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
 ...

 I'm testing what happens if MySQL server goes down.
 When it happens, first I got a SocketException which is caught and
 BaseErrorPage is displayed.
 But if I wait for a while (perhaps, until session expires?), I get just a
 blank page in browser and in server log I see the following:

 unexpected exception when handling another exception: Can't instantiate
 page
 using constructor public com.mycorp.myapp.web.page.BaseErrorPage()
 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor public com.mycorp.myapp.web.page.BaseErrorPage()
at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at

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

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

 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at

 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
...

 Why does this happen and how can I prevent this?
 I checked the DefaultPageFactory source and found that there's either an
 Abort-, Initialization- or MarkupException, but I'm not sure how to deal
 with any of those.

 --
 sp



Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread Johan Compagner
so it seems a terracotta  problem or config problem...
What kind of session store are you using?

On Thu, May 15, 2008 at 11:15 AM, richardwilko 
[EMAIL PROTECTED] wrote:


 Hi,

 I almost have clustering working now - thanks for all the help people have
 given me.

 However keep seeing page exprired errors, specifically on a page that has
 an
 ajax lazy load panel on it.  the page will load fine, but when the lazy
 load
 code executes the app throws a page expired error, a bit of digging arround
 shows me that wicket cannot find the page it has just created in session.
  I
 am sure that its the ajax request from the lazy load panel as if I turn off
 javascript the page loads fine.

 This does not happen when I dont use terracotta clustering.

 We are using jetty 6.1.9, terracotta 2.5.4, wicket 1.3.3.  Whats strange
 is
 that even after I get the page expired error and go back into my app I
 still
 have the same jsessionid and looking at the session data in terracotta I
 see
 that I still have the same session.  Also this doesn't occur on every page
 with lazy loaded components, just one of them.

 Its like the session isnt updated before the ajax lazy load panel call is
 made.

 Can anyone shed any light on this?  I've spent way too much time getting
 clustering to work already...

 Thanks,

 Richard
 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17249134.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Scheduler in wicket

2008-05-15 Thread Wouter Huijnink



I am planning to use quartz, but before starting to integrate it in my
wicket's app 
i would like to know if anybody have used it or another scheduler with

wicket.
  


we used Quartz, works like a charm. I wonder, though, what it has to do 
with Wicket - your scheduling probably (or rather: hopefully) has 
nothing to do with the UI layer of your web app, right?


regards,
Wouter

--
Wouter Huijnink
Func. Internet Integration
W http://www.func.nl
T +31 20 423
F +31 20 4223500


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



Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread Johan Compagner
if you use terracotta you shouldnt use the default DiskPageStore i believe
but revert back to the 1.2 httpsessionstore..



On Thu, May 15, 2008 at 11:28 AM, richardwilko 
[EMAIL PROTECTED] wrote:


 We are using the default session store, in that we haven't specified
 anything
 different.

 All the pages are serizable and are clusterable by terracotta.

 The only difference in the clustered and non clustered app is that you have
 to use the terracotta session manager in jetty for terracotta to work.  I'm
 tempted to blame that for the problem, but i dont see the problem on other
 pages with lazy loaded components.





 Johan Compagner wrote:
 
  so it seems a terracotta  problem or config problem...
  What kind of session store are you using?
 
  On Thu, May 15, 2008 at 11:15 AM, richardwilko 
  [EMAIL PROTECTED] wrote:
 
 
  Hi,
 
  I almost have clustering working now - thanks for all the help people
  have
  given me.
 
  However keep seeing page exprired errors, specifically on a page that
 has
  an
  ajax lazy load panel on it.  the page will load fine, but when the lazy
  load
  code executes the app throws a page expired error, a bit of digging
  arround
  shows me that wicket cannot find the page it has just created in
 session.
   I
  am sure that its the ajax request from the lazy load panel as if I turn
  off
  javascript the page loads fine.
 
  This does not happen when I dont use terracotta clustering.
 
  We are using jetty 6.1.9, terracotta 2.5.4, wicket 1.3.3.  Whats
 strange
  is
  that even after I get the page expired error and go back into my app I
  still
  have the same jsessionid and looking at the session data in terracotta I
  see
  that I still have the same session.  Also this doesn't occur on every
  page
  with lazy loaded components, just one of them.
 
  Its like the session isnt updated before the ajax lazy load panel call
 is
  made.
 
  Can anyone shed any light on this?  I've spent way too much time getting
  clustering to work already...
 
  Thanks,
 
  Richard
  --
  View this message in context:
 
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17249134.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17249333.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread richardwilko

We are using the default session store, in that we haven't specified anything
different.

All the pages are serizable and are clusterable by terracotta.

The only difference in the clustered and non clustered app is that you have
to use the terracotta session manager in jetty for terracotta to work.  I'm
tempted to blame that for the problem, but i dont see the problem on other
pages with lazy loaded components.





Johan Compagner wrote:
 
 so it seems a terracotta  problem or config problem...
 What kind of session store are you using?
 
 On Thu, May 15, 2008 at 11:15 AM, richardwilko 
 [EMAIL PROTECTED] wrote:
 

 Hi,

 I almost have clustering working now - thanks for all the help people
 have
 given me.

 However keep seeing page exprired errors, specifically on a page that has
 an
 ajax lazy load panel on it.  the page will load fine, but when the lazy
 load
 code executes the app throws a page expired error, a bit of digging
 arround
 shows me that wicket cannot find the page it has just created in session.
  I
 am sure that its the ajax request from the lazy load panel as if I turn
 off
 javascript the page loads fine.

 This does not happen when I dont use terracotta clustering.

 We are using jetty 6.1.9, terracotta 2.5.4, wicket 1.3.3.  Whats strange
 is
 that even after I get the page expired error and go back into my app I
 still
 have the same jsessionid and looking at the session data in terracotta I
 see
 that I still have the same session.  Also this doesn't occur on every
 page
 with lazy loaded components, just one of them.

 Its like the session isnt updated before the ajax lazy load panel call is
 made.

 Can anyone shed any light on this?  I've spent way too much time getting
 clustering to work already...

 Thanks,

 Richard
 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17249134.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17249333.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Scheduler in wicket

2008-05-15 Thread Jan Kriesten


hi,


I am planning to use quartz, but before starting to integrate it in my
wicket's app i would like to know if anybody have used it or another scheduler 
with
wicket.


quartz is a good choice - it just works (tm).

best regards, --- jan.



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



after render using a behavior vs. override in the component

2008-05-15 Thread Eyal Golan
Hello,
I have a MyButton that extends Button.
I have a JavaScript that I need to ad to the output markup after the
button's markup.
I'm trying to do this with two differnet options:
Either I Override onAfterRender in MyButton:
@Override
protected void onAfterRender() {
if (isVisible()) {
getResponse().write(Consts.getResizeScript(getMarkupId()));
}
super.onAfterRender();
}

Or, I add to the button a behavior and write this:
@Override
public void onRendered(Component component) {
if (component.isVisible()) {

component.getResponse().write(Consts.getResizeScript(component.getMarkupId()));
}

}

Now, the situation is like this:
Using the first option (override in the component), the script is added to
the end of the html. Just after the /html
Using the second option (the behavior), the script is added just after the
close tag of the button /button.

Using FF, all is ok, but in IE7, there's a problem in calculating the size
and the button is not shown correctly.

What causes the differences? and how can I manipulate the behavior to work
like option 1 ?

Thanks very much...

-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread richardwilko

I still get the same behaviour with the httpsessionstore.

the problem seems to be that the page isnt put in the page map, so when the
ajax call is made to lazy load the panel it cant access the page its on.

looking at the http session data in the terracotta admin console i see that
the AccessStackPageMap has a page map name set to null, and i cant find the
page i should be on in the httpsession.



if you use terracotta you shouldnt use the default DiskPageStore i believe
but revert back to the 1.2 httpsessionstore..


-- 
View this message in context: 
http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17250260.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Scheduler in wicket

2008-05-15 Thread James Carman
On Thu, May 15, 2008 at 6:04 AM, Wouter Huijnink [EMAIL PROTECTED] wrote:

 I am planning to use quartz, but before starting to integrate it in my
 wicket's app i would like to know if anybody have used it or another
 scheduler with
 wicket.


 we used Quartz, works like a charm. I wonder, though, what it has to do with
 Wicket - your scheduling probably (or rather: hopefully) has nothing to do
 with the UI layer of your web app, right?

+1.  We use Quartz also and it works very well for what we need.

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



Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread Johan Compagner
look at setAttribute then for the store
It should be but into the session in the detach of the request.

On Thu, May 15, 2008 at 12:30 PM, richardwilko 
[EMAIL PROTECTED] wrote:


 I still get the same behaviour with the httpsessionstore.

 the problem seems to be that the page isnt put in the page map, so when the
 ajax call is made to lazy load the panel it cant access the page its on.

 looking at the http session data in the terracotta admin console i see that
 the AccessStackPageMap has a page map name set to null, and i cant find the
 page i should be on in the httpsession.



 if you use terracotta you shouldnt use the default DiskPageStore i believe
 but revert back to the 1.2 httpsessionstore..


 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17250260.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: ErrorPage won't render

2008-05-15 Thread Sergey Podatelev
The default stacktrace is listed below.

Apparently, the error page won't load for the same reason original page
wasn't loaded: Spring (which I also use) wants a Connection even for a page
that does not require any database interaction. This question is also
bothering me, and although this is a Spring issue, perhaps someone of Wicket
people could answer me since there so much examples of integration of Wicket
and Spring.

unexpected exception when handling another exception: Can't instantiate page
using constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
org.apache.wicket.WicketRuntimeException: Can't instantiate page using
constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
... 33 more
Caused by: org.springframework.transaction.CannotCreateTransactionException:
Could not open JDBC Connection for transaction; nested exception is
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
failure

On Thu, May 15, 2008 at 1:25 PM, Johan Compagner [EMAIL PROTECTED]
wrote:

 do you have more stacktrace like Cause : x

 On Thu, May 15, 2008 at 11:22 AM, Sergey Podatelev 
 [EMAIL PROTECTED] wrote:

  Hello,
 
  I have a custom error 

Re: Scheduler in wicket

2008-05-15 Thread Cristi Manole
quartz, definitely... do look into spring + quartz. excellent control.

Cristi

On Thu, May 15, 2008 at 1:51 PM, Jan Kriesten [EMAIL PROTECTED]
wrote:


 hi,

  I am planning to use quartz, but before starting to integrate it in my
 wicket's app i would like to know if anybody have used it or another
 scheduler with
 wicket.


 quartz is a good choice - it just works (tm).

 best regards, --- jan.




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




Re: ErrorPage won't render

2008-05-15 Thread Johan Compagner
ok somehow spring does something
Caused by: org.springframework.transaction.CannotCreateTransactionException:
Could not open JDBC Connection for transaction; nested exception is
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link

So are you using some spring thing there?


On Thu, May 15, 2008 at 1:22 PM, Sergey Podatelev 
[EMAIL PROTECTED] wrote:

 The default stacktrace is listed below.

 Apparently, the error page won't load for the same reason original page
 wasn't loaded: Spring (which I also use) wants a Connection even for a page
 that does not require any database interaction. This question is also
 bothering me, and although this is a Spring issue, perhaps someone of
 Wicket
 people could answer me since there so much examples of integration of
 Wicket
 and Spring.

 unexpected exception when handling another exception: Can't instantiate
 page
 using constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
 at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
at

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

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

 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at

 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at

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

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at

 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at

 org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at

 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at
 org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at

 org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at

 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at

 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
at

 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at

 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
... 33 more
 Caused by:
 

Re: after render using a behavior vs. override in the component

2008-05-15 Thread Johan Compagner
use a behavior that adds an onDocumentLoad/Ready script to the browser

On Thu, May 15, 2008 at 12:35 PM, Eyal Golan [EMAIL PROTECTED] wrote:

 Hello,
 I have a MyButton that extends Button.
 I have a JavaScript that I need to ad to the output markup after the
 button's markup.
 I'm trying to do this with two differnet options:
 Either I Override onAfterRender in MyButton:
@Override
protected void onAfterRender() {
if (isVisible()) {
getResponse().write(Consts.getResizeScript(getMarkupId()));
}
super.onAfterRender();
}

 Or, I add to the button a behavior and write this:
@Override
public void onRendered(Component component) {
if (component.isVisible()) {


 component.getResponse().write(Consts.getResizeScript(component.getMarkupId()));
}

}

 Now, the situation is like this:
 Using the first option (override in the component), the script is added to
 the end of the html. Just after the /html
 Using the second option (the behavior), the script is added just after the
 close tag of the button /button.

 Using FF, all is ok, but in IE7, there's a problem in calculating the size
 and the button is not shown correctly.

 What causes the differences? and how can I manipulate the behavior to work
 like option 1 ?

 Thanks very much...

 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/



using wicket to create dynamic chart

2008-05-15 Thread emee

Hello ,

I would like to use wicket to create a dynamic chart, I mean the values of
my chart change in the time. I use googleChart to create my chart but it is
a static chart and  all the example I have with wicket to create static
chart any idea how I can create a dynamic chart by using wicket ? 

Thank you  

-- 
View this message in context: 
http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17251826.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: using wicket to create dynamic chart

2008-05-15 Thread Eyal Golan
have you checked out JFreeChart ?
Is not dynamic as a progress bar, but dynamic as the info changes.

On Thu, May 15, 2008 at 3:12 PM, emee [EMAIL PROTECTED] wrote:


 Hello ,

 I would like to use wicket to create a dynamic chart, I mean the values of
 my chart change in the time. I use googleChart to create my chart but it is
 a static chart and  all the example I have with wicket to create static
 chart any idea how I can create a dynamic chart by using wicket ?

 Thank you

 --
 View this message in context:
 http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17251826.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: after render using a behavior vs. override in the component

2008-05-15 Thread Eyal Golan
ok. thank, I'll try it (though I have never written JavaScript till a few
days ago...)
BTW, why is the difference between the overriding method and the behavior
method?

On Thu, May 15, 2008 at 2:52 PM, Johan Compagner [EMAIL PROTECTED]
wrote:

 use a behavior that adds an onDocumentLoad/Ready script to the browser

 On Thu, May 15, 2008 at 12:35 PM, Eyal Golan [EMAIL PROTECTED] wrote:

  Hello,
  I have a MyButton that extends Button.
  I have a JavaScript that I need to ad to the output markup after the
  button's markup.
  I'm trying to do this with two differnet options:
  Either I Override onAfterRender in MyButton:
 @Override
 protected void onAfterRender() {
 if (isVisible()) {
 getResponse().write(Consts.getResizeScript(getMarkupId()));
 }
 super.onAfterRender();
 }
 
  Or, I add to the button a behavior and write this:
 @Override
 public void onRendered(Component component) {
 if (component.isVisible()) {
 
 
 
 component.getResponse().write(Consts.getResizeScript(component.getMarkupId()));
 }
 
 }
 
  Now, the situation is like this:
  Using the first option (override in the component), the script is added
 to
  the end of the html. Just after the /html
  Using the second option (the behavior), the script is added just after
 the
  close tag of the button /button.
 
  Using FF, all is ok, but in IE7, there's a problem in calculating the
 size
  and the button is not shown correctly.
 
  What causes the differences? and how can I manipulate the behavior to
 work
  like option 1 ?
 
  Thanks very much...
 
  --
  Eyal Golan
  [EMAIL PROTECTED]
 
  Visit: http://jvdrums.sourceforge.net/
 




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: after render using a behavior vs. override in the component

2008-05-15 Thread Johan Compagner
you can also do it on component
public void renderHead(final HtmlHeaderContainer container)

or let the component implement IHeaderContributor

i guess that renderHead(final HtmlHeaderContainer container) shouldnt be
public but more protected or final..

johan


On Thu, May 15, 2008 at 2:44 PM, Eyal Golan [EMAIL PROTECTED] wrote:

 ok. thank, I'll try it (though I have never written JavaScript till a few
 days ago...)
 BTW, why is the difference between the overriding method and the behavior
 method?

 On Thu, May 15, 2008 at 2:52 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

  use a behavior that adds an onDocumentLoad/Ready script to the browser
 
  On Thu, May 15, 2008 at 12:35 PM, Eyal Golan [EMAIL PROTECTED] wrote:
 
   Hello,
   I have a MyButton that extends Button.
   I have a JavaScript that I need to ad to the output markup after the
   button's markup.
   I'm trying to do this with two differnet options:
   Either I Override onAfterRender in MyButton:
  @Override
  protected void onAfterRender() {
  if (isVisible()) {
  getResponse().write(Consts.getResizeScript(getMarkupId()));
  }
  super.onAfterRender();
  }
  
   Or, I add to the button a behavior and write this:
  @Override
  public void onRendered(Component component) {
  if (component.isVisible()) {
  
  
  
 
 component.getResponse().write(Consts.getResizeScript(component.getMarkupId()));
  }
  
  }
  
   Now, the situation is like this:
   Using the first option (override in the component), the script is added
  to
   the end of the html. Just after the /html
   Using the second option (the behavior), the script is added just after
  the
   close tag of the button /button.
  
   Using FF, all is ok, but in IE7, there's a problem in calculating the
  size
   and the button is not shown correctly.
  
   What causes the differences? and how can I manipulate the behavior to
  work
   like option 1 ?
  
   Thanks very much...
  
   --
   Eyal Golan
   [EMAIL PROTECTED]
  
   Visit: http://jvdrums.sourceforge.net/
  
 



 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/



Re: after render using a behavior vs. override in the component

2008-05-15 Thread Eyal Golan
thanks,
that's exactly what I did.
I add to my component (button) an AbstarctBehavior, which is an
IHeaderContributor.
I even override renderHead:
@Override
public void renderHead(IHeaderResponse response) {

response.renderCSSReference(/eurekify/style/button/EurekifyButton.css);

response.renderJavascriptReference(/eurekify/style/button/EurekifyButton.js);
//response.renderJavascriptReference(new
JavascriptResourceReference(
//EurekifyButtonBehavior.class, resizeScript.js));
}

The script I am adding to each button comes from a utility class:
static String getResizeScript(String markupId) {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(script language=\javascript\);
strBuilder.append(document.getElementById('btnObj_);
strBuilder.append(markupId);
strBuilder.append(').style.width = calcBtnSize(');
strBuilder.append(markupId).append('));
strBuilder.append(/script);
return strBuilder.toString();
}

This is the script that I mentioned in my first question.

Again:
If I call this script in the Button class, in the onAfterRender() method, it
is added to the end of the output HTML.
If I call this in the behavior, in the onRendered(Component component), it
is added just after the /button.

I did something like this in the onload script:
window.onload = function(id) {
  document.getElementById('btnObj_'+id).style.width =  function(id)
{calcBtnSize(id)};
}

firebug says that it can't find document.getElementById('btnObj_'+id) ...
On Thu, May 15, 2008 at 3:50 PM, Johan Compagner [EMAIL PROTECTED]
wrote:

 you can also do it on component
 public void renderHead(final HtmlHeaderContainer container)

 or let the component implement IHeaderContributor

 i guess that renderHead(final HtmlHeaderContainer container) shouldnt be
 public but more protected or final..

 johan


 On Thu, May 15, 2008 at 2:44 PM, Eyal Golan [EMAIL PROTECTED] wrote:

  ok. thank, I'll try it (though I have never written JavaScript till a few
  days ago...)
  BTW, why is the difference between the overriding method and the behavior
  method?
 
  On Thu, May 15, 2008 at 2:52 PM, Johan Compagner [EMAIL PROTECTED]
  wrote:
 
   use a behavior that adds an onDocumentLoad/Ready script to the browser
  
   On Thu, May 15, 2008 at 12:35 PM, Eyal Golan [EMAIL PROTECTED]
 wrote:
  
Hello,
I have a MyButton that extends Button.
I have a JavaScript that I need to ad to the output markup after the
button's markup.
I'm trying to do this with two differnet options:
Either I Override onAfterRender in MyButton:
   @Override
   protected void onAfterRender() {
   if (isVisible()) {
   
  getResponse().write(Consts.getResizeScript(getMarkupId()));
   }
   super.onAfterRender();
   }
   
Or, I add to the button a behavior and write this:
   @Override
   public void onRendered(Component component) {
   if (component.isVisible()) {
   
   
   
  
 
 component.getResponse().write(Consts.getResizeScript(component.getMarkupId()));
   }
   
   }
   
Now, the situation is like this:
Using the first option (override in the component), the script is
 added
   to
the end of the html. Just after the /html
Using the second option (the behavior), the script is added just
 after
   the
close tag of the button /button.
   
Using FF, all is ok, but in IE7, there's a problem in calculating the
   size
and the button is not shown correctly.
   
What causes the differences? and how can I manipulate the behavior to
   work
like option 1 ?
   
Thanks very much...
   
--
Eyal Golan
[EMAIL PROTECTED]
   
Visit: http://jvdrums.sourceforge.net/
   
  
 
 
 
  --
  Eyal Golan
  [EMAIL PROTECTED]
 
  Visit: http://jvdrums.sourceforge.net/
 




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: ErrorPage won't render

2008-05-15 Thread Sergey Podatelev
Yes, as I said in the previous message, I use SpringWebApplicationFactory.
The problem, apparently, is that Spring wants to have a working database
connection even when Wicket renders pages that doesn't access database in
any way.

Can Wicket handle a runtime exception like this?


On Thu, May 15, 2008 at 3:46 PM, Johan Compagner [EMAIL PROTECTED]
wrote:

 ok somehow spring does something
 Caused by:
 org.springframework.transaction.CannotCreateTransactionException:
 Could not open JDBC Connection for transaction; nested exception is
 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
 link

 So are you using some spring thing there?


 On Thu, May 15, 2008 at 1:22 PM, Sergey Podatelev 
 [EMAIL PROTECTED] wrote:

  The default stacktrace is listed below.
 
  Apparently, the error page won't load for the same reason original page
  wasn't loaded: Spring (which I also use) wants a Connection even for a
 page
  that does not require any database interaction. This question is also
  bothering me, and although this is a Spring issue, perhaps someone of
  Wicket
  people could answer me since there so much examples of integration of
  Wicket
  and Spring.
 
  unexpected exception when handling another exception: Can't instantiate
  page
  using constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
  org.apache.wicket.WicketRuntimeException: Can't instantiate page using
  constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
  at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
 at
 
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
 at
 
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
 at
 
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
 at
 
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
 at
 
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
 at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
 at
  org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
 at
 
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
 at
 
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at
 
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 
 
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
 at
 
 
 org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
 at
 
 
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
 at
 
 org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
 at
 
 
 org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
 at
 
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at
 
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 
 
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
 at
 
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at
 
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at
 
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at
 
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at
 
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at
 
 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
 at
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at
 
 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Thread.java:619)
  Caused by: java.lang.reflect.InvocationTargetException
 at 

Swarm: Link authorization

2008-05-15 Thread Andrea Jahn


Hi,

for every item in a table there's a delete link, which should be only visible 
for certain users.

ProductAreaListPage.html:
-

tr wicket:id=productAreaTable class=list
 tdspan wicket:id=id[id]/span/td
 tdspan wicket:id=name[name]/span/td
 tdspan wicket:id=description[description]/span/td
 tda wicket:id=editProductAreaEdithellip;/a/td
 tda wicket:id=adminProductsProductshellip;/a/td
 tda wicket:id=deleteProductAreaDeletehellip;/a/td
/tr

I created a class for the secure link:
---

public abstract class SecureLink extends Link implements ISecureComponent
{
 private static final long serialVersionUID = 1L;

 public SecureLink(String id, Class c)
 {
 super(id);
 setSecurityCheck(new LinkSecurityCheck(this, c));
 }

 public ISecurityCheck getSecurityCheck()
 {
 return SecureComponentHelper.getSecurityCheck(this);
 }

 public boolean isActionAuthorized(String waspAction)
 {
 return SecureComponentHelper.isActionAuthorized(this, waspAction);
 }

 public boolean isActionAuthorized(WaspAction action)
 {
 return SecureComponentHelper.isActionAuthorized(this, action);
 }

 public boolean isAuthenticated()
 {
 return SecureComponentHelper.isAuthenticated(this);
 }

 public void setSecurityCheck(ISecurityCheck check)
 {
 SecureComponentHelper.setSecurityCheck(this, check);
 }
} 

First I tried to use the ComponentSecurityCheck, because I have no real click 
target ( I used ProductAreaListPage.class as parameter in the constructor as 
dummy). Because the LinkSecurityCheck behaves as ClassSecurityCheck per 
default, I called setUseAlternativeRenderCheck to change to 
ComponentSecurityCheck.


ProductAreaListPage.java:
-
private class ProductAreaVisibleDataView extends ProductAreaDataView
{
 public ProductAreaVisibleDataView(String id, IDataProvider dataProvider) {
 super(id, dataProvider);
 }
 
 protected void populateItem(final Item item) {
 super.populateItem(item);
 final ProductArea productArea = (ProductArea) item.getModelObject();
 
 SecureLink deleteLink = new SecureLink(deleteProductArea, 
ProductAreaListPage.class) {
 private static final long serialVersionUID = 1L;

 public void onClick() {
 if (productArea.getDeleted())
 return;
 
 productArea.setDeleted(true);
 productAreaService.save(productArea);
 invalidateDataProviders();
 }
 }; 
 
((LinkSecurityCheck)deleteLink.getSecurityCheck()).setUseAlternativeRenderCheck(true);
 item.add(deleteLink);
 }
 }

 

Because the wicket id deleteProductArea exists for each item in the list, my 
policy file would need such permission for each item. This is no real solution, 
because I don't know, how many items the list will contain (But it worked in 
the example for the first 4 items).
 

Appl.hive:

// Product area list page - Delete link
permission ${ComponentPermission} 
${front}.ProductAreaListPage:resultPanel:productAreaTable:1:deleteProductArea,
 inherit, render;
permission ${ComponentPermission} 
${front}.ProductAreaListPage:resultPanel:productAreaTable:2:deleteProductArea,
 inherit, render;
permission ${ComponentPermission} 
${front}.ProductAreaListPage:resultPanel:productAreaTable:3:deleteProductArea,
 inherit, render;
permission ${ComponentPermission} 
${front}.ProductAreaListPage:resultPanel:productAreaTable:4:deleteProductArea,
 inherit, render;


So I tried to change to use the ClassSecurityCheck. There the user must have 
rights for the target class. I created a dummy class:

ClickTargetDummy.java:
--*

*package xxx.yyy.zzz.front.security;

public class ClickTargetDummy
{
}

ProductAreaListPage.java:
-

SecureLink deleteLink = new SecureLink(deleteProductArea, 
ClickTargetDummy.class) {
private static final long serialVersionUID = 1L;

public void onClick() {
 if (productArea.getDeleted())
 return;
 
 productArea.setDeleted(true);
 productAreaService.save(productArea);
 invalidateDataProviders();
}
}; 

Appl.hive:
-
permission ${ComponentPermission} ${front}.security.ClickTargetDummy, 
inherit, render, enable;

 

This solution works, but I have to create the dummy class. Perhaps other 
solutions are possible ???

Thanks in advance
Andrea

 

 

 



Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
*http://smartsurfer.web.de/?mc=100071distributionid=0066* 
[http://smartsurfer.web.de/?mc=100071distributionid=0066] 


wicket xml - add label as xml element atribute

2008-05-15 Thread Milan Křápek
Hi, 
 I want to generate XML document using wicket but I have this problem.

I want to generate something like

root
  var name=a1/
  var name=a2/
  var name=a3/
 
  otherStructure/
/root

I decided to generate the var elements by ListView. This has some problem, 
because after rendering I have in my XML document 
some span wicket:id=...  elements that I cannot have there.

After some investigation and removing wicket dependent markups by 
  getMarkupSettings().setStripWicketTags(true); and setRenderBodyOnly(true);

 I get this XML code:

?xml version=1.0 encoding=UTF-8?
root
  wicket:container wicket:id=vars
span wicket:id=var/
  /wicket:container
/root

where vars is my ListView that add Label var that contains string s = var 
name=\ + String varName + \ /.
I thought this should work, but wicket encode '' and '' as lt; gt; that is 
not valid XML.

All I need is to say wicket to do not encode this characters. Any Idea??

The second idea I have was to do something like :

?xml version=1.0 encoding=UTF-8?
root
  wicket:container wicket:id=vars
var wicket:message=name:myLabel/
  /wicket:container
/root

But it has some problem too. I know how to give to wicket:message attribute 
some value from my properties file, but is there any way to add there a Label??

Thanks for any halp. I did not say that there cannot be any other way how to do 
it, but I have not found it.

Please help. This is very urgent and blokable for me. If I did not find the way 
how to do it I will have to look up for some another presentation layer. That 
will be very bad, because except this I found Wicket great.

Sorry for my English.

Milan


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



Re: after render using a behavior vs. override in the component

2008-05-15 Thread Johan Compagner
get the components markupid from the component itself.

johan


On Thu, May 15, 2008 at 3:03 PM, Eyal Golan [EMAIL PROTECTED] wrote:

 thanks,
 that's exactly what I did.
 I add to my component (button) an AbstarctBehavior, which is an
 IHeaderContributor.
 I even override renderHead:
@Override
public void renderHead(IHeaderResponse response) {

 response.renderCSSReference(/eurekify/style/button/EurekifyButton.css);


 response.renderJavascriptReference(/eurekify/style/button/EurekifyButton.js);
 //response.renderJavascriptReference(new
 JavascriptResourceReference(
 //EurekifyButtonBehavior.class, resizeScript.js));
}

 The script I am adding to each button comes from a utility class:
static String getResizeScript(String markupId) {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(script language=\javascript\);
strBuilder.append(document.getElementById('btnObj_);
strBuilder.append(markupId);
strBuilder.append(').style.width = calcBtnSize(');
strBuilder.append(markupId).append('));
strBuilder.append(/script);
return strBuilder.toString();
}

 This is the script that I mentioned in my first question.

 Again:
 If I call this script in the Button class, in the onAfterRender() method,
 it
 is added to the end of the output HTML.
 If I call this in the behavior, in the onRendered(Component component), it
 is added just after the /button.

 I did something like this in the onload script:
 window.onload = function(id) {
  document.getElementById('btnObj_'+id).style.width =  function(id)
 {calcBtnSize(id)};
 }

 firebug says that it can't find document.getElementById('btnObj_'+id) ...
 On Thu, May 15, 2008 at 3:50 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

  you can also do it on component
  public void renderHead(final HtmlHeaderContainer container)
 
  or let the component implement IHeaderContributor
 
  i guess that renderHead(final HtmlHeaderContainer container) shouldnt be
  public but more protected or final..
 
  johan
 
 
  On Thu, May 15, 2008 at 2:44 PM, Eyal Golan [EMAIL PROTECTED] wrote:
 
   ok. thank, I'll try it (though I have never written JavaScript till a
 few
   days ago...)
   BTW, why is the difference between the overriding method and the
 behavior
   method?
  
   On Thu, May 15, 2008 at 2:52 PM, Johan Compagner [EMAIL PROTECTED]
 
   wrote:
  
use a behavior that adds an onDocumentLoad/Ready script to the
 browser
   
On Thu, May 15, 2008 at 12:35 PM, Eyal Golan [EMAIL PROTECTED]
  wrote:
   
 Hello,
 I have a MyButton that extends Button.
 I have a JavaScript that I need to ad to the output markup after
 the
 button's markup.
 I'm trying to do this with two differnet options:
 Either I Override onAfterRender in MyButton:
@Override
protected void onAfterRender() {
if (isVisible()) {

   getResponse().write(Consts.getResizeScript(getMarkupId()));
}
super.onAfterRender();
}

 Or, I add to the button a behavior and write this:
@Override
public void onRendered(Component component) {
if (component.isVisible()) {



   
  
 
 component.getResponse().write(Consts.getResizeScript(component.getMarkupId()));
}

}

 Now, the situation is like this:
 Using the first option (override in the component), the script is
  added
to
 the end of the html. Just after the /html
 Using the second option (the behavior), the script is added just
  after
the
 close tag of the button /button.

 Using FF, all is ok, but in IE7, there's a problem in calculating
 the
size
 and the button is not shown correctly.

 What causes the differences? and how can I manipulate the behavior
 to
work
 like option 1 ?

 Thanks very much...

 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/

   
  
  
  
   --
   Eyal Golan
   [EMAIL PROTECTED]
  
   Visit: http://jvdrums.sourceforge.net/
  
 



 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/



Re: wicket xml - add label as xml element atribute

2008-05-15 Thread Michael Sparer

I generated my sitemap xml files using wicket, the xml is something like:

?xml version=1.0 encoding=UTF-8?
urlset xmlns=http://www.sitemaps.org/schemas/sitemap/0.9;
   url wicket:id=urlList
  loc wicket:id=locNodehttp://www.example.com//loc
  lastmod wicket:id=lastmodNode2005-01-01/lastmod
  changefreq wicket:id=changefreqNodemonthly/changefreq
  priority wicket:id=priorityNode0.8/priority
   /url
/urlset 

be sure to name the markup file .xml and to override 

@Override
public String getMarkupType() {
return xml;
}

in your page ... that should work

Milan Křápek wrote:
 
 Hi, 
  I want to generate XML document using wicket but I have this problem.
 
 I want to generate something like
 
 root
   var name=a1/
   var name=a2/
   var name=a3/
  
   otherStructure/
 /root
 
 I decided to generate the var elements by ListView. This has some
 problem, because after rendering I have in my XML document 
 some   elements that I cannot have there.
 
 After some investigation and removing wicket dependent markups by 
   getMarkupSettings().setStripWicketTags(true); and
 setRenderBodyOnly(true);
 
  I get this XML code:
 
 ?xml version=1.0 encoding=UTF-8?
 root
   wicket:container wicket:id=vars
 
   /wicket:container
 /root
 
 where vars is my ListView that add Label var that contains string s =
 var name=\ + String varName + \ /.
 I thought this should work, but wicket encode '' and '' as lt; gt;
 that is not valid XML.
 
 All I need is to say wicket to do not encode this characters. Any Idea??
 
 The second idea I have was to do something like :
 
 ?xml version=1.0 encoding=UTF-8?
 root
   wicket:container wicket:id=vars
 var wicket:message=name:myLabel/
   /wicket:container
 /root
 
 But it has some problem too. I know how to give to wicket:message
 attribute some value from my properties file, but is there any way to add
 there a Label??
 
 Thanks for any halp. I did not say that there cannot be any other way how
 to do it, but I have not found it.
 
 Please help. This is very urgent and blokable for me. If I did not find
 the way how to do it I will have to look up for some another presentation
 layer. That will be very bad, because except this I found Wicket great.
 
 Sorry for my English.
 
 Milan
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/wicket-xml---add-label-as-xml-element-atribute-tp17253179p17253615.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: ErrorPage won't render

2008-05-15 Thread Johan Compagner
why should wicket handle exceptions like that, what kind? what should wicket
do then?

you should just be sure that you always can create an error page, we cant
help if that bombs out.

johan


On Thu, May 15, 2008 at 3:18 PM, Sergey Podatelev 
[EMAIL PROTECTED] wrote:

 Yes, as I said in the previous message, I use SpringWebApplicationFactory.
 The problem, apparently, is that Spring wants to have a working database
 connection even when Wicket renders pages that doesn't access database in
 any way.

 Can Wicket handle a runtime exception like this?


 On Thu, May 15, 2008 at 3:46 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

  ok somehow spring does something
  Caused by:
  org.springframework.transaction.CannotCreateTransactionException:
  Could not open JDBC Connection for transaction; nested exception is
  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
  link
 
  So are you using some spring thing there?
 
 
  On Thu, May 15, 2008 at 1:22 PM, Sergey Podatelev 
  [EMAIL PROTECTED] wrote:
 
   The default stacktrace is listed below.
  
   Apparently, the error page won't load for the same reason original page
   wasn't loaded: Spring (which I also use) wants a Connection even for a
  page
   that does not require any database interaction. This question is also
   bothering me, and although this is a Spring issue, perhaps someone of
   Wicket
   people could answer me since there so much examples of integration of
   Wicket
   and Spring.
  
   unexpected exception when handling another exception: Can't instantiate
   page
   using constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
   org.apache.wicket.WicketRuntimeException: Can't instantiate page using
   constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
   at
  
  
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
  at
  
  
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
  at
  
  
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
  at
  
  
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
  at
  
  
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
  at
  
  
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
  at
 org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
  at
  
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
  at
  
  
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
  
  
 
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
  at
  
  
 
 org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
  at
  
  
 
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at
  
 
 org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
  at
  
  
 
 org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
  
  
 
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
  
  
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at
  
  
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  at
  
  
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  at
  
  
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at
  
  
 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at
  
 
 

Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread richardwilko

Ok, I've been playing around a bit more, and it turns out that this is not
limited to when I do clustering with terrracotta, but happens when i run
jetty normally.

The page expired exception fires with this message 

Cannot find the rendered page in session
[pagemap=null,componentPath=60:yellAdTop,versionNumber=0]

as i understand it pagemapname=null is just the default page map, so that
shouldnt be a problem.  Im still at a loss as to why this happens though.




Johan Compagner wrote:
 
 look at setAttribute then for the store
 It should be but into the session in the detach of the request.
 
 On Thu, May 15, 2008 at 12:30 PM, richardwilko 
 [EMAIL PROTECTED] wrote:
 

 I still get the same behaviour with the httpsessionstore.

 the problem seems to be that the page isnt put in the page map, so when
 the
 ajax call is made to lazy load the panel it cant access the page its on.

 looking at the http session data in the terracotta admin console i see
 that
 the AccessStackPageMap has a page map name set to null, and i cant find
 the
 page i should be on in the httpsession.



 if you use terracotta you shouldnt use the default DiskPageStore i
 believe
 but revert back to the 1.2 httpsessionstore..


 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17250260.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17253801.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Swarm: Link authorization

2008-05-15 Thread Maurice Marrink
Yes there are other solutions :)

In this case you would use a DataPermission.
Something like
permission ${DataPermission} delete_product, enable;
coupled with a DatasecurityCheck on your links  like so:
setSecurityCheck(new DataSecurityCheck(delete_product));
will do the trick.

Maurice

On Thu, May 15, 2008 at 3:22 PM, Andrea Jahn [EMAIL PROTECTED] wrote:


 Hi,

 for every item in a table there's a delete link, which should be only 
 visible for certain users.

 ProductAreaListPage.html:
 -

 tr wicket:id=productAreaTable class=list
  tdspan wicket:id=id[id]/span/td
  tdspan wicket:id=name[name]/span/td
  tdspan wicket:id=description[description]/span/td
  tda wicket:id=editProductAreaEdithellip;/a/td
  tda wicket:id=adminProductsProductshellip;/a/td
  tda wicket:id=deleteProductAreaDeletehellip;/a/td
 /tr

 I created a class for the secure link:
 ---

 public abstract class SecureLink extends Link implements ISecureComponent
 {
  private static final long serialVersionUID = 1L;

  public SecureLink(String id, Class c)
  {
  super(id);
  setSecurityCheck(new LinkSecurityCheck(this, c));
  }

  public ISecurityCheck getSecurityCheck()
  {
  return SecureComponentHelper.getSecurityCheck(this);
  }

  public boolean isActionAuthorized(String waspAction)
  {
  return SecureComponentHelper.isActionAuthorized(this, waspAction);
  }

  public boolean isActionAuthorized(WaspAction action)
  {
  return SecureComponentHelper.isActionAuthorized(this, action);
  }

  public boolean isAuthenticated()
  {
  return SecureComponentHelper.isAuthenticated(this);
  }

  public void setSecurityCheck(ISecurityCheck check)
  {
  SecureComponentHelper.setSecurityCheck(this, check);
  }
 }

 First I tried to use the ComponentSecurityCheck, because I have no real click 
 target ( I used ProductAreaListPage.class as parameter in the constructor as 
 dummy). Because the LinkSecurityCheck behaves as ClassSecurityCheck per 
 default, I called setUseAlternativeRenderCheck to change to 
 ComponentSecurityCheck.


 ProductAreaListPage.java:
 -
 private class ProductAreaVisibleDataView extends ProductAreaDataView
 {
  public ProductAreaVisibleDataView(String id, IDataProvider dataProvider) {
  super(id, dataProvider);
  }

  protected void populateItem(final Item item) {
  super.populateItem(item);
  final ProductArea productArea = (ProductArea) item.getModelObject();

  SecureLink deleteLink = new SecureLink(deleteProductArea, 
 ProductAreaListPage.class) {
  private static final long serialVersionUID = 1L;

  public void onClick() {
  if (productArea.getDeleted())
  return;

  productArea.setDeleted(true);
  productAreaService.save(productArea);
  invalidateDataProviders();
  }
  };
  
 ((LinkSecurityCheck)deleteLink.getSecurityCheck()).setUseAlternativeRenderCheck(true);
  item.add(deleteLink);
  }
  }



 Because the wicket id deleteProductArea exists for each item in the list, my 
 policy file would need such permission for each item. This is no real 
 solution, because I don't know, how many items the list will contain (But it 
 worked in the example for the first 4 items).


 Appl.hive:
 
 // Product area list page - Delete link
 permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultPanel:productAreaTable:1:deleteProductArea,
  inherit, render;
 permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultPanel:productAreaTable:2:deleteProductArea,
  inherit, render;
 permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultPanel:productAreaTable:3:deleteProductArea,
  inherit, render;
 permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultPanel:productAreaTable:4:deleteProductArea,
  inherit, render;


 So I tried to change to use the ClassSecurityCheck. There the user must have 
 rights for the target class. I created a dummy class:

 ClickTargetDummy.java:
 --*

 *package xxx.yyy.zzz.front.security;

 public class ClickTargetDummy
 {
 }

 ProductAreaListPage.java:
 -

 SecureLink deleteLink = new SecureLink(deleteProductArea, 
 ClickTargetDummy.class) {
 private static final long serialVersionUID = 1L;

 public void onClick() {
  if (productArea.getDeleted())
  return;

  productArea.setDeleted(true);
  productAreaService.save(productArea);
  invalidateDataProviders();
 }
 };

 Appl.hive:
 -
 permission ${ComponentPermission} ${front}.security.ClickTargetDummy, 
 inherit, render, enable;



 This solution works, but I have to create the dummy class. Perhaps other 
 solutions are possible ???

 Thanks in advance
 Andrea









 Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
 *http://smartsurfer.web.de/?mc=100071distributionid=0066* 
 [http://smartsurfer.web.de/?mc=100071distributionid=0066]



Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread Johan Compagner
if you dont use terra then you should use the DiskPageStore
with that store getting page expires shouldnt happen as long as the http
session is there.

johan

On Thu, May 15, 2008 at 3:55 PM, richardwilko 
[EMAIL PROTECTED] wrote:


 Ok, I've been playing around a bit more, and it turns out that this is not
 limited to when I do clustering with terrracotta, but happens when i run
 jetty normally.

 The page expired exception fires with this message

 Cannot find the rendered page in session
 [pagemap=null,componentPath=60:yellAdTop,versionNumber=0]

 as i understand it pagemapname=null is just the default page map, so that
 shouldnt be a problem.  Im still at a loss as to why this happens though.




 Johan Compagner wrote:
 
  look at setAttribute then for the store
  It should be but into the session in the detach of the request.
 
  On Thu, May 15, 2008 at 12:30 PM, richardwilko 
  [EMAIL PROTECTED] wrote:
 
 
  I still get the same behaviour with the httpsessionstore.
 
  the problem seems to be that the page isnt put in the page map, so when
  the
  ajax call is made to lazy load the panel it cant access the page its on.
 
  looking at the http session data in the terracotta admin console i see
  that
  the AccessStackPageMap has a page map name set to null, and i cant find
  the
  page i should be on in the httpsession.
 
 
 
  if you use terracotta you shouldnt use the default DiskPageStore i
  believe
  but revert back to the 1.2 httpsessionstore..
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17250260.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17253801.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: wicket xml - add label as xml element atribute

2008-05-15 Thread Milan Křápek
Thanks, 
  the XML code is fine, but I need to know how to do it in the .java file. It 
seems you just use Labels that fill the value of each node. But my problem is 
little bit different. What I want is to be able do set there some attribute.

You have in your XML code:

loc wicket:id=locNodemy.location.com/loc

but I need 

loc url=my.location.com/

And this I have givven by DTD so I cannot have there any wicket:id. And I need 
to pass the value to attribute and not as text value in the loc element. 

So I think I cannot use your method :o(

Best regards

Milan

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



Re: ErrorPage won't render

2008-05-15 Thread Maurice Marrink
On a side note:
Don't forget to overwrite isErrorPage() to return true.

Maurice

On Thu, May 15, 2008 at 3:46 PM, Johan Compagner [EMAIL PROTECTED] wrote:
 why should wicket handle exceptions like that, what kind? what should wicket
 do then?

 you should just be sure that you always can create an error page, we cant
 help if that bombs out.

 johan


 On Thu, May 15, 2008 at 3:18 PM, Sergey Podatelev 
 [EMAIL PROTECTED] wrote:

 Yes, as I said in the previous message, I use SpringWebApplicationFactory.
 The problem, apparently, is that Spring wants to have a working database
 connection even when Wicket renders pages that doesn't access database in
 any way.

 Can Wicket handle a runtime exception like this?


 On Thu, May 15, 2008 at 3:46 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

  ok somehow spring does something
  Caused by:
  org.springframework.transaction.CannotCreateTransactionException:
  Could not open JDBC Connection for transaction; nested exception is
  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
  link
 
  So are you using some spring thing there?
 
 
  On Thu, May 15, 2008 at 1:22 PM, Sergey Podatelev 
  [EMAIL PROTECTED] wrote:
 
   The default stacktrace is listed below.
  
   Apparently, the error page won't load for the same reason original page
   wasn't loaded: Spring (which I also use) wants a Connection even for a
  page
   that does not require any database interaction. This question is also
   bothering me, and although this is a Spring issue, perhaps someone of
   Wicket
   people could answer me since there so much examples of integration of
   Wicket
   and Spring.
  
   unexpected exception when handling another exception: Can't instantiate
   page
   using constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
   org.apache.wicket.WicketRuntimeException: Can't instantiate page using
   constructor public ru.vrgraphics.lianet.web.page.BaseErrorPage()
   at
  
  
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168)
  at
  
  
 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58)
  at
  
  
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262)
  at
  
  
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283)
  at
  
  
 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
  at
  
  
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
  at
 org.apache.wicket.RequestCycle.respond(RequestCycle.java:1181)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1248)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
  at
  
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
  at
  
  
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
  
  
 
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
  at
  
  
 
 org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
  at
  
  
 
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at
  
 
 org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
  at
  
  
 
 org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
  
  
 
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
  
  
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
  
  
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at
  
  
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  at
  
  
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  at
  
  
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  

Re: wicket xml - add label as xml element atribute

2008-05-15 Thread Maurice Marrink
You can use
 setEscapeModelStrings(false) to not escape special characters.
 attributemodifiers to add attributes to tags or use onComponentTag for this

Maurice

On Thu, May 15, 2008 at 4:05 PM, Milan Křápek [EMAIL PROTECTED] wrote:
 Thanks,
  the XML code is fine, but I need to know how to do it in the .java file. It 
 seems you just use Labels that fill the value of each node. But my problem is 
 little bit different. What I want is to be able do set there some attribute.

 You have in your XML code:

 loc wicket:id=locNodemy.location.com/loc

 but I need

 loc url=my.location.com/

 And this I have givven by DTD so I cannot have there any wicket:id. And I 
 need to pass the value to attribute and not as text value in the loc 
 element.

 So I think I cannot use your method :o(

 Best regards

 Milan

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




Re: wicket xml - add label as xml element atribute

2008-05-15 Thread Michael Sparer

i see, try the following:

WebComponent comp = new WebComponent(locNode);
comp.add(new AttributeModifier(url, true, new Model(mylocation.com));
add(comp);

with the markup eg. loc wicket:id=url / 

that should work

Milan Křápek wrote:
 
 Thanks, 
   the XML code is fine, but I need to know how to do it in the .java file.
 It seems you just use Labels that fill the value of each node. But my
 problem is little bit different. What I want is to be able do set there
 some attribute.
 
 You have in your XML code:
 
 loc wicket:id=locNodemy.location.com/loc
 
 but I need 
 
 loc url=my.location.com/
 
 And this I have givven by DTD so I cannot have there any wicket:id. And I
 need to pass the value to attribute and not as text value in the loc
 element. 
 
 So I think I cannot use your method :o(
 
 Best regards
 
 Milan
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/wicket-xml---add-label-as-xml-element-atribute-tp17253179p17254329.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Peter Ertl

this one will do:

public X extends Component? void foo(ClassX clazz);

however, the subtle differences between this and igors version are  
really hard to get.




Am 15.05.2008 um 16:31 schrieb Igor Vaynberg:

this is the usecase we are talking about. i get a compile error,  
which sucks.


public class Test
{
   public static void main(String[] args)
   {
   Foo foo = new FooImpl();
   foo.foo(IntegerComponent.class); // ok
   foo.foo(Component.class); // compile error
   }

   public static class ComponentT {}
   public static class IntegerComponent extends ComponentInteger {}

   public static interface Foo
   {
   public void foo(Class ? extends Component ?  clazz);
   }

   public static class FooImpl implements Foo
   {
   public void foo(Class ? extends Component ?  clazz) {}
   }
}

-igor

On Wed, May 14, 2008 at 11:56 PM, Sebastiaan van Erk
[EMAIL PROTECTED] wrote:

Igor Vaynberg wrote:


well, apparently johan ran into a situation where component? is  
too

restrictive...


As I understand it, Johan ran into a situation where Component?  
causes
*warnings* for users who use raw types. Which I've been arguing all  
along
that they SHOULD get: they should use ComponentObject or  
ComponentVoid

instead of raw types, or live-with/suppress the warning.

To make it clear, I made the following test class:

public class TestT {

  public void doTest(Test? extends Test? test) {
  System.out.println(test);
  }

  public static void main(String[] args) {
  TestTestInteger test1 = newInstance(); // fine - no
warnings.
  TestTest test2 = newInstance(); // not fine, use of  
raw

type, warning
  Test test3 = newInstance(); // not fine, use of raw  
type,

warning

  test1.doTest(test1); // fine - no warnings.
  test1.doTest(test2); // error - generic types don't  
match,

can be fixed by line below
  test1.doTest((Test) test2); // warning - unchecked  
conversion

  test1.doTest(test3); // warning - unchecked conversion
  }

  public static T TestT newInstance() {
  return new TestT();
  }
}

As you can see, there is only one case when you get a compile error  
when
using the ? extends Test? generic type, and that is a case  
where there
is on the user side an incorrect generic type: TestTest. The user  
here
declares he's using generics, but then inserts a raw type of a  
known generic

type - a situation that should not happen.

Regards,
Sebastiaan


-igor


On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk [EMAIL PROTECTED] 


wrote:


Igor Vaynberg wrote:


since then the thread has evolved into whether or not we should  
use ?

extends Component or ? extends Component?

-igor


I don't understand how that changes any of my points. The first is
incorrect
(from a generics point of view) since you're referencing an
unparameterized
generic type.

So the second gives warnings only in code that is not properly
generified...

Regards,
Sebastiaan



On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk
[EMAIL PROTECTED]
wrote:


Igor Vaynberg wrote:

i do like generics. did i ever say otherwise? the problem here  
is that
if we scope something as Class? extends Component then even  
though

you ARE using generics in your code you will still get a warning
because we did not scope the class as Class? extends  
Component?.


on the other hand if we do scope it as Class? extends  
Component?
then you can no longer pass a raw reference when calling the  
function.


But that's exactly the point isn't it? If you're using generics  
then

you
shouldn't be using raw Components anymore...

so we are screwed if we do and we are screwed if we dont, i  
expected

generics to be better.


Well they definitely could have been better (erasure is  
terrible if you

ask
me), but I don't see what's wrong in this case. It warns you if  
you

should
be using a parameterized type but you don't.

And especially if you look at the vote result, I think the  
majority

wants
the generics...


that vote was before we uncovered this issue. we voted on the  
idea of

generics, not on the implementation.


That's true, but I wonder if this issue would change the vote  
much. I

don't
really understand why it's an issue, because you can use  
generified
Components always: ComponentObject if you don't want to  
constrain the

model object, and ComponentVoid if you don't need a model.

The question that started the thread was about  
StringResourceModel

which
was
not yet generified, and in that case, the warning seems to me  
to be
perfectly ok: it just says StringResourceModel should be  
generified.

It's
not a release yet, so that some users who use the current  
snapshot run

into
these kind of warnings which cannot be removed seems to be fine  
to

me...

Regards,
Sebastiaan



-
To unsubscribe, e-mail: [EMAIL 

Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Igor Vaynberg
this is the usecase we are talking about. i get a compile error, which sucks.

public class Test
{
public static void main(String[] args)
{
Foo foo = new FooImpl();
foo.foo(IntegerComponent.class); // ok
foo.foo(Component.class); // compile error
}

public static class ComponentT {}
public static class IntegerComponent extends ComponentInteger {}

public static interface Foo
{
public void foo(Class ? extends Component ?  clazz);
}

public static class FooImpl implements Foo
{
public void foo(Class ? extends Component ?  clazz) {}
}
}

-igor

On Wed, May 14, 2008 at 11:56 PM, Sebastiaan van Erk
[EMAIL PROTECTED] wrote:
 Igor Vaynberg wrote:

 well, apparently johan ran into a situation where component? is too
 restrictive...

 As I understand it, Johan ran into a situation where Component? causes
 *warnings* for users who use raw types. Which I've been arguing all along
 that they SHOULD get: they should use ComponentObject or ComponentVoid
 instead of raw types, or live-with/suppress the warning.

 To make it clear, I made the following test class:

 public class TestT {

public void doTest(Test? extends Test? test) {
System.out.println(test);
}

public static void main(String[] args) {
TestTestInteger test1 = newInstance(); // fine - no
 warnings.
TestTest test2 = newInstance(); // not fine, use of raw
 type, warning
Test test3 = newInstance(); // not fine, use of raw type,
 warning

test1.doTest(test1); // fine - no warnings.
test1.doTest(test2); // error - generic types don't match,
 can be fixed by line below
test1.doTest((Test) test2); // warning - unchecked conversion
test1.doTest(test3); // warning - unchecked conversion
}

public static T TestT newInstance() {
return new TestT();
}
 }

 As you can see, there is only one case when you get a compile error when
 using the ? extends Test? generic type, and that is a case where there
 is on the user side an incorrect generic type: TestTest. The user here
 declares he's using generics, but then inserts a raw type of a known generic
 type - a situation that should not happen.

 Regards,
 Sebastiaan

 -igor


 On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk [EMAIL PROTECTED]
 wrote:

 Igor Vaynberg wrote:

 since then the thread has evolved into whether or not we should use ?
 extends Component or ? extends Component?

 -igor

 I don't understand how that changes any of my points. The first is
 incorrect
 (from a generics point of view) since you're referencing an
 unparameterized
 generic type.

 So the second gives warnings only in code that is not properly
 generified...

 Regards,
 Sebastiaan


 On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk
 [EMAIL PROTECTED]
 wrote:

 Igor Vaynberg wrote:

 i do like generics. did i ever say otherwise? the problem here is that
 if we scope something as Class? extends Component then even though
 you ARE using generics in your code you will still get a warning
 because we did not scope the class as Class? extends Component?.

 on the other hand if we do scope it as Class? extends Component?
 then you can no longer pass a raw reference when calling the function.

 But that's exactly the point isn't it? If you're using generics then
 you
 shouldn't be using raw Components anymore...

 so we are screwed if we do and we are screwed if we dont, i expected
 generics to be better.

 Well they definitely could have been better (erasure is terrible if you
 ask
 me), but I don't see what's wrong in this case. It warns you if you
 should
 be using a parameterized type but you don't.

 And especially if you look at the vote result, I think the majority
 wants
 the generics...

 that vote was before we uncovered this issue. we voted on the idea of
 generics, not on the implementation.

 That's true, but I wonder if this issue would change the vote much. I
 don't
 really understand why it's an issue, because you can use generified
 Components always: ComponentObject if you don't want to constrain the
 model object, and ComponentVoid if you don't need a model.

 The question that started the thread was about StringResourceModel
 which
 was
 not yet generified, and in that case, the warning seems to me to be
 perfectly ok: it just says StringResourceModel should be generified.
 It's
 not a release yet, so that some users who use the current snapshot run
 into
 these kind of warnings which cannot be removed seems to be fine to
 me...

 Regards,
 Sebastiaan


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


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

Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Johan Compagner
yes and those i already came across some in wicket
i changed to ? and suddenly in extentions and/or examples compile errors
all over the place...
then i quickly turn it off again... (for now)

johan


On Thu, May 15, 2008 at 4:31 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 this is the usecase we are talking about. i get a compile error, which
 sucks.

 public class Test
 {
public static void main(String[] args)
{
 Foo foo = new FooImpl();
foo.foo(IntegerComponent.class); // ok
foo.foo(Component.class); // compile error
}

public static class ComponentT {}
public static class IntegerComponent extends ComponentInteger {}

public static interface Foo
{
public void foo(Class ? extends Component ?  clazz);
}

public static class FooImpl implements Foo
{
public void foo(Class ? extends Component ?  clazz) {}
}
 }

 -igor

 On Wed, May 14, 2008 at 11:56 PM, Sebastiaan van Erk
 [EMAIL PROTECTED] wrote:
  Igor Vaynberg wrote:
 
  well, apparently johan ran into a situation where component? is too
  restrictive...
 
  As I understand it, Johan ran into a situation where Component? causes
  *warnings* for users who use raw types. Which I've been arguing all along
  that they SHOULD get: they should use ComponentObject or
 ComponentVoid
  instead of raw types, or live-with/suppress the warning.
 
  To make it clear, I made the following test class:
 
  public class TestT {
 
 public void doTest(Test? extends Test? test) {
 System.out.println(test);
 }
 
 public static void main(String[] args) {
 TestTestInteger test1 = newInstance(); // fine - no
  warnings.
 TestTest test2 = newInstance(); // not fine, use of raw
  type, warning
 Test test3 = newInstance(); // not fine, use of raw type,
  warning
 
 test1.doTest(test1); // fine - no warnings.
 test1.doTest(test2); // error - generic types don't match,
  can be fixed by line below
 test1.doTest((Test) test2); // warning - unchecked
 conversion
 test1.doTest(test3); // warning - unchecked conversion
 }
 
 public static T TestT newInstance() {
 return new TestT();
 }
  }
 
  As you can see, there is only one case when you get a compile error when
  using the ? extends Test? generic type, and that is a case where
 there
  is on the user side an incorrect generic type: TestTest. The user here
  declares he's using generics, but then inserts a raw type of a known
 generic
  type - a situation that should not happen.
 
  Regards,
  Sebastiaan
 
  -igor
 
 
  On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk 
 [EMAIL PROTECTED]
  wrote:
 
  Igor Vaynberg wrote:
 
  since then the thread has evolved into whether or not we should use ?
  extends Component or ? extends Component?
 
  -igor
 
  I don't understand how that changes any of my points. The first is
  incorrect
  (from a generics point of view) since you're referencing an
  unparameterized
  generic type.
 
  So the second gives warnings only in code that is not properly
  generified...
 
  Regards,
  Sebastiaan
 
 
  On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk
  [EMAIL PROTECTED]
  wrote:
 
  Igor Vaynberg wrote:
 
  i do like generics. did i ever say otherwise? the problem here is
 that
  if we scope something as Class? extends Component then even though
  you ARE using generics in your code you will still get a warning
  because we did not scope the class as Class? extends Component?.
 
  on the other hand if we do scope it as Class? extends Component?
  then you can no longer pass a raw reference when calling the
 function.
 
  But that's exactly the point isn't it? If you're using generics then
  you
  shouldn't be using raw Components anymore...
 
  so we are screwed if we do and we are screwed if we dont, i expected
  generics to be better.
 
  Well they definitely could have been better (erasure is terrible if
 you
  ask
  me), but I don't see what's wrong in this case. It warns you if you
  should
  be using a parameterized type but you don't.
 
  And especially if you look at the vote result, I think the majority
  wants
  the generics...
 
  that vote was before we uncovered this issue. we voted on the idea
 of
  generics, not on the implementation.
 
  That's true, but I wonder if this issue would change the vote much. I
  don't
  really understand why it's an issue, because you can use generified
  Components always: ComponentObject if you don't want to constrain
 the
  model object, and ComponentVoid if you don't need a model.
 
  The question that started the thread was about StringResourceModel
  which
  was
  not yet generified, and in that case, the warning seems to me to be
  perfectly ok: it just says StringResourceModel should be generified.
  It's
  not a release yet, so that some users who use the current 

Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread richardwilko

right, non-clustered and httpsessionstore = exceptions
non-clustered and default session store = no exceptions (as far as i can
see)

clustered and httpsessionstore = exceptions
clustered and default session store = exceptions


although our live site is running on a httpsessionstore (non clustered) and
does not have these same problems.

The only thing that's changes is that i upgraded from wicket 1.3.0 to 1.3.3
(for clustering support) and some slight changes to the page which breaks -
but nothing that should be causing these errors, the lazy load panel is the
same.

ive also tried wicket 1.3.2 and get same errors.

But I still cant work out why on one page all my ajax works fine regardless
of session store or clustering and on a different page the ajax causes page
expired exceptions.






Johan Compagner wrote:
 
 if you dont use terra then you should use the DiskPageStore
 with that store getting page expires shouldnt happen as long as the http
 session is there.
 
 johan
 
 On Thu, May 15, 2008 at 3:55 PM, richardwilko 
 [EMAIL PROTECTED] wrote:
 

 Ok, I've been playing around a bit more, and it turns out that this is
 not
 limited to when I do clustering with terrracotta, but happens when i run
 jetty normally.

 The page expired exception fires with this message

 Cannot find the rendered page in session
 [pagemap=null,componentPath=60:yellAdTop,versionNumber=0]

 as i understand it pagemapname=null is just the default page map, so that
 shouldnt be a problem.  Im still at a loss as to why this happens though.




 Johan Compagner wrote:
 
  look at setAttribute then for the store
  It should be but into the session in the detach of the request.
 
  On Thu, May 15, 2008 at 12:30 PM, richardwilko 
  [EMAIL PROTECTED] wrote:
 
 
  I still get the same behaviour with the httpsessionstore.
 
  the problem seems to be that the page isnt put in the page map, so
 when
  the
  ajax call is made to lazy load the panel it cant access the page its
 on.
 
  looking at the http session data in the terracotta admin console i see
  that
  the AccessStackPageMap has a page map name set to null, and i cant
 find
  the
  page i should be on in the httpsession.
 
 
 
  if you use terracotta you shouldnt use the default DiskPageStore i
  believe
  but revert back to the 1.2 httpsessionstore..
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17250260.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17253801.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17255175.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Scheduler in wicket

2008-05-15 Thread aangenieux
We also use quartz with great success especially with wicket spring integration 
everything runs just fine! 
--Message d'origine--
De: Jan Kriesten
Ă€: users@wicket.apache.org
RĂ©pondre Ă : users@wicket.apache.org
Envoyé: 15 mai 2008 12:51
Objet: Re: Scheduler in wicket


hi,

 I am planning to use quartz, but before starting to integrate it in my
 wicket's app i would like to know if anybody have used it or another 
 scheduler with
 wicket.

quartz is a good choice - it just works (tm).

best regards, --- jan.



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



Ce message a été envoyé depuis un terminal BlackBerry® de Bouygues Telecom

Re: Using generics with some non-generic classes in Wicket

2008-05-15 Thread Peter Ertl

taken from SUN's generic tutorial:

http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
end of page 8

 snip :::

interface CollectionE
{
public boolean containsAll(Collection? c);
public boolean addAll(Collection? extends E c);
}
We could have used generic methods here instead:
interface CollectionE
{
public T boolean containsAll(CollectionT c);
public T extends E boolean addAll(CollectionT c);
// hey, type variables can have bounds too!
}
 snip :::

isn't addAll() that the same as

 public void foo(Class ? extends Component ?  clazz);

and

 public X extends Component? void foo(ClassX clazz);

???

seems like this is our first generic bug :-)




Am 15.05.2008 um 16:41 schrieb Peter Ertl:


this one will do:

   public X extends Component? void foo(ClassX clazz);

however, the subtle differences between this and igors version are  
really hard to get.




Am 15.05.2008 um 16:31 schrieb Igor Vaynberg:

this is the usecase we are talking about. i get a compile error,  
which sucks.


public class Test
{
  public static void main(String[] args)
  {
  Foo foo = new FooImpl();
  foo.foo(IntegerComponent.class); // ok
  foo.foo(Component.class); // compile error
  }

  public static class ComponentT {}
  public static class IntegerComponent extends ComponentInteger {}

  public static interface Foo
  {
  public void foo(Class ? extends Component ?  clazz);
  }

  public static class FooImpl implements Foo
  {
  public void foo(Class ? extends Component ?  clazz) {}
  }
}

-igor

On Wed, May 14, 2008 at 11:56 PM, Sebastiaan van Erk
[EMAIL PROTECTED] wrote:

Igor Vaynberg wrote:


well, apparently johan ran into a situation where component? is  
too

restrictive...


As I understand it, Johan ran into a situation where Component?  
causes
*warnings* for users who use raw types. Which I've been arguing  
all along
that they SHOULD get: they should use ComponentObject or  
ComponentVoid

instead of raw types, or live-with/suppress the warning.

To make it clear, I made the following test class:

public class TestT {

 public void doTest(Test? extends Test? test) {
 System.out.println(test);
 }

 public static void main(String[] args) {
 TestTestInteger test1 = newInstance(); // fine - no
warnings.
 TestTest test2 = newInstance(); // not fine, use of  
raw

type, warning
 Test test3 = newInstance(); // not fine, use of raw  
type,

warning

 test1.doTest(test1); // fine - no warnings.
 test1.doTest(test2); // error - generic types don't  
match,

can be fixed by line below
 test1.doTest((Test) test2); // warning - unchecked  
conversion

 test1.doTest(test3); // warning - unchecked conversion
 }

 public static T TestT newInstance() {
 return new TestT();
 }
}

As you can see, there is only one case when you get a compile  
error when
using the ? extends Test? generic type, and that is a case  
where there
is on the user side an incorrect generic type: TestTest. The  
user here
declares he's using generics, but then inserts a raw type of a  
known generic

type - a situation that should not happen.

Regards,
Sebastiaan


-igor


On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk [EMAIL PROTECTED] 


wrote:


Igor Vaynberg wrote:


since then the thread has evolved into whether or not we should  
use ?

extends Component or ? extends Component?

-igor


I don't understand how that changes any of my points. The first is
incorrect
(from a generics point of view) since you're referencing an
unparameterized
generic type.

So the second gives warnings only in code that is not properly
generified...

Regards,
Sebastiaan



On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk
[EMAIL PROTECTED]
wrote:


Igor Vaynberg wrote:

i do like generics. did i ever say otherwise? the problem  
here is that
if we scope something as Class? extends Component then even  
though
you ARE using generics in your code you will still get a  
warning
because we did not scope the class as Class? extends  
Component?.


on the other hand if we do scope it as Class? extends  
Component?
then you can no longer pass a raw reference when calling the  
function.


But that's exactly the point isn't it? If you're using  
generics then

you
shouldn't be using raw Components anymore...

so we are screwed if we do and we are screwed if we dont, i  
expected

generics to be better.


Well they definitely could have been better (erasure is  
terrible if you

ask
me), but I don't see what's wrong in this case. It warns you  
if you

should
be using a parameterized type but you don't.

And especially if you look at the vote result, I think the  
majority

wants
the generics...


that vote was before we uncovered this issue. we voted on the  
idea of

generics, not on the implementation.


That's true, but I wonder if this issue would change the vote  
much. I

don't
really understand why it's an 

Re: using wicket to create dynamic chart

2008-05-15 Thread Jonathan Locke


if you mean it changes in the browser after the page is finished loading,
you are probably talking client-side technologies: JS, flash, applets,
something like that.


emee wrote:
 
 Hello ,
 
 I would like to use wicket to create a dynamic chart, I mean the values of
 my chart change in the time. I use googleChart to create my chart but it
 is a static chart and  all the example I have with wicket to create static
 chart any idea how I can create a dynamic chart by using wicket ? 
 
 Thank you  
 
 

-- 
View this message in context: 
http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17255946.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Scheduler in wicket

2008-05-15 Thread Eelco Hillenius
 I am planning to use quartz, but before starting to integrate it in my
 wicket's app i would like to know if anybody have used it or another
 scheduler with
 wicket.

 we used Quartz, works like a charm. I wonder, though, what it has to do with
 Wicket - your scheduling probably (or rather: hopefully) has nothing to do
 with the UI layer of your web app, right?

+1 on both. Quartz works fine. But any scheduler and Wicket shouldn't
bite each other anyway.

Eelco

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



RE: WicketStuff Dojo Tooltip - Question

2008-05-15 Thread Patel, Sanjay
has anybody worked on Wicket Dojo Tooltip?  

-Original Message-
From: Patel, Sanjay [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 14, 2008 10:57 AM
To: users@wicket.apache.org
Subject: WicketStuff Dojo Tooltip - Question

I used WicketStuff Dojo Tooltip in my one page and it works fine. Right
now the tooltip displays on mouseover event. Is there anyway I can
display it on onClick event?

On my other page I have a link which I am hiding/showing through ajax
update (target.addComponent(..)) based on some condition. In this case
the tooltip is not being displayed.
Do I need to do anything else for that? Please see code below.
-
JAVA Code
final Label myLinkComponent= new Label(link,
objectiveDescLabelModel) {

public boolean isVisible() {
return true or false based on
condition;
}
};
final MyPanel myPanel = new MyPanel (panel-id,
objectiveDescLabelModel, new LoadableDetachableModel() {
private static final long serialVersionUID = 1L;

protected final Object load() {
return Dynamic Tooltip;
}

});
DojoTooltip tooltip = new DojoTooltip(tooltip,
myLinkComponent);
tooltip.add(myPanel);
...
add(myLinkComponent);
add(tooltip);
-
HTML Code
a wicket:id=link href=javascript:void(0);/a
span wicket:id=tooltipspan
wicket:id=panel-id/span/span


Thanks,
Sanjay Patel


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



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



Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Sam Barnum

Gerolf,

Thanks for the reply.  WicketAjaxIndicatorAppender is a behavior, but  
my RequiredBorder is a border.  It seems like there's got to be an  
easy answer to this that doesn't require a javascript hack.


Here's what I think is happening:

* The phone format is rendered on the first pass, and the  
RequiredBorder draws an asterisk after the field.
* The AjaxFormComponentUpdatingBehavior fires, to format the phone  
number.  The phone input (TextField) is added to the ajax request target
* The ajaxReqestTarget replaces the components of the phone input.   
However, the HTML generated by the border is not replaced.  The phone  
input border draws around the phone input, and you end up with two  
nested borders around the phone input.  Repeating the process nests  
the borders further.


Possible solutions:
* Remove / disable the border after it renders the first time.  This  
solves the ajax issue, but when the entire page is redrawn, the  
borders all disappear
* Somehow tell the ajaxRequestTarget to replace the input along with  
its component border, not just the input.  Not sure how to do this.

* Somehow disable the border only for ajax calls
* Don't use the border, manually add a required indicator next to  
every required field in my application. Not looking forward to this  
one...


Option #2 sounds the most promising, but I don't know where to begin.

-Sam

On May 14, 2008, at 11:38 PM, Gerolf Seitz wrote:


Sam,
a similar issue happened to the WicketAjaxIndicatorAppender.
take a look at WicketAjaxIndicatorAppender#renderHead to see
how this is solved there.
maybe you can do something similar with your RequiredBorder.

regards,
  Gerolf

On Thu, May 15, 2008 at 2:58 AM, Sam Barnum [EMAIL PROTECTED] wrote:


Using the tips in this PDF
http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf

I created the simple RequiredBorder class as follows:

public class RequiredBorder extends MarkupComponentBorder {
   public void renderAfter(Component component) {
   FormComponent fc = (FormComponent) component;
   if (fc.isRequired()) {
   super.renderAfter(component);
   }
   }
}

This basically adds a * after any required fields.  It seemed to  
work

great until I used it with an ajax phone formatter behavior:

new AjaxFormComponentUpdatingBehavior(onchange) {
   protected void onUpdate(AjaxRequestTarget target) {
   Object oldValue = component.getValue();
   String formatted = new PhoneFormatter().format 
(oldValue);

   component.setModelObject(formatted);
   target.addComponent(component);
   }
}


This caused duplicate * indicators to appear after my phone  
field when

the phone number changed, one per onchange request.  I tried adding a
boolean field to the RequiredBorder so it only gets processed  
once.  This
fixed the phone formatter duplicates, but if the form submits and  
stays on

the same page, all the * marks disappear from the required fields.

This is definitely some sort of lifecycle problem, but how do you  
fix it?


On a related note, is it generally a bad idea to mix AJAX and non- 
ajax
actions?  It seems like this is one of many issues I've run into  
when doing

this.

Thanks,

-Sam Barnum



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



Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Sam Barnum
Matthew, we wrote the phone formatter in house.  It's way too messy  
to share on here.  If I were going to rewrite it, I'd use regex to:


* Strip everything except [0-9x#] from the input
* Everthing before the 'x' or '#' is the phone number, everything  
after is the extension
* Count the number of digits in the phone number part.  Make sure  
there are 10, then format it as (###) ###- ext. ###


--
Sam Barnum
360 Works
http://www.360works.com
415.865.0952



On May 14, 2008, at 11:06 PM, Matthew Young wrote:

Sorry I can't help you with your question.  But may I ask where you  
get the

PhoneFormatter?

On Wed, May 14, 2008 at 5:58 PM, Sam Barnum [EMAIL PROTECTED] wrote:


Using the tips in this PDF
http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf

I created the simple RequiredBorder class as follows:

public class RequiredBorder extends MarkupComponentBorder {
   public void renderAfter(Component component) {
   FormComponent fc = (FormComponent) component;
   if (fc.isRequired()) {
   super.renderAfter(component);
   }
   }
}

This basically adds a * after any required fields.  It seemed to  
work

great until I used it with an ajax phone formatter behavior:

new AjaxFormComponentUpdatingBehavior(onchange) {
   protected void onUpdate(AjaxRequestTarget target) {
   Object oldValue = component.getValue();
   String formatted = new PhoneFormatter().format 
(oldValue);

   component.setModelObject(formatted);
   target.addComponent(component);
   }
}


This caused duplicate * indicators to appear after my phone  
field when

the phone number changed, one per onchange request.  I tried adding a
boolean field to the RequiredBorder so it only gets processed  
once.  This
fixed the phone formatter duplicates, but if the form submits and  
stays on

the same page, all the * marks disappear from the required fields.

This is definitely some sort of lifecycle problem, but how do you  
fix it?


On a related note, is it generally a bad idea to mix AJAX and non- 
ajax
actions?  It seems like this is one of many issues I've run into  
when doing

this.

Thanks,

-Sam Barnum




Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread richardwilko

SOLVED!

turns out that there are some new images being added to the page, but the
image url had been messed up, specifically, was '', so when the page loads,
instead of loading the image it makes a call to the home page, so instead of
20 images we get 20 calls to mydomain.com, this then messes up everything
and gives me a headache.  Ive fixed it now

Thanks for everyones help though

Richard



richardwilko wrote:
 
 right, non-clustered and httpsessionstore = exceptions
 non-clustered and default session store = no exceptions (as far as i can
 see)
 
 clustered and httpsessionstore = exceptions
 clustered and default session store = exceptions
 
 
 although our live site is running on a httpsessionstore (non clustered)
 and does not have these same problems.
 
 The only thing that's changes is that i upgraded from wicket 1.3.0 to
 1.3.3 (for clustering support) and some slight changes to the page which
 breaks - but nothing that should be causing these errors, the lazy load
 panel is the same.
 
 ive also tried wicket 1.3.2 and get same errors.
 
 But I still cant work out why on one page all my ajax works fine
 regardless of session store or clustering and on a different page the ajax
 causes page expired exceptions.
 
 
 
 
 
 
 Johan Compagner wrote:
 
 if you dont use terra then you should use the DiskPageStore
 with that store getting page expires shouldnt happen as long as the http
 session is there.
 
 johan
 
 On Thu, May 15, 2008 at 3:55 PM, richardwilko 
 [EMAIL PROTECTED] wrote:
 

 Ok, I've been playing around a bit more, and it turns out that this is
 not
 limited to when I do clustering with terrracotta, but happens when i run
 jetty normally.

 The page expired exception fires with this message

 Cannot find the rendered page in session
 [pagemap=null,componentPath=60:yellAdTop,versionNumber=0]

 as i understand it pagemapname=null is just the default page map, so
 that
 shouldnt be a problem.  Im still at a loss as to why this happens
 though.




 Johan Compagner wrote:
 
  look at setAttribute then for the store
  It should be but into the session in the detach of the request.
 
  On Thu, May 15, 2008 at 12:30 PM, richardwilko 
  [EMAIL PROTECTED] wrote:
 
 
  I still get the same behaviour with the httpsessionstore.
 
  the problem seems to be that the page isnt put in the page map, so
 when
  the
  ajax call is made to lazy load the panel it cant access the page its
 on.
 
  looking at the http session data in the terracotta admin console i
 see
  that
  the AccessStackPageMap has a page map name set to null, and i cant
 find
  the
  page i should be on in the httpsession.
 
 
 
  if you use terracotta you shouldnt use the default DiskPageStore i
  believe
  but revert back to the 1.2 httpsessionstore..
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17250260.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17253801.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Page-expired-using-LazyLoadPanel-and-clustering-tp17249134p17258169.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Page expired using LazyLoadPanel and clustering

2008-05-15 Thread Eelco Hillenius
 turns out that there are some new images being added to the page, but the
 image url had been messed up, specifically, was '', so when the page loads,

Ugh, that's still a very tricky error it seems. I thought Igor
recently checked something in for that, that at least prints a
warning? I can't find it in the code though.

Eelco

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



Performance testing tools

2008-05-15 Thread John Patterson

Hi,

This is really not related to wicket but I thought this might still be a
good place to ask...

I was wondering if anyone knows of a system independent way to performance
test Java code in unit tests.  I am thinking of something that might hook
into the VM and count bytecode instructions or something.  Then if a change
increases the number of instructions by a certain amount the test could fail
so you know you've might have messed with its performance.

Thanks,

John
-- 
View this message in context: 
http://www.nabble.com/Performance-testing-tools-tp17258645p17258645.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: RequiredBorder being applied multiple times in ajax calls

2008-05-15 Thread Gerolf Seitz
On Thu, May 15, 2008 at 6:25 PM, Sam Barnum [EMAIL PROTECTED] wrote:

 * Somehow disable the border only for ajax calls


Sam,
I think you can do something like this in RequiredBorder#renderAfter:

AjaxRequestTarget target = AjaxRequestTarget.get();
if (target == null) {
  // we're in a normal request
  // put logic of the original renderAfter here
}

not sure if that works, but you might wanna give that a try.

cheers,
  Gerolf


Re: using wicket to create dynamic chart

2008-05-15 Thread Ryan Gravener
These look pretty nice for free:

http://teethgrinder.co.uk/open-flash-chart/

On Thu, May 15, 2008 at 11:29 AM, Jonathan Locke [EMAIL PROTECTED]
wrote:



 if you mean it changes in the browser after the page is finished loading,
 you are probably talking client-side technologies: JS, flash, applets,
 something like that.


 emee wrote:
 
  Hello ,
 
  I would like to use wicket to create a dynamic chart, I mean the values
 of
  my chart change in the time. I use googleChart to create my chart but it
  is a static chart and  all the example I have with wicket to create
 static
  chart any idea how I can create a dynamic chart by using wicket ?
 
  Thank you
 
 

 --
 View this message in context:
 http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17255946.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




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


Re: Wicket Portlets in Liferay 5

2008-05-15 Thread Thijs Vonk

Hi Benjamin
I'll see if I have some time left tomorrow, otherwise hopefully before 
next tuesday.


Thijs

Benjamin Ernst wrote:

Hi Thijs,

We are currently trying to integrate Liferay 5 with wicket 1.3. Can you give
us the advise you offered? That would be very nice.

Thank you in advance,
Benjamin

On Mon, May 5, 2008 at 11:33 PM, Thijs Vonk [EMAIL PROTECTED] wrote:

  

Hi,

Currently without building wicket against Liferay (using
com.liferay.portlet.renderresponseimpl, instead of
javax.portlet.renderresponse) it is not possible to run wicket without
losing most of wickets functionality.
I can, if you want, give you a patch and some instructions to get wicket
working on liferay 5, but we are still modifying wicket and Liferay code to
get things working as we want it. So I can't guaranty anything.

Thijs


Bobby Quninne wrote:



Hi there, I am currently considering using wicket 1.3.3(and newer) with
liferay 5. The site is going to be used for backend administration,
standard CRUD
stuff. How big a risk is it, using wicket portal and liferay?
Thanks


Thijs wrote:


  

Hi,

I'm working on getting wicket compatible with jsr-286 now. However
while doing this I've noticed that Liferay has still some major issues
regarding jsr-286. Especially regarding setting properties on the response
(essentially setting response headers, cookies, etc)  there is still some
work to be done. They also don't support the MARKUP_HEAD_ELEMENT_SUPPORT
feaure jet, what would be a really nice addition because of the CSS and JS
files wicket adds to it's pages.
Comment and vote on http://support.liferay.com/browse/LEP-5828. and
track it to follow the property changes

 I'm also planning on opening a Wicket-jira issue so that you can
track the progress of the wicket implementation. But we will have to wait at
least until the portlet 2.0 specifications get official and added to a maven
repository before we can add anything to the wicket code base. Besides that
it's a lot of work and I'm doing this in my free hours so don't get over
excited just jet :).

I'll post a message on the list when I open the jira issue, and I'll
attach patches to that issue as soon as I feel confident about the work I've
been doing.

I hope that answers your questions a bit.
Thijs


gaugat wrote:




I've read in the forums, that it is better to wait for Liferay 5
(JSR
286) to
develop portlets in Apache Wicket. So has anyone developed portlets
using
Wicket and deployed them in Liferay 5?. If you have, is there a
sample
wicket portlet posted somewhere that I could look at? Are there
still
issues
with Wicket and Liferay?


  

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








  

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





  



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



Re: using wicket to create dynamic chart

2008-05-15 Thread emee

i have test JFreeChart with wicket but it is not a dynamic image what do you
mean about it a dynamic as the info changes? 


Eyal Golan wrote:
 
 have you checked out JFreeChart ?
 Is not dynamic as a progress bar, but dynamic as the info changes.
 
 On Thu, May 15, 2008 at 3:12 PM, emee [EMAIL PROTECTED] wrote:
 

 Hello ,

 I would like to use wicket to create a dynamic chart, I mean the values
 of
 my chart change in the time. I use googleChart to create my chart but it
 is
 a static chart and  all the example I have with wicket to create static
 chart any idea how I can create a dynamic chart by using wicket ?

 Thank you

 --
 View this message in context:
 http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17251826.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 
 -- 
 Eyal Golan
 [EMAIL PROTECTED]
 
 Visit: http://jvdrums.sourceforge.net/
 
 

-- 
View this message in context: 
http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17260526.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Back button retrieving cached data even with proper headers.

2008-05-15 Thread gumnaam23

My back button, doesn't send request back to the server.
I can see that the proper cache invalidating headers are set by the
response.
This is happening on firefox and IE, and using either tomcat or jetty.

Any clues ?
-- 
View this message in context: 
http://www.nabble.com/Back-button-retrieving-cached-data-even-with-proper-headers.-tp17260832p17260832.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

2008-05-15 Thread Hoover, William
For consistency sake, wouldn't it be wise to use IChoiceRenderer for
RadioGroup and CheckBoxMultipleChoice? Seems like a natural solution to
override IChoiceRenderer#getIdValue(...) to infer IDs for selection
comparison the same way that it is being done in DropDownChoice.
Otherwise, how else can you use two different model object instances
that share the same ID to be selectable?


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



Re: using wicket to create dynamic chart

2008-05-15 Thread Paolo Di Tommaso
Pure JavaScript .. simple stunning!

http://people.iola.dk/olau/flot/examples/graph-types.html

// Paolo

On Thu, May 15, 2008 at 9:11 PM, Ryan Gravener [EMAIL PROTECTED]
wrote:

 These look pretty nice for free:

 http://teethgrinder.co.uk/open-flash-chart/

 On Thu, May 15, 2008 at 11:29 AM, Jonathan Locke [EMAIL PROTECTED]
 
 wrote:

 
 
  if you mean it changes in the browser after the page is finished loading,
  you are probably talking client-side technologies: JS, flash, applets,
  something like that.
 
 
  emee wrote:
  
   Hello ,
  
   I would like to use wicket to create a dynamic chart, I mean the values
  of
   my chart change in the time. I use googleChart to create my chart but
 it
   is a static chart and  all the example I have with wicket to create
  static
   chart any idea how I can create a dynamic chart by using wicket ?
  
   Thank you
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17255946.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

2008-05-15 Thread Igor Vaynberg
checkboxmultiplechoice uses ichoicerenderer afaik, did you mean checkgroup?

radiogroup/checkgroup work differently, they leave all text generation
up to the user so no choice renderer is required.

-igor

On Thu, May 15, 2008 at 1:01 PM, Hoover, William [EMAIL PROTECTED] wrote:
 For consistency sake, wouldn't it be wise to use IChoiceRenderer for
 RadioGroup and CheckBoxMultipleChoice? Seems like a natural solution to
 override IChoiceRenderer#getIdValue(...) to infer IDs for selection
 comparison the same way that it is being done in DropDownChoice.
 Otherwise, how else can you use two different model object instances
 that share the same ID to be selectable?


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



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



Re: using wicket to create dynamic chart

2008-05-15 Thread emee

What do you mean I don’t understand ?


paolo di tommaso wrote:
 
 Pure JavaScript .. simple stunning!
 
 http://people.iola.dk/olau/flot/examples/graph-types.html
 
 // Paolo
 
 On Thu, May 15, 2008 at 9:11 PM, Ryan Gravener [EMAIL PROTECTED]
 wrote:
 
 These look pretty nice for free:

 http://teethgrinder.co.uk/open-flash-chart/

 On Thu, May 15, 2008 at 11:29 AM, Jonathan Locke
 [EMAIL PROTECTED]
 
 wrote:

 
 
  if you mean it changes in the browser after the page is finished
 loading,
  you are probably talking client-side technologies: JS, flash, applets,
  something like that.
 
 
  emee wrote:
  
   Hello ,
  
   I would like to use wicket to create a dynamic chart, I mean the
 values
  of
   my chart change in the time. I use googleChart to create my chart but
 it
   is a static chart and  all the example I have with wicket to create
  static
   chart any idea how I can create a dynamic chart by using wicket ?
  
   Thank you
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17255946.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

 
 

-- 
View this message in context: 
http://www.nabble.com/using-wicket-to-create-dynamic-chart-tp17251826p17263041.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

2008-05-15 Thread Hoover, William
yes... sorry CheckGroup is what I meant. It seems as though
RadioGroup/CheckGroup should also have the capability of using an
IChoiceRenderer as well, right? One reason I was thinking that is if
someone has a model object instance A that is a different instance than
any of the choices in the list, they can override the
IChoiceRenderer#getIdValue(...) and provide the identifier. Even though
none of the choices are the same instance of A they can still determine
equality for selection purposes using the ID value.

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 15, 2008 4:47 PM
To: users@wicket.apache.org
Subject: Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

checkboxmultiplechoice uses ichoicerenderer afaik, did you mean
checkgroup?

radiogroup/checkgroup work differently, they leave all text generation
up to the user so no choice renderer is required.

-igor

On Thu, May 15, 2008 at 1:01 PM, Hoover, William [EMAIL PROTECTED]
wrote:
 For consistency sake, wouldn't it be wise to use IChoiceRenderer for 
 RadioGroup and CheckBoxMultipleChoice? Seems like a natural solution 
 to override IChoiceRenderer#getIdValue(...) to infer IDs for selection

 comparison the same way that it is being done in DropDownChoice.
 Otherwise, how else can you use two different model object instances 
 that share the same ID to be selectable?


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



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



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



RE: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

2008-05-15 Thread Hoover, William
I agree with your view on keeping Wicket from being bloated. What if the
IChoiceRenderer was optional? If you provide it you have automation. If
you do not it works as it does now. 

It's strange that that kind of functionality is provided when multiple
selections is needed (i.e. CheckBoxMultipleChoice), but it is not when
only one choice is needed (i.e. RadioGroup/CheckGroup). It is an oddity
that other components that have choices (i.e. DropDownChoice, etc.)
provide a means to use an IChoiceRenderer, but some do not. What if
someone is using a RadioGroup/CheckGroup that uses some form of a
RepeatingView to generate the Radio/Check options dynamically? In the
case where they need to make a selection using a separate choice
instance than what is in the list, how would they accomplish that? If
they set the choice on the RadioGroup/CheckGroup model it will never be
selected because they are different instances, and because there is not
IChoiceRenderer it is not possible to define an ID value to determine
the equality of the two instances.

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 15, 2008 5:50 PM
To: users@wicket.apache.org
Subject: Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

well, the whole point of radio/check group is to allow user complete
control over markup. the whole point of choice renderer is to automate
markup generation, so there is just a big mismatch. eg i always use
radio/check group when using a choice renderer would be inconvenient.

you can always roll your own subclass, i just dont think something like
that would belong in core, its just one more parallel way of doing
something.

-igor

On Thu, May 15, 2008 at 2:44 PM, Hoover, William [EMAIL PROTECTED]
wrote:
 yes... sorry CheckGroup is what I meant. It seems as though 
 RadioGroup/CheckGroup should also have the capability of using an 
 IChoiceRenderer as well, right? One reason I was thinking that is if 
 someone has a model object instance A that is a different instance 
 than any of the choices in the list, they can override the
 IChoiceRenderer#getIdValue(...) and provide the identifier. Even 
 though none of the choices are the same instance of A they can still 
 determine equality for selection purposes using the ID value.

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 15, 2008 4:47 PM
 To: users@wicket.apache.org
 Subject: Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

 checkboxmultiplechoice uses ichoicerenderer afaik, did you mean 
 checkgroup?

 radiogroup/checkgroup work differently, they leave all text generation

 up to the user so no choice renderer is required.

 -igor

 On Thu, May 15, 2008 at 1:01 PM, Hoover, William [EMAIL PROTECTED]
 wrote:
 For consistency sake, wouldn't it be wise to use IChoiceRenderer for 
 RadioGroup and CheckBoxMultipleChoice? Seems like a natural solution 
 to override IChoiceRenderer#getIdValue(...) to infer IDs for 
 selection

 comparison the same way that it is being done in DropDownChoice.
 Otherwise, how else can you use two different model object instances 
 that share the same ID to be selectable?


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



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



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



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



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



Account Activation Email generation and response processing: any design example?

2008-05-15 Thread Matthew Young
I need to implement the usual account activation via email function.  Can
anyone point me to some example of how this is implemented? If in Wicket
even better but anything would help me a lot.

One question I have is how to generate hard to guess unique keys in the
email link? I use Hibernate  MySql, does this give me some easy way to
generate these keys? Use Jakarta common-id to generate uuid?

I plan to have an activation field in the user table to store the activation
key, once the user respond to the activation email link, clear the field to
indicate the account is activated. Is this how it's done?

Thanks for any help!


Re: Account Activation Email generation and response processing: any design example?

2008-05-15 Thread James Carman
java.util.UUID.randomUUID().toString()

On Thu, May 15, 2008 at 6:57 PM, Matthew Young [EMAIL PROTECTED] wrote:
 I need to implement the usual account activation via email function.  Can
 anyone point me to some example of how this is implemented? If in Wicket
 even better but anything would help me a lot.

 One question I have is how to generate hard to guess unique keys in the
 email link? I use Hibernate  MySql, does this give me some easy way to
 generate these keys? Use Jakarta common-id to generate uuid?

 I plan to have an activation field in the user table to store the activation
 key, once the user respond to the activation email link, clear the field to
 indicate the account is activated. Is this how it's done?

 Thanks for any help!


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



Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

2008-05-15 Thread Igor Vaynberg
On Thu, May 15, 2008 at 3:12 PM, Hoover, William [EMAIL PROTECTED] wrote:
 It's strange that that kind of functionality is provided when multiple
 selections is needed (i.e. CheckBoxMultipleChoice), but it is not when
 only one choice is needed (i.e. RadioGroup/CheckGroup).

CheckGroup is a muti-selection component

 It is an oddity
 that other components that have choices (i.e. DropDownChoice, etc.)
 provide a means to use an IChoiceRenderer, but some do not.

the whole point of Radio/CheckGroup is to give the user more control
then what IChoiceRenderer offers.

 What if
 someone is using a RadioGroup/CheckGroup that uses some form of a
 RepeatingView to generate the Radio/Check options dynamically? In the
 case where they need to make a selection using a separate choice
 instance than what is in the list, how would they accomplish that? If
 they set the choice on the RadioGroup/CheckGroup model it will never be
 selected because they are different instances, and because there is not
 IChoiceRenderer it is not possible to define an ID value to determine
 the equality of the two instances.

Not really sure what you mean here. The selection is based on the
model object of Radio/Check, not the Radio/Check instance itself...

-igor



 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 15, 2008 5:50 PM
 To: users@wicket.apache.org
 Subject: Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

 well, the whole point of radio/check group is to allow user complete
 control over markup. the whole point of choice renderer is to automate
 markup generation, so there is just a big mismatch. eg i always use
 radio/check group when using a choice renderer would be inconvenient.

 you can always roll your own subclass, i just dont think something like
 that would belong in core, its just one more parallel way of doing
 something.

 -igor

 On Thu, May 15, 2008 at 2:44 PM, Hoover, William [EMAIL PROTECTED]
 wrote:
 yes... sorry CheckGroup is what I meant. It seems as though
 RadioGroup/CheckGroup should also have the capability of using an
 IChoiceRenderer as well, right? One reason I was thinking that is if
 someone has a model object instance A that is a different instance
 than any of the choices in the list, they can override the
 IChoiceRenderer#getIdValue(...) and provide the identifier. Even
 though none of the choices are the same instance of A they can still
 determine equality for selection purposes using the ID value.

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 15, 2008 4:47 PM
 To: users@wicket.apache.org
 Subject: Re: IChoiceRenderer: RadioGroup CheckBoxMultipleChoice

 checkboxmultiplechoice uses ichoicerenderer afaik, did you mean
 checkgroup?

 radiogroup/checkgroup work differently, they leave all text generation

 up to the user so no choice renderer is required.

 -igor

 On Thu, May 15, 2008 at 1:01 PM, Hoover, William [EMAIL PROTECTED]
 wrote:
 For consistency sake, wouldn't it be wise to use IChoiceRenderer for
 RadioGroup and CheckBoxMultipleChoice? Seems like a natural solution
 to override IChoiceRenderer#getIdValue(...) to infer IDs for
 selection

 comparison the same way that it is being done in DropDownChoice.
 Otherwise, how else can you use two different model object instances
 that share the same ID to be selectable?


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



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



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



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



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



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



Thread safety for components

2008-05-15 Thread Michael Allan
I'm trying to get a handle on thread-safety for components.  I'm new
to Wicket.  My best information, so far, comes from the previous
discussion Wicket Session and threading:

  http://mail-archives.apache.org/mod_mbox/wicket-users/200801.mbox/thread

Eelco Hillenius, in response to Sebastiaan van Erk, wrote:

 Yes. We try our best to make pages/ components as thread safe as
 possible...

  Is there anywhere a small piece on how to deal with threading within
  Wicket (i.e., what is/is not synchronized in a request/response
  roundtrip?). I did some quick searching in the mailing list archives and
  google, but could not find anything related to version 1.3.

 Pages are synced on pagemaps, which basically relates to browser
 windows. RequestCycles are separate instances which are not reused, so
 no sync needed there. Sessions are not synced so you need to sync
 manually. Though in practice this wouldn't give much trouble to start
 with. Applications are shared an not synced.

During form processing, however, my own pages are *not* synced on
their pagemaps (at least not on their monitor locks).  I placed this
is in my code:

  assert Thread.holdsLock( /*page*/this.getPageMap() );

This asserts false during the setting of TextField models (Wicket
1.3.2), and false during the call to Form.onSubmit().

How can I ensure thread safety?  In other words, if I am coding a
model, what can I assume about my client threads?  Are they
synchronized somewhere, or must I code defensively within the model?
Or, from the client side, if I have a thread that accesses a page's
components, how can it avoid tangling with the response/request
threads?

-- 
Michael Allan

Toronto, 647-436-4521
http://zelea.com/


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



Re: Account Activation Email generation and response processing: any design example?

2008-05-15 Thread Ryan Gravener
You may also want to have a enum/int to represent what kind of token it is.
New user, new email, forgot password, etc..

On Thu, May 15, 2008 at 7:01 PM, James Carman [EMAIL PROTECTED]
wrote:

 java.util.UUID.randomUUID().toString()

 On Thu, May 15, 2008 at 6:57 PM, Matthew Young [EMAIL PROTECTED] wrote:
  I need to implement the usual account activation via email function.  Can
  anyone point me to some example of how this is implemented? If in Wicket
  even better but anything would help me a lot.
 
  One question I have is how to generate hard to guess unique keys in the
  email link? I use Hibernate  MySql, does this give me some easy way to
  generate these keys? Use Jakarta common-id to generate uuid?
 
  I plan to have an activation field in the user table to store the
 activation
  key, once the user respond to the activation email link, clear the field
 to
  indicate the account is activated. Is this how it's done?
 
  Thanks for any help!
 

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




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


Re: Invoulentary session sharing/leakage in Wicket 1.3.x

2008-05-15 Thread Chris Lintz

Guys has this been resolved??  We have been having some customers complain as
well (some sending screen shots of others peoples data as proof).   Because
our users click streams are available publically at their control, we had
thought jsessionids occurring in the click stream were being maliciously
hijacked. We  plugged that hole disallowing any jsessionid to be part of url
(via Servlet filter) - yes this of course means JavaScript must be enabled.  
This involuntary session sharing is still occurring.  We are running release
1.3.2.  


Johan Compagner wrote:
 
 I know all that, but i dont know how this could happen in wicket. I
 think it is user code because if you have a bufferedresponse that has
 a string buffer filled then it is very strange that the output stream
 is already used, i am very curios how both can be used by wicket in
 the same request, wicket only uses outputstream itself for resources
 and a redirect to buffer (the actual redirect) the last part this
 really cant happen because there shouldnt be anything in the response.
 
 The first part cant also happen because we dont render a page or
 something if a resource request target is the response target..
 
 So it seems to me that that it is usercode that writes directly to the
 stream and let wicket still do something
 
 
 On 5/5/08, lars vonk [EMAIL PROTECTED] wrote:
 Hi Johan,

 This exception occurs if you obtained the servletresponse via the
 ServletResponse.getOutputStream() and are *trying *to obtained the writer
 via ServletResponse.getWriter() at the same time. According to the
 javadoc
 of ServletRespone you can either use getOutputStream or getWriter to
 write
 the body:

 Either this method or [EMAIL PROTECTED] #getOutputStream} may be called to 
 write the
  body, not both.
 

 Jetty tracks this using an inner flag. This flag is only reset on the
 ServletResponse.reset()  method, which I believe is called at the end of
 the
 servletrequestcycle.

 If I look at Wicket's the WebResponse class I see several
 ServletResponse.getWriter *and* ServletResponse.getOutputStream calls.
 You
 can't mix those two when writing the servletresponse.

 Maybe this helps with tracking where it goes wrong.

 Cheers Lars

 PS. The exception would have been IllegalStateException(WRITER') if you
 obtained the ServletResponse.getWriter() and are *trying* to obtain the
 ServletResponse.getOutputStream at the same time.

 On Mon, May 5, 2008 at 4:39 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

  it was really a pretty rare exception
 
  285154 [btpool0-9] ERROR org.mortbay.log - /undefined
  java.lang.IllegalStateException: STREAM
at org.mortbay.jetty.Response.getWriter(Response.java:585)
at
  org.apache.wicket.protocol.http.WebResponse.write(WebResponse.java:355)
at org.apache.wicket.protocol.http.BufferedWebResponse.close
  (BufferedWebResponse.java:73)
at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter
  .java:371)
at
  org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter
  .java:194)
at
 
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
 
  i have no idea how this exception can happen.
  It seems that there is already streamed something but then close does
 find
  also some stuff and wants to write it..
 
  That did result in an exception on close() so the unset wasnt called.
 
  johan
 
 
 
  On Mon, May 5, 2008 at 3:34 PM, Erik van Oosten [EMAIL PROTECTED]
  wrote:
 
   Isn't this problem serious enough to release 1.3.4?
  
   Regards,
  Erik.
  
  
   Johan Compagner wrote:
the only thing we found was the finalize block that could be
 skipped
   because
of an exception again in that block
   
That is fixed in current 1.3.x branch (and 1.4)
   
   
  
   --
   Erik van Oosten
   http://day-to-day-stuff.blogspot.com/
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 

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

-- 
View this message in context: 
http://www.nabble.com/Invoulentary-session-sharing-leakage-in-Wicket-1.3.x-tp16550360p17266484.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Thread safety for components

2008-05-15 Thread Jonathan Locke


I'm not sure precisely what the current synchronization implementation is
and there may be some edge cases that are not perfect, but the overall
design is single-threaded, meaning you should not need to provide
synchronization. Some requests, like image resources would potentially be
handled in parallel, but anything that calls user code ought to be
synchronized by Wicket so you don't have to think about it. I suppose there
might be complications with asynchronous Ajax events, but I would expect
these cases are already handled.  Is there some specific problem you have
run into?


Michael Allan wrote:
 
 I'm trying to get a handle on thread-safety for components.  I'm new
 to Wicket.  My best information, so far, comes from the previous
 discussion Wicket Session and threading:
 
   http://mail-archives.apache.org/mod_mbox/wicket-users/200801.mbox/thread
 
 Eelco Hillenius, in response to Sebastiaan van Erk, wrote:
 
 Yes. We try our best to make pages/ components as thread safe as
 possible...

  Is there anywhere a small piece on how to deal with threading within
  Wicket (i.e., what is/is not synchronized in a request/response
  roundtrip?). I did some quick searching in the mailing list archives
 and
  google, but could not find anything related to version 1.3.

 Pages are synced on pagemaps, which basically relates to browser
 windows. RequestCycles are separate instances which are not reused, so
 no sync needed there. Sessions are not synced so you need to sync
 manually. Though in practice this wouldn't give much trouble to start
 with. Applications are shared an not synced.
 
 During form processing, however, my own pages are *not* synced on
 their pagemaps (at least not on their monitor locks).  I placed this
 is in my code:
 
   assert Thread.holdsLock( /*page*/this.getPageMap() );
 
 This asserts false during the setting of TextField models (Wicket
 1.3.2), and false during the call to Form.onSubmit().
 
 How can I ensure thread safety?  In other words, if I am coding a
 model, what can I assume about my client threads?  Are they
 synchronized somewhere, or must I code defensively within the model?
 Or, from the client side, if I have a thread that accesses a page's
 components, how can it avoid tangling with the response/request
 threads?
 
 -- 
 Michael Allan
 
 Toronto, 647-436-4521
 http://zelea.com/
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Thread-safety-for-components-tp17265324p17266550.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Account Activation Email generation and response processing: any design example?

2008-05-15 Thread Martin Makundi
You could also just use a md5 hashkey with content specific to the account:

MessageDigest messageDigest = MessageDigest.getInstance(MD5);
return new String(messageDigest.digest((encryptionKey +
value).getBytes()));

**
Martin

2008/5/16 Ryan Gravener [EMAIL PROTECTED]:
 You may also want to have a enum/int to represent what kind of token it is.
 New user, new email, forgot password, etc..

 On Thu, May 15, 2008 at 7:01 PM, James Carman [EMAIL PROTECTED]
 wrote:

 java.util.UUID.randomUUID().toString()

 On Thu, May 15, 2008 at 6:57 PM, Matthew Young [EMAIL PROTECTED] wrote:
  I need to implement the usual account activation via email function.  Can
  anyone point me to some example of how this is implemented? If in Wicket
  even better but anything would help me a lot.
 
  One question I have is how to generate hard to guess unique keys in the
  email link? I use Hibernate  MySql, does this give me some easy way to
  generate these keys? Use Jakarta common-id to generate uuid?
 
  I plan to have an activation field in the user table to store the
 activation
  key, once the user respond to the activation email link, clear the field
 to
  indicate the account is activated. Is this how it's done?
 
  Thanks for any help!
 

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




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


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



chaning background

2008-05-15 Thread Mathias P.W Nilsson

Hi!

I want to change the background image and color on different wicket pages.
All my pages inherits from
a root page that is the master layout. How can this be done. 

I must have it like

body,html{
  background: .
}

so that I have browser compability. Right now I have this in a external css.
How can I add this dynamically from my wicket page?
-- 
View this message in context: 
http://www.nabble.com/chaning-background-tp17268044p17268044.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: chaning background

2008-05-15 Thread Mathias P.W Nilsson

Sorry... a little early. Not chaning, changing. 

I have looked at HeaderContributor()  but that requires a css file and I
want just to append like SimpleAttributeModifier but the html, body can't
have the same id and If I add a wicket:id on body I get exception when
extending the wicket page.
-- 
View this message in context: 
http://www.nabble.com/chaning-background-tp17268044p17268081.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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