Re: [Wicket-user] execute long running ajax task after page is loaded

2007-07-26 Thread jonaqua

Thanks Martijn,

I haven't attempted this yet - I've been working on other things (since
functionally this part of my app works fine).  When I revisit this I'm sure
I'll have some questions for you :)

Thanks again


Martijn Dashorst wrote:
 
 Create a processing thread, and dispatch it. Have the thread update
 some progress object that you can get access to, and query that
 progress with a label (or something more fancy like a progress bar).
 
 Something like:
 
 Link() {
 onclick() { create thread, start it }
 }
 
 add(new Label(progress, new Model() { getObject() { ... get thread,
 return progress }));
 label.add(new AjaxSelfUpdatingBehavior(Duration.ONE_SECOND));
 
 Note that you don't want to serialize the thread itself, or the
 progress object. You'll have to dynamically retrieve it
 (de/serialization will detach the objects).
 
 Martijn
 
 On 7/20/07, jonaqua [EMAIL PROTECTED] wrote:

 The wicket ajax link examples are great.  The functionality I need is
 very
 similar to the third link example here:

 http://www.wicket-library.com/wicket-examples/ajax?wicket:bookmarkablePage=:wicket.examples.ajax.builtin.LinksPage

 ( ajax link with a busy indicator. the server will deliberately pause for
 five seconds)

 The only difference between my code and that example is that I
 substituted
 my actual long running task for the example's Thread.sleep(5000).

 Everything is working great but I have two questions:

 1) I don't really want it to be a link.  I really just want my long
 running
 task to be executed after the page is loaded and I want it to update some
 label when it finishes.  Any hints on how I can do this?

 2) Right now my long running task is executed in the link's
 onClick(AjaxRequestTarget target) method just like the example.  Should
 this
 be executed on a separate thread?

 Thank you


 --
 View this message in context:
 http://www.nabble.com/execute-long-running-ajax-task-after-page-is-loaded-tf4118823.html#a11713572
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 
 -- 
 Wicket joins the Apache Software Foundation as Apache Wicket
 Apache Wicket 1.3.0-beta2 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta2/
 
 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/execute-long-running-ajax-task-after-page-is-loaded-tf4118823.html#a11810638
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket user 
list. Send a message to: users-subscribe at wicket.apache.org and follow the 
instructions.
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] execute long running ajax task after page is loaded

2007-07-20 Thread jonaqua

The wicket ajax link examples are great.  The functionality I need is very
similar to the third link example here:

http://www.wicket-library.com/wicket-examples/ajax?wicket:bookmarkablePage=:wicket.examples.ajax.builtin.LinksPage

( ajax link with a busy indicator. the server will deliberately pause for
five seconds)

The only difference between my code and that example is that I substituted
my actual long running task for the example's Thread.sleep(5000).

Everything is working great but I have two questions:

1) I don't really want it to be a link.  I really just want my long running
task to be executed after the page is loaded and I want it to update some
label when it finishes.  Any hints on how I can do this?

2) Right now my long running task is executed in the link's
onClick(AjaxRequestTarget target) method just like the example.  Should this
be executed on a separate thread?

Thank you


-- 
View this message in context: 
http://www.nabble.com/execute-long-running-ajax-task-after-page-is-loaded-tf4118823.html#a11713572
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Passing parameters to a page in WicketTester

2007-07-19 Thread jonaqua

I'm a wicket newbie,

but this was in the javadoc for WicketTester (also your constructor name
'kisspage' doesn't match your class name 'mypage'):

 //test code
 public void testRenderYourPage()
 {
// provide page instance source for WicketTester
tester.startPage(new TestPageSource()
{
public Page getTestPage()
{
return new YourPage(mock message);
}
});
 
tester.assertRenderedPage(YourPage.class);
tester.assertLabel(yourMessage, mock message);
 
// assert feedback messages in INFO Level 
tester.assertInfoMessages(new String[] { Wicket Rocks ;-) });
 
 }
 

Instead of tester.startPage(pageClass), we define a ITestPageSource to
provide testing page instance for WicketTester. This is necessary because
YourPage uses a custom constructor, which is very common for transfering
model data, can not be instansiated by reflection. Finally, we use
assertInfoMessages to assert there is a feedback message Wicket Rocks ;-)
in INFO level. TODO General: Example usage of FormTester
-- 
View this message in context: 
http://www.nabble.com/Passing-parameters-to-a-page-in-WicketTester-tf496.html#a11690441
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Setting up project - images and stylesheets

2007-07-18 Thread jonaqua

I'd just use a wicket.markup.html.image.Image for each of the images, and
let wicket rewrite the src part of the img tag.  Then you can put whatever
you want in the src attribute.

