Re: How to refresh component many times in one ajax request

2007-12-17 Thread Michael Sparer

What you're doing right now is to send a request to the server, iterate a
hundred times, replace a component a hundred times, even before the response
from the server reaches the client again.

That what you want to achieve would involve 100 ajax requests and responses,
it IS feasable, but better try a javascript-solution, because 100 roundtrips
is just too much if it's just for changing the label to a fixed value.
But if it's more than that, AjaxSelfUpdatingBehavior might be your friend

Artur W. wrote:
> 
> Hi!
> 
> I try to do something like this
> 
>   final Label counterLabel = new Label("counter", new 
> PropertyModel(this,
> "counter"));
>   counterLabel.setOutputMarkupId(true);
>   add(counterLabel);
> 
>   Form form = new Form("form");
>   add(form);
> 
>   form.add(new AjaxButton("confirmButton") {
>   @Override
>   protected void onSubmit(AjaxRequestTarget target, Form 
> form) {
>   for (int i=0; i <100; i++ ) {
>   synchronized (this) {
>   try {
>   wait(1000);
>   } catch (InterruptedException 
> e) {
>   e.printStackTrace();
>   }
>   counter += i;
>   
> target.addComponent(counterLabel);
>   }
>   }
>   }
>   });
> 
> 
> The component doesn't refresh. Only for the last time. How to make it
> work?
> 
> 
> Thanks,
> Artur
> 
> 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/How-to-refresh-component-many-times-in-one-ajax-request-tp14374053p14384523.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: dynamic url

2007-12-17 Thread Michael Sparer

I really don't get your point. If there is content which only a selected
group of visitors should see, a role based authentication/authorization
would be appropriate.