Thanks.  Is that common practice?  It seems like it tightly couples the java
code with the design of the web page.  I thought the Image class was for
creating dynamic images - as that's all I've needed to use it for.  
-- 
View this message in context: 
http://www.nabble.com/Setting-up-project---images-and-stylesheets-tf4094209.html#a11679842
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Setting up project - images and stylesheets

2007-07-18 Thread jonaqua


Andrew Klochkov wrote:
 
 User ContextImage instead of Image for images in the web dir. BTW
 ContextImage could be stateless while making Image instance stateless is
 not so easy.
 

Thanks I'll have to take a look at it.  I'm still using 1.2.6 and I believe
ContextImage is only in 1.3.  (I thought it would be hard to learn 1.3 if
any of the examples are broken).

This seems to be closer to the solution be it still forces me tightly couple
the java and html code.  Shouldn't web designers be able to modify the HTML
'template' without touching any Java code?

I was hoping for something like a single application setting:

@Override
protected void init() {
this.getMarkupSettings().setImagesRelativeToRoot(true);
}



-- 
View this message in context: 
http://www.nabble.com/Setting-up-project---images-and-stylesheets-tf4094209.html#a11680016
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Setting up project - images and stylesheets

2007-07-18 Thread jonaqua

Thanks, using wicket:remove sounds like a good idea.  Unfortunately, my CSS
skills are really lacking - so maybe this will motivate me to learn how to
use CSS to layout pages instead of tables.

Either that or all my image references will look like this :)

wicket:remove ../../../../../src/main/webapp/images/logo.png
/wicket:remove images/logo.png 
-- 
View this message in context: 
http://www.nabble.com/Setting-up-project---images-and-stylesheets-tf4094209.html#a11680168
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Setting up project - images and stylesheets

2007-07-18 Thread jonaqua

Thanks Igor.

I don't believe this works offline (atleast under firefox in ubuntu).  It
works fine if I put a real web URL (i.e. http://www.google.com).

I've tried all sorts of combinations (relative and absolute).  I may be
specifying the absolute path incorrectly.  I tried 3 and 4 forward slashes
(since on linux root is '/')

href=file:///home/blah/blah, href=file:home/blah/blah,
href=../blah/blah.  Each time, I tried using /images/logo.png and
images/logo.png.  It seemed to ignore the base tag unless it specified an
http address.

head
titleMyTest/title
base href=file:///home/user/projects/mytest/web/
/head
body
lt;img src=images/logo.png/gt;
/body



igor.vaynberg wrote:
 
 simply do this
 
 have your images be relative
 
  images/logo.png 
 
 in runtime wicket will rewrite them to be relative to context root
 
 in devel time put this into head
 
 wicket:remove
 base href=../../../path/to/your/webapp/folder/
 /wicket:remove
 
 so at devel time your images will also be relative to context root.
 
 -igor
 
 
 On 7/16/07, jonaqua [EMAIL PROTECTED] wrote:


 I'm just getting started with Wicket.

 I'm not sure how I should best link to stylesheets and images in my
 NetBeans
 project.

 For example, if I have the following code in my MyPage.html page:

 lt;img src=images/logo.pnggt;

 ...and I run the application, the image will reference
 web/images/logo.png.
 However, if I just quickly view that HTML file, it will reference
 src/java/package/images/logo.png and the image link will be broken.

 Is there a good way to set up the project besides keeping duplicate
 images
 and stylesheets both in the source code dir and the web dir?

 I realize if I move the HTML files to the web directory the problem will
 be
 solved but I'm trying to stick with the Wicket way of doing things for
 now
 (.HTML right next to .java in the source)

 Thanks
 --
 View this message in context:
 http://www.nabble.com/Setting-up-project---images-and-stylesheets-tf4094209.html#a11641865
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Setting-up-project---images-and-stylesheets-tf4094209.html#a11681135
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Setting up project - images and stylesheets

2007-07-18 Thread jonaqua

While I could not get it to work completely offline.  As long as I have my
local webserver running, this works perfectly fine..  thanks so much! :)

head
titleMyTest/title
wicket:remove
base href=http://localhost:8080/MyProject/;
/wicket:remove
/head
body
lt;img src=images/logo.png/gt;
/body
-- 
View this message in context: 
http://www.nabble.com/Setting-up-project---images-and-stylesheets-tf4094209.html#a11681306
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] changing default wicket:link rendering

2007-07-01 Thread jonaqua

Hi all,

I'm fairly new to wicket - today's the first day I really dove into it.  I
have a very basic question.

The wicket:link tag automatically makes the current page in italics - like
in the navomatic example.  How can I customize this functionality?  i.e.
make the current page bold instead of in italics.  Amazingly, after a day of
messing with wicket, that's the only question I have.  I'm sure I'll have
more though...

Thanks

-- 
View this message in context: 
http://www.nabble.com/changing-default-wicket%3Alink-rendering-tf4010120.html#a11388330
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user