But invalidating URLs after the first visit would be a filthy hack (correct
me if I'm wrong) 


tbt wrote:
> 
> I'm using wicket to develop an online exam system and its important that
> users dont open new tabs in the same browser and start answering different
> question papers. Is there a way to stop this with wicket. 
> 
> 
> 
> Michael Sparer wrote:
>> 
>> Opening a different tab doesn't start a new session. You should try it
>> with different browsers and/or different machines.
>> 
>> 
>> tbt wrote:
>>> 
>>> Hi
>>> 
>>> I'm a newbie to wicket and I'm using a WebSession to log users into my
>>> application. When navigating through the pages wicket generates a
>>> dynamic url such as
>>> http://192.222.7.66:8080/oem?wicket:interface=wicket-1:0::
>>> 
>>> But if you copy this url and paste it in a seperate tab the inner page
>>> is displayed. As a result users can view data without giving the
>>> username and password. How can I stop this.
>>> 
>>> Thanks 
>>> 
>> 
>> 
> 
> 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/dynamic-url-tp14370171p14384520.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: Format date column in DefaultDataTable

2007-12-17 Thread Jason Anderson
Likewise, I'm not sure if its the "best" way but i generally create a
quick FormattedPropertyColumn class that extends PropertyColumn and
creates the formatted label model with java.text.MessageFormat for
number/currency/date formatting purposes

Cheers,
Jason

On Dec 17, 2007 11:03 PM, Stefan Lindner <[EMAIL PROTECTED]> wrote:
> I use two solutions for this (depends on the situatioin)
> 1. Define your own Date class (e.g. class MyDate extends Date), write a 
> Converter for MyDate, add a method getMyDate to your data class and write
>  columns.add( new PropertyColumn( new Model( "Call Received" ),
>  "callReceived",  "getMyDate" ) );
> 2. Override the populateItem method of the PropertyColumn class e.g. place a 
> simple Label with the String representatin of your Date into the table cell
>
> Maybe there is a better way to do this and I can learn from the communito too.
>
> Stefan
>
> -Ursprüngliche Nachricht-
> Von: Karen Schaper [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 18. Dezember 2007 00:40
> An: users@wicket.apache.org
> Betreff: Format date column in DefaultDataTable
>
>
> Hi,
>
> Another newbie question from me.
>
> I have a table that has a date column in it and I am trying to format the 
> date to also display the time.  It seems to just default to showing ie.
> 11/14/07.
>
> I can't see how to add any of the date converter or formatting of dates to 
> the table I am using below.  The callReceived is a date object.
>
>
> List columns = new ArrayList();
>
> columns.add( new PropertyColumn( new Model( "Call Received" ),
> "callReceived",  "callReceived" ) );
> .
> .
> .
> add( new DefaultDataTable( "troubleCallTable", columns, _dataProvider,
> 25 ) );
>
> Thanks for all your previous replies as well.. they have been very helpful.
>
> Karen.
>
>
> -
> 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: dynamic url

2007-12-17 Thread Igor Vaynberg
keep in mind this wont work if javascript is disabled

-igor


On Dec 17, 2007 11:23 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > I'm using wicket to develop an online exam system and its important that
> > users dont open new tabs in the same browser and start answering different
> > question papers. Is there a way to stop this with wicket.
>
> You're really talking about a limitation (or lack thereof) of how
> browsers work. An attempt to act on this can be found in method
> WebPage#onNewBrowserWindow / interface INewBrowserWindowListener.
> Check out the source of WebPage to see how this works.
>
> Eelco
>
>
> -
> 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: dynamic url

2007-12-17 Thread Eelco Hillenius
> I'm using wicket to develop an online exam system and its important that
> users dont open new tabs in the same browser and start answering different
> question papers. Is there a way to stop this with wicket.

You're really talking about a limitation (or lack thereof) of how
browsers work. An attempt to act on this can be found in method
WebPage#onNewBrowserWindow / interface INewBrowserWindowListener.
Check out the source of WebPage to see how this works.

Eelco

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



RE: Format date column in DefaultDataTable

2007-12-17 Thread Stefan Lindner
I use two solutions for this (depends on the situatioin)
1. Define your own Date class (e.g. class MyDate extends Date), write a 
Converter for MyDate, add a method getMyDate to your data class and write
 columns.add( new PropertyColumn( new Model( "Call Received" ),
 "callReceived",  "getMyDate" ) );
2. Override the populateItem method of the PropertyColumn class e.g. place a 
simple Label with the String representatin of your Date into the table cell

Maybe there is a better way to do this and I can learn from the communito too.

Stefan

-Ursprüngliche Nachricht-
Von: Karen Schaper [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 18. Dezember 2007 00:40
An: users@wicket.apache.org
Betreff: Format date column in DefaultDataTable

Hi,

Another newbie question from me.

I have a table that has a date column in it and I am trying to format the date 
to also display the time.  It seems to just default to showing ie.
11/14/07.

I can't see how to add any of the date converter or formatting of dates to the 
table I am using below.  The callReceived is a date object.


List columns = new ArrayList();

columns.add( new PropertyColumn( new Model( "Call Received" ),
"callReceived",  "callReceived" ) );
.
.
.
add( new DefaultDataTable( "troubleCallTable", columns, _dataProvider,
25 ) );

Thanks for all your previous replies as well.. they have been very helpful.

Karen.


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

2007-12-17 Thread tbt

I'm using wicket to develop an online exam system and its important that
users dont open new tabs in the same browser and start answering different
question papers. Is there a way to stop this with wicket. 



Michael Sparer wrote:
> 
> Opening a different tab doesn't start a new session. You should try it
> with different browsers and/or different machines.
> 
> 
> tbt wrote:
>> 
>> Hi
>> 
>> I'm a newbie to wicket and I'm using a WebSession to log users into my
>> application. When navigating through the pages wicket generates a dynamic
>> url such as http://192.222.7.66:8080/oem?wicket:interface=wicket-1:0::
>> 
>> But if you copy this url and paste it in a seperate tab the inner page is
>> displayed. As a result users can view data without giving the username
>> and password. How can I stop this.
>> 
>> Thanks 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/dynamic-url-tp14370171p14375876.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]



Format date column in DefaultDataTable

2007-12-17 Thread Karen Schaper
Hi,

Another newbie question from me.

I have a table that has a date column in it and I am trying to format the
date to also display the time.  It seems to just default to showing ie.
11/14/07.

I can't see how to add any of the date converter or formatting of dates to
the table I am using below.  The callReceived is a date object.


List columns = new ArrayList();

columns.add( new PropertyColumn( new Model( "Call Received" ),
"callReceived",  "callReceived" ) );
.
.
.
add( new DefaultDataTable( "troubleCallTable", columns, _dataProvider,
25 ) );

Thanks for all your previous replies as well.. they have been very helpful.

Karen.


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



Re: How to set the current application to a new thread?

2007-12-17 Thread Igor Vaynberg
you cannot push a page to the browser, the browser has to request it.
so what i would do is have a timer on client side that requests a new
page every x seconds.

see AbstractAjaxTimerBehavior

-igor


On Dec 17, 2007 2:16 PM, dzenanr <[EMAIL PROTECTED]> wrote:
>
> I have been trying to develop a slideshow with a new thread that will show a
> new page every 15 seconds.
>
> I get the following message:
>
> 22:12:29.188 EVENT  Started SocketListener on 0.0.0.0:8081
> 22:12:29.188 EVENT  Started [EMAIL PROTECTED]
> 22:12:38.427 EVENT  Started HttpContext[/]
> Exception in thread "Timer-0" org.apache.wicket.WicketRuntimeException:
> There is no application attached to current thread Timer-0
> at org.apache.wicket.Application.get(Application.java:175)
> at org.apache.wicket.Component.getApplication(Component.java:1044)
> at
> course.wicket.lecture.slide.SlideshowPage$SlideshowTimerTask.run(SlideshowPage.java:46)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
>
> I cannot use the Application.set method (it is not a part of the public
> API).
>
> How should I set the current application to a new thread?
>
> -
> Dzenan
> --
> View this message in context: 
> http://www.nabble.com/How-to-set-the-current-application-to-a-new-thread--tp14375785p14375785.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]
>
>

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



How to set the current application to a new thread?

2007-12-17 Thread dzenanr

I have been trying to develop a slideshow with a new thread that will show a
new page every 15 seconds.

I get the following message:

22:12:29.188 EVENT  Started SocketListener on 0.0.0.0:8081
22:12:29.188 EVENT  Started [EMAIL PROTECTED]
22:12:38.427 EVENT  Started HttpContext[/]
Exception in thread "Timer-0" org.apache.wicket.WicketRuntimeException:
There is no application attached to current thread Timer-0
at org.apache.wicket.Application.get(Application.java:175)
at org.apache.wicket.Component.getApplication(Component.java:1044)
at
course.wicket.lecture.slide.SlideshowPage$SlideshowTimerTask.run(SlideshowPage.java:46)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

I cannot use the Application.set method (it is not a part of the public
API). 

How should I set the current application to a new thread?

-
Dzenan
-- 
View this message in context: 
http://www.nabble.com/How-to-set-the-current-application-to-a-new-thread--tp14375785p14375785.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: How to refresh component many times in one ajax request

2007-12-17 Thread Gerolf Seitz
On Dec 17, 2007 10:33 PM, Artur W. <[EMAIL PROTECTED]> wrote:

>
> The component doesn't refresh. Only for the last time. How to make it
> work?
>

that's because the response is sent *AFTER* loop is over, not when
target.addComponent(..) is called.
what you need is a AjaxSelfUpdatingTimerBehavior, override
onPostProcessTarget and do counter = counter +1; in there.

hth,
  Gerolf


>
>
> Thanks,
> Artur
>
> --
> View this message in context:
> http://www.nabble.com/How-to-refresh-component-many-times-in-one-ajax-request-tp14374053p14374053.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]
>
>


How to refresh component many times in one ajax request

2007-12-17 Thread Artur W.

Hi!

I try to do something like this

final Label counterLabel = new Label("counter", new 
PropertyModel(this,
"counter"));
counterLabel.setOutputMarkupId(true);
add(counterLabel);

Form form = new Form("form");
add(form);

form.add(new AjaxButton("confirmButton") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form 
form) {
for (int i=0; i <100; i++ ) {
synchronized (this) {
try {
wait(1000);
} catch (InterruptedException 
e) {
e.printStackTrace();
}
counter += i;

target.addComponent(counterLabel);
}
}
}
});


The component doesn't refresh. Only for the last time. How to make it work?


Thanks,
Artur

-- 
View this message in context: 
http://www.nabble.com/How-to-refresh-component-many-times-in-one-ajax-request-tp14374053p14374053.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]



Problem with AjaxTabbedPanel, Form and PageMap

2007-12-17 Thread JulianS

I have an AjaxTabbedPanel with several tabs, each containing a form. There is
nothing fancy about the forms, there are just text fields and checkboxes.
Sometimes when I submit the form, I get the error:

INFO  [AccessStackPageMap] Unable to get version N of page [Page class =
my.com.MyPage, id = M, version = X, ajax = 0]

I'm setting the response page to the page that contains the tabbed panel, as
follows:

Button ok = new Button("myid")
{
@Override
public void onSubmit()
{
// sql update goes here...
setResponsePage(parentPage);
}
};
form.addButton(ok);
add(form);

Any insight is appreciated.
Thanks,
Julian

-- 
View this message in context: 
http://www.nabble.com/Problem-with-AjaxTabbedPanel%2C-Form-and-PageMap-tp14374011p14374011.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: Suckerfish dropdowns for wicket

2007-12-17 Thread Igor Vaynberg
give us your sf.net name and we will add you to the project.

-igor


On Dec 17, 2007 11:07 AM, JulianS <[EMAIL PROTECTED]> wrote:
>
>
> Matej Knopp-2 wrote:
> >
> > Why don't you post a comment to the article?
> >
> > -Matej
> >
> I'm the author and I'd be happy to contribute the code to wicket-stuff, if
> someone tells me the process. I've actually upgraded the code to support
> submenus but haven't had a chance to post it yet.
>
> Julian
>
> --
> View this message in context: 
> http://www.nabble.com/Suckerfish-dropdowns-for-wicket-tp14208480p14373996.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]
>
>

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



Re: Suckerfish dropdowns for wicket

2007-12-17 Thread JulianS


Matej Knopp-2 wrote:
> 
> Why don't you post a comment to the article?
> 
> -Matej
> 
I'm the author and I'd be happy to contribute the code to wicket-stuff, if
someone tells me the process. I've actually upgraded the code to support
submenus but haven't had a chance to post it yet.

Julian

-- 
View this message in context: 
http://www.nabble.com/Suckerfish-dropdowns-for-wicket-tp14208480p14373996.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: dynamic url

2007-12-17 Thread Michael Sparer

Opening a different tab doesn't start a new session. You should try it with
different browsers and/or different machines.


tbt wrote:
> 
> Hi
> 
> I'm a newbie to wicket and I'm using a WebSession to log users into my
> application. When navigating through the pages wicket generates a dynamic
> url such as http://192.222.7.66:8080/oem?wicket:interface=wicket-1:0::
> 
> But if you copy this url and paste it in a seperate tab the inner page is
> displayed. As a result users can view data without giving the username and
> password. How can I stop this.
> 
> Thanks 
> 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/dynamic-url-tp14370171p14372588.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: TagCloud

2007-12-17 Thread Uwe Schäfer

Uwe Schäfer schrieb:

is there some tag-like component out there already ?

uups. sorry. i meant some TagCloud- like component.


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



TagCloud

2007-12-17 Thread Uwe Schäfer

hi

is there some tag-like component out there already ?

cu uwe

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



Re: dynamic url

2007-12-17 Thread Alex Jacoby
I'm new to wicket too, but my guess is that if you tried the URL in a  
new browser entirely (or if you quit and re-opened your browser), the  
URL wouldn't work any more.  New tabs still have all the cookies that  
the old tabs have, which works out nicely in many cases.  They're  
extensions of the current session, not new sessions.


Hope I understood your problem correctly,
Alex

On Dec 17, 2007, at 4:10 AM, tbt wrote:

Hi

I'm a newbie to wicket and I'm using a WebSession to log users into my
application. When navigating through the pages wicket generates a  
dynamic

url such as http://192.222.7.66:8080/oem?wicket:interface=wicket-1:0::

But if you copy this url and paste it in a seperate tab the inner  
page is
displayed. As a result users can view data without giving the  
username and

password. How can I stop this.

Thanks
--
View this message in context: 
http://www.nabble.com/dynamic-url-tp14370171p14370171.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: WicketNotSerializableException

2007-12-17 Thread Evan Chooly
it's the ApplicationContextFacade that can't be serialized.  you'll need to
mark this field as transient most likely.  Now, if this is, as I suspect, a
spring class for getting your dependencies, you'll have to refetch/recreate
this context after deserialization.  But  if you're using spring you  should
really look at wicket-spring and use @SpringBean to get your deps handed to
you.

On Dec 17, 2007 5:59 AM, Joshua Jackson <[EMAIL PROTECTED]> wrote:

> Dear all,
>
> I got this message because there is a field that Wicket wants to
> serialize but it can not be serialized. Now how do I remove this error
> since I can not make tomcat's ApplicationContextFacade to be
> Serializable.
>
> 2007-12-17 17:49:12,498 - [ERROR] - Objects- Error
> serializing object class com.mycompany.dupe.pages.PricePage
> [object=[Page class = com.mycompany.d
> upe.pages.PricePage, id = 17, version = 0]]
>
> org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
> Unable to serialize class:
> org.apache.catalina.core.ApplicationContextFacade
> Field hierarchy is:
>  17 [class=com.mycompany.dupe.pages.PricePage, path=17]
>private java.lang.Object
> org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
>  private java.util.List
> com.mycompany.dupe.pages.PricePage$PriceForm.prices[8]
> [class=com.mycompany.dupe.pages.PricePage$GeneratorForm,
> path=17:generatorForm]
>javax.servlet.ServletContext
> com.mycompany.dupe.pages.PricePage$GeneratorForm.context
> [class=org.apache.catalina.core.ApplicationContextFacade] <- field
>  that is not serializable
>
> Thanks in advance
>
> --
> I'm a coder not a drag-n-dropper
>
> Blog: http://joshuajava.wordpress.com/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket + OSGI + Session

2007-12-17 Thread Daniel Stoch
Hi,

Thank you for your suggestion. I have no time to look at this earlier,
but Wicket 1.3.0-rc2 is out now and after upgrade the error message I
have has changed to:
java.lang.IllegalStateException: spring application context locator
returned null
 at 
org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:180)
 at 
org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:162)
 at 
org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
 at org.apache.wicket.proxy.$Proxy82.getAction(Unknown Source)

So it seems there is a problem with deserialization of spring
application context locator. I have used my own locator implementation
(OsgiSpringContextLocator). There is one locator created for each
application context and there was a map of locators and app contexts.
Locator reference was the key in this map (very, very bad thing :)):

private static Map
applicationContexts = new HashMap();

I have changed this now to:

public class OsgiSpringContextLocator implements ISpringContextLocator {

  private static Map applicationContexts
= new HashMap();
  private static int appContextCounter = 0;

  private Integer appContextId;

  OsgiSpringContextLocator(ApplicationContext applicationContext) {
appContextCounter++;
appContextId = new Integer(appContextCounter);
applicationContexts.put(appContextId, applicationContext);
  }

  public ApplicationContext getSpringContext() {
ApplicationContext result = applicationContexts.get(appContextId);
return result;
  }

}

So each appCtxt has its own unique index (appContextId) which is
stored in locator, so locator is able to find a proper appCtxt by this
id (even after deserialization)
This is a quick fix that works, maybe in the future I will implement
this in a more elegant way ;).

Daniel

On Nov 26, 2007 3:33 PM, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote:
> Yep, I've seen though before.
>
> It's probably a ClassNotFoundException on deserialization which gets
> eaten by ObjectInputStream (there's a bug report at Sun for this). To be
> sure you can debug trapping on ClassNotFoundException (caught and
> uncaught) when this problem occurs.
>
> However, since it's in a page you can easily fix this one: either
> upgrade to trunk and implement your own IClassResolver and register it
> with the application, or write your own IObjectStreamFactory
> implementation and register it with the Objects class.
>
> In either case, have a look at the DefaultObjectStreamFactory to see how
> to write a hook to look up classes in an ObjectInputStream
> implementation (resolveClass method).
>
> Regards,
> Sebastiaan
>
>
> Daniel Stoch wrote:
> > Hi,
> >
> > You have written: "This causes problems with session
> > serialization/deserialization in an OSGI environment." I don't know is
> > it a related problem, but I have the following situation (of course
> > app is running in OSGi environment):
> > I have a page with DataView displaying products list with images. Each
> > product has AjaxLink, when I click this link product should be
> > selected (highlighted). But sometimes after click I have an error with
> > serialization:
> >
> > Root cause:
> > java.io.StreamCorruptedException: invalid type code: 01
> >  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
> >  at 
> > java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
> >  at 
> > java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)

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



Re: java.lang.OutOfMemoryError: Java heap space

2007-12-17 Thread Michael Sparer

some code would be nice


kenixwong wrote:
> 
> hi, anyone can help ?
> 
> i was using the Eclipse 3.2.2, jdk1.6.0, jetty 6.0.2, wicket 1.2.4. Once i
> loop a report page, the eclipse console and page return the error as
> above. How can i solve it 
> 
> I had tryed to reset the eclispe.ini
> (http://bugs.sakaiproject.org/confluence/display/ARW/Eclipse+startup+memory+settings)
> too.
> 
> 
> 
> here is the error
> 
> ...
> ...
> ...
> at
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView$1.newItem(RefreshingView.java:108)
>   at
> wicket.extensions.markup.html.repeater.refreshing.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:73)
>   at
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.addItems(RefreshingView.java:191)
>   at
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.internalOnAttach(RefreshingView.java:117)
>   at wicket.Component.internalAttach(Component.java:2579)
>   at wicket.MarkupContainer.internalAttach(MarkupContainer.java:341)
>   at wicket.MarkupContainer.internalAttach(MarkupContainer.java:354)
>   at wicket.MarkupContainer.internalAttach(MarkupContainer.java:354)
>   at wicket.Page.renderPage(Page.java:383)
>   at
> wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:160)
>   at
> wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:60)
>   at
> wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
>   at
> wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
>   at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
>   at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
>   at wicket.RequestCycle.step(RequestCycle.java:1010)
>   at wicket.RequestCycle.steps(RequestCycle.java:1084)
>   at wicket.RequestCycle.request(RequestCycle.java:454)
>   at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
>   at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>   at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
>   at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
>   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
> 
> 
> Any solution ??
> 
> 
> thanks in advance..
> 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tp14370078p14370222.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]



WicketNotSerializableException

2007-12-17 Thread Joshua Jackson
Dear all,

I got this message because there is a field that Wicket wants to
serialize but it can not be serialized. Now how do I remove this error
since I can not make tomcat's ApplicationContextFacade to be
Serializable.

2007-12-17 17:49:12,498 - [ERROR] - Objects- Error
serializing object class com.mycompany.dupe.pages.PricePage
[object=[Page class = com.mycompany.d
upe.pages.PricePage, id = 17, version = 0]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
Unable to serialize class:
org.apache.catalina.core.ApplicationContextFacade
Field hierarchy is:
  17 [class=com.mycompany.dupe.pages.PricePage, path=17]
private java.lang.Object
org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
  private java.util.List
com.mycompany.dupe.pages.PricePage$PriceForm.prices[8]
[class=com.mycompany.dupe.pages.PricePage$GeneratorForm, path=17:generatorForm]
javax.servlet.ServletContext
com.mycompany.dupe.pages.PricePage$GeneratorForm.context
[class=org.apache.catalina.core.ApplicationContextFacade] <- field
 that is not serializable

Thanks in advance

-- 
I'm a coder not a drag-n-dropper

Blog: http://joshuajava.wordpress.com/

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



Re: Rendering of field contents

2007-12-17 Thread Gerolf Seitz
hi,

look in the archives, specifically my answer in this thread[0] ...

hth,
  Gerolf

[0]
http://www.nabble.com/TextField-rounds-doubles-2C-why--to12997105.html#a13000501

On Dec 17, 2007 11:31 AM, Greven, Jens <[EMAIL PROTECTED]> wrote:

> Hi List ;-)
>
>
>
> I am quite new to the Wicket Framework and really like it. But as always
> when dealing with new things, some questions arise ;-)
>
>
>
> Currently I'm stuck trying to change the Rendering of field contents, e.
> g. I have a TextField with type set to Double, and I want it to render
> all entered numbers like "1.234,56" (german locale), thus "1" should be
> rendered as "1,00", but instead it is displayed as "1".
>
>
>
> Is there a way of achieving this? Or, even better, an AJAXed way?
>
>
>
> I just can't find the right spot to start playing around with to get my
> fields rendered the way I want them to and would be very happy if
> someone could tell me where to look ;-)
>
>
>
>
>
> Thanks in advance,
>
> Jens
>
>
>
>
>
> Jens Greven
>
> Telefon: 0251/70017-339
> Telefax: 0251/70017-222
> E-Mail: [EMAIL PROTECTED]
>
> [pma:] software + systeme GmbH
> Ein Unternehmen von Pramerica Financial
> Münsterstr. 111
> 48155 Münster
> http://www.pma.de
>
> Geschäftsführung: Jörg Matheis
> Handelsregister: Amtsgericht Münster HRB 4256
> Diese Information ist ausschliesslich fuer die adressierte Person oder
> Organisation bestimmt und koennte vertrauliches Material enthalten. Sollten
> Sie diese Nachricht irrtuemlich erhalten haben, bitten wir Sie, sich mit dem
> Absender in Verbindung zu setzen und das Material von Ihrem Computer zu
> loeschen. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail
> ist nicht gestattet.
> Wir weisen darauf hin, dass Email-Nachrichten mit und ohne Zutun von
> Dritten verloren gehen, veraendert oder verfaelscht werden koennen.
> Herkoemmliche E-Mails sind nicht gegen den Zugriff von Dritten geschuetzt
> und deshalb ist auch die Vertraulichkeit unter Umstaenden nicht gewahrt. Wir
> haften deshalb nicht fuer die Unversehrtheit von E-Mails nachdem sie unseren
> Herrschaftsbereich verlassen haben und koennen Ihnen hieraus entstehende
> Schaeden nicht ersetzen. Sollte trotz der von uns verwendeten
> Virus-Schutz-Programmen durch die Zusendung von E-Mails ein Virus in Ihre
> Systeme gelangen, haften wir nicht fuer eventuell hieraus entstehende
> Schaeden. Dieser Haftungsausschluss gilt nur soweit gesetzlich zulaessig.


Re: Wicket 1.3.0-rc2 and WebSphere 5.1 Http status 302

2007-12-17 Thread Martijn Dashorst
search the list for websphere...
Martijn

On Dec 17, 2007 11:00 AM, Alex Objelean <[EMAIL PROTECTED]> wrote:

>
> I am writing an web application that uses Wicket 1.3.0-rc2 and it should
> run
> on WebSphere 5.1.
>
> In web.xml I am using the WicketFilter mapped with the URL pattern
> /admin/*
>
> I install the application in WebSphere 5.1 and when I access the home page
> it works.
>
> The URL that I am using is like: http://host/application/admin.
>
> When I click on a link the browser makes the request to :
> http://host/application/admin/? and server responds with the
> status 302 with the location: http://host/application/?, it
> removes the admin.
>
> The application works fine in Tomcat, JBoss (4.2.2 and 3.2.6) and in
> WebSphere 6.1
>
> As a solution I've configured the WicketServlet in web.xml and now it
> works
> also on WebSphere 5.1
>
> Did anybody encountered the same problem with WicketFilter and WebSphere
> 5.1?
>
> Is there any advantage with using the WicketFilter instead of using the
> WicketServlet?
>
> --
> View this message in context:
> http://www.nabble.com/Wicket-1.3.0-rc2-and-WebSphere-5.1-Http-status-302-tp14370196p14370196.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]
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/


Re: java.lang.OutOfMemoryError: Java heap space

2007-12-17 Thread Matej Knopp
It's not possible to help you without knowing seeing more code. What
are the items you are creating? It's probably the models itself that
cause the outofmemory error, you are likely to be loading someting
huge.

-Matej

On Dec 17, 2007 6:12 AM, kenixwong <[EMAIL PROTECTED]> wrote:
>
> hi, anyone can help ?
>
> i was using the Eclipse 3.2.2, jdk1.6.0, jetty 6.0.2, wicket 1.2.4. Once i
> loop a report page, the eclipse console and page return the error as above.
> How can i solve it 
>
> I had tryed to reset the eclispe.ini
> (http://bugs.sakaiproject.org/confluence/display/ARW/Eclipse+startup+memory+settings)
> too.
>
>
>
> here is the error
>
> ...
> ...
> ...
> at
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView$1.newItem(RefreshingView.java:108)
> at
> wicket.extensions.markup.html.repeater.refreshing.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:73)
> at
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.addItems(RefreshingView.java:191)
> at
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.internalOnAttach(RefreshingView.java:117)
> at wicket.Component.internalAttach(Component.java:2579)
> at wicket.MarkupContainer.internalAttach(MarkupContainer.java:341)
> at wicket.MarkupContainer.internalAttach(MarkupContainer.java:354)
> at wicket.MarkupContainer.internalAttach(MarkupContainer.java:354)
> at wicket.Page.renderPage(Page.java:383)
> at
> wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:160)
> at
> wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:60)
> at
> wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
> at
> wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
> at 
> wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
> at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
> at wicket.RequestCycle.step(RequestCycle.java:1010)
> at wicket.RequestCycle.steps(RequestCycle.java:1084)
> at wicket.RequestCycle.request(RequestCycle.java:454)
> at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
> at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
> at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
> at 
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
>
>
> Any solution ??
>
>
> thanks in advance..
> --
> View this message in context: 
> http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tp14370078p14370078.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]
>
>

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



Wicket 1.3.0-rc2 and WebSphere 5.1 Http status 302

2007-12-17 Thread Alex Objelean

I am writing an web application that uses Wicket 1.3.0-rc2 and it should run
on WebSphere 5.1.

In web.xml I am using the WicketFilter mapped with the URL pattern /admin/*

I install the application in WebSphere 5.1 and when I access the home page
it works. 

The URL that I am using is like: http://host/application/admin.

When I click on a link the browser makes the request to :
http://host/application/admin/? and server responds with the
status 302 with the location: http://host/application/?, it
removes the admin.

The application works fine in Tomcat, JBoss (4.2.2 and 3.2.6) and in
WebSphere 6.1

As a solution I've configured the WicketServlet in web.xml and now it works
also on WebSphere 5.1

Did anybody encountered the same problem with WicketFilter and WebSphere
5.1?

Is there any advantage with using the WicketFilter instead of using the
WicketServlet?
 
-- 
View this message in context: 
http://www.nabble.com/Wicket-1.3.0-rc2-and-WebSphere-5.1-Http-status-302-tp14370196p14370196.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: "Streaming" a huge ZIP file

2007-12-17 Thread Johan Compagner
you can't update a page and download in 1 request.
You have to do this in 2. First update the page that does a call back to the
server when loaded that loads the resource

johan



On Dec 17, 2007 9:40 AM, Gabor Szokoli <[EMAIL PROTECTED]> wrote:

> Hi,
>
> This looks completely straight-forward, we'll switch to it as soon as
> move to rc3.
>
> On Dec 16, 2007 8:33 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
>
> > RequestCycle.get().setRequestTarget(new
> ResourceStreamRequestTarget(writer,"
> > test.zip"));
>
> Maybe this is dumb, but if I encounter an exception in the write
> method (during content generation), can I "unsnatch" the stream and
> hand it back to wicket for displaying regular pages? I realise the
> headers like content type and even some content might have been
> streamed out already, but who knows.
>
> Slightly related, what would be the best way for a single onclick()
> event to result in both a wicket page refresh and a download?
>
>
> Gabor Szokoli
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


dynamic url

2007-12-17 Thread tbt

Hi

I'm a newbie to wicket and I'm using a WebSession to log users into my
application. When navigating through the pages wicket generates a dynamic
url such as http://192.222.7.66:8080/oem?wicket:interface=wicket-1:0::

But if you copy this url and paste it in a seperate tab the inner page is
displayed. As a result users can view data without giving the username and
password. How can I stop this.

Thanks 
-- 
View this message in context: 
http://www.nabble.com/dynamic-url-tp14370171p14370171.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: "Streaming" a huge ZIP file

2007-12-17 Thread Gabor Szokoli
Hi,

This looks completely straight-forward, we'll switch to it as soon as
move to rc3.

On Dec 16, 2007 8:33 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:

> RequestCycle.get().setRequestTarget(new ResourceStreamRequestTarget(writer,"
> test.zip"));

Maybe this is dumb, but if I encounter an exception in the write
method (during content generation), can I "unsnatch" the stream and
hand it back to wicket for displaying regular pages? I realise the
headers like content type and even some content might have been
streamed out already, but who knows.

Slightly related, what would be the best way for a single onclick()
event to result in both a wicket page refresh and a download?


Gabor Szokoli

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