Re: [Wicket-user] Integrate Wicket into existing Spring MVC application

2007-04-24 Thread Igor Vaynberg

i dont know that much about springmvc, but if you mount your pages you
should be able to redirect to those urls without problems. but for that to
work you need to have your servlet properly mapped to /app/* or another
path. so if you mount a page to /some/page the actual url is /app/some/page.

in 1.3 you can use a filter and map it to /* so you can get rid of the /app
prefix.

-igor


On 4/24/07, Uladzimir Liashkevich <[EMAIL PROTECTED]> wrote:


Hi,

I have an existing web application based on Spring and Spring MVC. I've
seen a lot of articles describing how to integrate Spring and Wicket,
but haven't find one about integrating Wicket pages into Spring MVC
controller dispatch scheme.

What I'm trying to achieve is to dispatch certain URLs to Wicket pages
by means of Spring's DispatcherServlet.
The application already has a large set of URL-to-controller mappings.
The idea is that once a web page is implemented/migrated to Wicket, only
URL mapping has to be changed to dispatch to Wicket servlet.


web.xml:

  
DispatcherServlet

org.springframework.web.servlet.DispatcherServlet

1
  

  
DispatcherServlet
/*
  

Spring config:

  

  
wicketController
  

  

  

  

  
  myapplication.WicketApplication

  
  


Actually the URL /some/page is dispatched correctly, but Wicket engine
responds with error 404.
How could I accomplish my goal, or am I heading the wrong direction at
all?


Thanks,
Uladzimir.



-
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


Re: [Wicket-user] Is there a success message example?

2007-04-24 Thread mraible



Eelco Hillenius wrote:
> 
>> Does it do this with 1.2.6?
>>
>> When I don't have it, and I hit refresh after submitting a form, I get
>> the
>> good ol' "postdata" message from Firefox. If I add setRedirect(true),
>> there
>> is no message.
> 
> That's surprising. What does your application object look like?
> 
> The default IRequestCycleSettings.RenderStrategy setting for Wicket
> (since quite a long time) is to use
> IRequestCycleSettings#REDIRECT_TO_BUFFER. Did you change that to
> ONE_PASS_RENDER by any chance?
> 

Yes, I did. 

// Fixed SiteMesh:
http://spatula.net/blog/2006/10/wicket-sitemesh-feces-nocturnus.html
   
getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.ONE_PASS_RENDER);

It's likely be pretty easy to port when I have with SiteMesh to use the page
extension stuff that Wicket has, but I'm lazy. ;-)

Matt
-- 
View this message in context: 
http://www.nabble.com/Is-there-a-success-message-example--tf3642922.html#a10175198
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] Integrate Wicket into existing Spring MVC application

2007-04-24 Thread Uladzimir Liashkevich
Hi,

I have an existing web application based on Spring and Spring MVC. I've
seen a lot of articles describing how to integrate Spring and Wicket,
but haven't find one about integrating Wicket pages into Spring MVC
controller dispatch scheme.

What I'm trying to achieve is to dispatch certain URLs to Wicket pages
by means of Spring's DispatcherServlet.
The application already has a large set of URL-to-controller mappings.
The idea is that once a web page is implemented/migrated to Wicket, only
URL mapping has to be changed to dispatch to Wicket servlet.


web.xml:

  
DispatcherServlet

org.springframework.web.servlet.DispatcherServlet

1
  

  
DispatcherServlet
/*
  

Spring config:

  

  
wicketController
  

  

  

  

  
  myapplication.WicketApplication

  
  


Actually the URL /some/page is dispatched correctly, but Wicket engine
responds with error 404.
How could I accomplish my goal, or am I heading the wrong direction at
all?


Thanks,
Uladzimir.



-
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] Is there a success message example?

2007-04-24 Thread Igor Vaynberg

rofl, ok thats only three of the same response so far, lets see if we can
rack up some more. i wish gmail could tell you that someone is responding to
the same message you are. it does IM, why not this???

-igor


On 4/24/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:


On 4/25/07, mraible <[EMAIL PROTECTED]> wrote:
> Does it do this with 1.2.6?

> When I don't have it, and I hit refresh after submitting a form, I get
the
> good ol' "postdata" message from Firefox. If I add setRedirect(true),
there
> is no message.

If you haven't changed the default render strategy it should work. I
just fired up my released wicket-examples (1.2.6) and the form input
example works without post back upon back button presses.

Martijn

--
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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


Re: [Wicket-user] Is there a success message example?

2007-04-24 Thread Martijn Dashorst
On 4/25/07, mraible <[EMAIL PROTECTED]> wrote:
> Does it do this with 1.2.6?

> When I don't have it, and I hit refresh after submitting a form, I get the
> good ol' "postdata" message from Firefox. If I add setRedirect(true), there
> is no message.

If you haven't changed the default render strategy it should work. I
just fired up my released wicket-examples (1.2.6) and the form input
example works without post back upon back button presses.

Martijn

-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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] Is there a success message example?

2007-04-24 Thread Eelco Hillenius
> Does it do this with 1.2.6?
>
> When I don't have it, and I hit refresh after submitting a form, I get the
> good ol' "postdata" message from Firefox. If I add setRedirect(true), there
> is no message.

That's surprising. What does your application object look like?

The default IRequestCycleSettings.RenderStrategy setting for Wicket
(since quite a long time) is to use
IRequestCycleSettings#REDIRECT_TO_BUFFER. Did you change that to
ONE_PASS_RENDER by any chance?

Eelco

-
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] Is there a success message example?

2007-04-24 Thread Igor Vaynberg

its been doing that since before 1.0 afaik. in fact i dont even remember
what that dialog looks like anymore :)

did you mess with render strategies at all? i think if you change the strat
to one-pass-render it might not do it for you.

-igor

On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:





igor.vaynberg wrote:
>
> On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>>
>> >
>> > You typically don't need to call setRedirect yourself though. Was
>> > there any reason for doing that? Also, flash message works good here,
>> > but if you already know the page you are going to display it on, you
>> > might as well set it on there.
>> >
>> >
>>
>> I'm using setRedirect(true) in order to do redirect-after-post so
>> clicking
>> refresh on the browser doesn't prompt the user.
>
> what eelco meant to say is that wicket does redirect-after-post for you
by
> default, thus no need for you to bother with it.
>

Does it do this with 1.2.6?

When I don't have it, and I hit refresh after submitting a form, I get the
good ol' "postdata" message from Firefox. If I add setRedirect(true),
there
is no message.

Matt
--
View this message in context:
http://www.nabble.com/Is-there-a-success-message-example--tf3642922.html#a10175013
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


Re: [Wicket-user] Is there a success message example?

2007-04-24 Thread mraible



igor.vaynberg wrote:
> 
> On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>>
>> >
>> > You typically don't need to call setRedirect yourself though. Was
>> > there any reason for doing that? Also, flash message works good here,
>> > but if you already know the page you are going to display it on, you
>> > might as well set it on there.
>> >
>> >
>>
>> I'm using setRedirect(true) in order to do redirect-after-post so
>> clicking
>> refresh on the browser doesn't prompt the user.
> 
> what eelco meant to say is that wicket does redirect-after-post for you by
> default, thus no need for you to bother with it.
> 

Does it do this with 1.2.6? 

When I don't have it, and I hit refresh after submitting a form, I get the
good ol' "postdata" message from Firefox. If I add setRedirect(true), there
is no message.

Matt
-- 
View this message in context: 
http://www.nabble.com/Is-there-a-success-message-example--tf3642922.html#a10175013
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] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Martijn Dashorst
For more information on the redirect strategies available in Wicket
(that we don't have any documentation is a lie ;-)) see:

http://cwiki.apache.org/WICKET/render-strategies.html

Martijn

-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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] Updating items of a Set...

2007-04-24 Thread Eelco Hillenius
> So, the need is basically to browse a set to be able to
> increase/decrease the value of each element. So, for each element, it
> should look like this:
> ElementName
> ElementValue  + -
>
> + and – are links that the user can click on.
>
> Then I would like a submit button under this to be able to submit the
> whole stuff. As I'm Ajax curious, I would like the action on the + or
> – to be done through Ajax.

> Currently, I'm using a RefreshingView with, for each element of the
> Set, some Labels (elementName, elementValue) and an action panel with
> two AjaxLink, one for "plus" and one for "minus".

Sounds good.

> Up to now, I manage to retrieve on which AjaxLink the user has
> clicked, but I don't manage to refresh the RefreshingView afterwards.
> I've two issues : how to tell the View to refresh and how to deal with
> the model, since I want to update it but not to save it to the
> database…NB : I give to the Panel containing the RefreshingView the
> model object containing the set.
>
> Do you have any comment/question/clue ?

Yep, it's one of the common questions here. Please read
http://cwiki.apache.org/WICKET/how-to-repaint-a-listview-via-ajax.html

Eelco

-
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] Getting error java.lang.ClassCastException: wicket.util.tester.WicketTester

2007-04-24 Thread Eelco Hillenius
Can you give us the stack trace you get?

Eelco

On 4/24/07, Akshat <[EMAIL PROTECTED]> wrote:
>
> Providing the source class and its corresponding Test class
>
> package com.bsideinc.bsidecom.wicket.pages.sections;
>
> import com.bsideinc.bsidecom.wicket.pages.DefaultBsidePage;
>
> /**
>  * User: gutter
>  * Date: Feb 8, 2007
>  * Time: 1:38:03 PM
>  */
> public class DefaultHomePage extends DefaultBsidePage {
>
>
> public static final String HOME = "home";
>
> public String getSection() {
> return HOME;
> }
>
> public String getTitle() {
> return "B-Side Home";
> }
>
> }
>
> Test Class
>
> package com.bsideinc.bsidecom.wicket.pages.sections;
>
> import wicket.util.tester.WicketTester;
> import junit.framework.TestCase;
>
> public class TestDefaultHomePage extends TestCase{
> //private DefaultHomePage testDeafDefaultHomePage = new 
> DefaultHomePage();
> private WicketTester tester;
>
> public TestDefaultHomePage(){
> super ("Test DefaultHomePage class");
> }
>
> protected void setUp(){
> tester = new WicketTester();
> }
>
> public void testgetTitle(){
> tester.startPage(DefaultHomePage.class);
> tester.assertRenderedPage(DefaultHomePage.class);
> //tester.assertNoErrorMessage();
> //System.out.println("" + 
> testDeafDefaultHomePage.getTitle() );
> }
>
> }
> --
> View this message in context: 
> http://www.nabble.com/Getting-error-java.lang.ClassCastException%3A-wicket.util.tester.WicketTester-tf3638328.html#a10159802
> 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


Re: [Wicket-user] Is there a success message example?

2007-04-24 Thread Igor Vaynberg

On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:


>
> You typically don't need to call setRedirect yourself though. Was
> there any reason for doing that? Also, flash message works good here,
> but if you already know the page you are going to display it on, you
> might as well set it on there.
>
>

I'm using setRedirect(true) in order to do redirect-after-post so clicking
refresh on the browser doesn't prompt the user.



what eelco meant to say is that wicket does redirect-after-post for you by
default, thus no need for you to bother with it.

-igor
-
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] Is there a success message example?

2007-04-24 Thread mraible

Got it - I needed getSession().info() instead of info(). Thanks guys - I
really appreciate the excellent support.

Matt


mraible wrote:
> 
> 
> 
> Eelco Hillenius wrote:
>> 
>>> I'm trying to success messages working.  In my Detail.java page, I have:
>>>
>>> protected void onSaveUser(User user) {
>>> userManager.saveUser(user);
>>> getSession().info("It worked!");
>>> setRedirect(true);
>>> setResponsePage(backPage);
>>> }
>>>
>>> First of all, is this the proper way to put messages in flash scope?
>> 
>> Yep.
>> 
>> You typically don't need to call setRedirect yourself though. Was
>> there any reason for doing that? Also, flash message works good here,
>> but if you already know the page you are going to display it on, you
>> might as well set it on there.
>> 
>> 
> 
> I'm using setRedirect(true) in order to do redirect-after-post so clicking
> refresh on the browser doesn't prompt the user.
> 
> 
> Eelco Hillenius wrote:
>> 
>> 
>>> On my "backPage", I have the following code, but it never seems to find
>>> anything.
>>>
>>> // check for success messages
>>> if (!getSession().getFeedbackMessages().isEmpty()) {
>>> // just display first message for now
>>> add(new Label("success-messages",
>>> String.valueOf(getSession().getFeedbackMessages().iterator().next(;
>>> } else {
>>> add(new Label("success-messages", ""));
>>> }
>> 
>> That's definitively not the way to do it :)
>> 
>> First of all, that code - if it would work - would obviously only take
>> the first message. If you want to display an arbitrary list of things,
>> you should use ListViews or Repeaters.
>> 
>> But more importantly, you should just use a FeedbackPanel. Typically,
>> add(new FeedbackPanel("feedback")); does the trick. If you need more
>> fine grained control over which messages to display, you can create it
>> with a IFeedbackMessageFilter. Also, not relevant for this case, but
>> take a look at FormComponentFeedbackBorder as well.
>> 
>> 
> 
> I tried adding that in the page I'm routing to, but not dice - the span
> shows up, but there's nothing it in:
> 
> public UserList() {
> setPageTitle(TITLE);
> 
> add(new FeedbackPanel("feedback"));
> ...
> 
> It really is strange because it seems like it should work.
> 
> Thanks,
> 
> Matt
> 
> 
> Eelco Hillenius wrote:
>> 
>> 
>> Another note is that the way you do labels in your example is rather
>> static. Typically you should try to use models that work in a 'pull'
>> way (gets the results just in time/ when rendering).
>> 
>> Take this code (which is comparable to what you did):
>> 
>> SomeObject foo = ...
>> if (foo != null) {
>>   add(new Label("foo", foo.toString));
>> } else {
>>   add(new Label("foo", ""));
>> }
>> 
>> rather you should do:
>> 
>> SomeObject foo = bar.getFoo();
>> add(new Label("foo", new Model(foo)));
>> 
>> or more dynamic (evaluated on every request)
>> 
>> add(new Label("foo", new PropertyModel(bar, "foo")));
>> 
>> or even
>> 
>> add(new Label("foo", new AbstractReadOnlyModel(){
>>   public Object getObject() {
>> return bar.getFoo();
>>   }
>> });
>> 
>> for complete control.
>> 
>> Hope that helps,
>> 
>> Eelco
>> 
>> -
>> 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/Is-there-a-success-message-example--tf3642922.html#a10174595
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] Is there a success message example?

2007-04-24 Thread mraible



Eelco Hillenius wrote:
> 
>> I'm trying to success messages working.  In my Detail.java page, I have:
>>
>> protected void onSaveUser(User user) {
>> userManager.saveUser(user);
>> getSession().info("It worked!");
>> setRedirect(true);
>> setResponsePage(backPage);
>> }
>>
>> First of all, is this the proper way to put messages in flash scope?
> 
> Yep.
> 
> You typically don't need to call setRedirect yourself though. Was
> there any reason for doing that? Also, flash message works good here,
> but if you already know the page you are going to display it on, you
> might as well set it on there.
> 
> 

I'm using setRedirect(true) in order to do redirect-after-post so clicking
refresh on the browser doesn't prompt the user.


Eelco Hillenius wrote:
> 
> 
>> On my "backPage", I have the following code, but it never seems to find
>> anything.
>>
>> // check for success messages
>> if (!getSession().getFeedbackMessages().isEmpty()) {
>> // just display first message for now
>> add(new Label("success-messages",
>> String.valueOf(getSession().getFeedbackMessages().iterator().next(;
>> } else {
>> add(new Label("success-messages", ""));
>> }
> 
> That's definitively not the way to do it :)
> 
> First of all, that code - if it would work - would obviously only take
> the first message. If you want to display an arbitrary list of things,
> you should use ListViews or Repeaters.
> 
> But more importantly, you should just use a FeedbackPanel. Typically,
> add(new FeedbackPanel("feedback")); does the trick. If you need more
> fine grained control over which messages to display, you can create it
> with a IFeedbackMessageFilter. Also, not relevant for this case, but
> take a look at FormComponentFeedbackBorder as well.
> 
> 

I tried adding that in the page I'm routing to, but not dice - the span
shows up, but there's nothing it in:

public UserList() {
setPageTitle(TITLE);

add(new FeedbackPanel("feedback"));
...

It really is strange because it seems like it should work.

Thanks,

Matt


Eelco Hillenius wrote:
> 
> 
> Another note is that the way you do labels in your example is rather
> static. Typically you should try to use models that work in a 'pull'
> way (gets the results just in time/ when rendering).
> 
> Take this code (which is comparable to what you did):
> 
> SomeObject foo = ...
> if (foo != null) {
>   add(new Label("foo", foo.toString));
> } else {
>   add(new Label("foo", ""));
> }
> 
> rather you should do:
> 
> SomeObject foo = bar.getFoo();
> add(new Label("foo", new Model(foo)));
> 
> or more dynamic (evaluated on every request)
> 
> add(new Label("foo", new PropertyModel(bar, "foo")));
> 
> or even
> 
> add(new Label("foo", new AbstractReadOnlyModel(){
>   public Object getObject() {
> return bar.getFoo();
>   }
> });
> 
> for complete control.
> 
> Hope that helps,
> 
> Eelco
> 
> -
> 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/Is-there-a-success-message-example--tf3642922.html#a10174556
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] Is there a success message example?

2007-04-24 Thread Igor Vaynberg

for a full crud app wicket+spring+hibernate/ibatis/shades see
wicket-phonebook project in wicket-stuff.sf.net
it has the feedback messages and grids you want.

also for models you can read here
http://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models

-igor


On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:



I'm trying to success messages working.  In my Detail.java page, I have:

protected void onSaveUser(User user) {
userManager.saveUser(user);
getSession().info("It worked!");
setRedirect(true);
setResponsePage(backPage);
}

First of all, is this the proper way to put messages in flash scope?

On my "backPage", I have the following code, but it never seems to find
anything.

// check for success messages
if (!getSession().getFeedbackMessages().isEmpty()) {
// just display first message for now
add(new Label("success-messages",
String.valueOf(getSession().getFeedbackMessages().iterator().next(;
} else {
add(new Label("success-messages", ""));
}

Thanks,

Matt
--
View this message in context:
http://www.nabble.com/Is-there-a-success-message-example--tf3642922.html#a10173842
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


[Wicket-user] problem with browser back-button and links after ajax replace

2007-04-24 Thread Peter Thomas

Hi,

I'm having this problem when I back-button to a page with a panel that
replaced itself with another panel containing a link - and re-try the link:

WicketMessage: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at component
[MarkupContainer [Component id = link, page = test.HomePage, path = 0:panel:
link.FirstPanel$1, isVisible = true, isVersioned = true]] threw an exception


Root cause:

java.lang.IllegalArgumentException: object is not an instance of declaring
class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (
NativeMethodAccessorImpl.java:39)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.wicket.RequestListenerInterface.invoke(
RequestListenerInterface.java:186)
at
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(
ListenerInterfaceRequestTarget.java:73)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:90)
at org.apache.wicket.RequestCycle.processEventsAndRespond
(RequestCycle.java:975)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127)
at org.apache.wicket.RequestCycle.request(RequestCycle.java :489)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248)


I have a quickstart.  I think attachments are not allowed on the mailing
list, so I created a JIRA and uploaded an attachment.  Do let me know if
there is a better way to send a quickstart to the mailing list.  I'm using
wicket 1.3.0-SNAPSHOT

https://issues.apache.org/jira/browse/WICKET-491

Thanks,

Peter.
-
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] Is there a success message example?

2007-04-24 Thread Eelco Hillenius
> I'm trying to success messages working.  In my Detail.java page, I have:
>
> protected void onSaveUser(User user) {
> userManager.saveUser(user);
> getSession().info("It worked!");
> setRedirect(true);
> setResponsePage(backPage);
> }
>
> First of all, is this the proper way to put messages in flash scope?

Yep.

You typically don't need to call setRedirect yourself though. Was
there any reason for doing that? Also, flash message works good here,
but if you already know the page you are going to display it on, you
might as well set it on there.

> On my "backPage", I have the following code, but it never seems to find
> anything.
>
> // check for success messages
> if (!getSession().getFeedbackMessages().isEmpty()) {
> // just display first message for now
> add(new Label("success-messages",
> String.valueOf(getSession().getFeedbackMessages().iterator().next(;
> } else {
> add(new Label("success-messages", ""));
> }

That's definitively not the way to do it :)

First of all, that code - if it would work - would obviously only take
the first message. If you want to display an arbitrary list of things,
you should use ListViews or Repeaters.

But more importantly, you should just use a FeedbackPanel. Typically,
add(new FeedbackPanel("feedback")); does the trick. If you need more
fine grained control over which messages to display, you can create it
with a IFeedbackMessageFilter. Also, not relevant for this case, but
take a look at FormComponentFeedbackBorder as well.

Another note is that the way you do labels in your example is rather
static. Typically you should try to use models that work in a 'pull'
way (gets the results just in time/ when rendering).

Take this code (which is comparable to what you did):

SomeObject foo = ...
if (foo != null) {
  add(new Label("foo", foo.toString));
} else {
  add(new Label("foo", ""));
}

rather you should do:

SomeObject foo = bar.getFoo();
add(new Label("foo", new Model(foo)));

or more dynamic (evaluated on every request)

add(new Label("foo", new PropertyModel(bar, "foo")));

or even

add(new Label("foo", new AbstractReadOnlyModel(){
  public Object getObject() {
return bar.getFoo();
  }
});

for complete control.

Hope that helps,

Eelco

-
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] Is there a success message example?

2007-04-24 Thread Nick Heudecker

You can just add a FeedbackPanel to the Page:

add(new FeedbackPanel("feedback"));



Then call your info(...), error(...) or whatever method:

info("It Worked!");

I haven't worked with 1.3 yet, so I don't know if anything has changed
there.

On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:



I'm trying to success messages working.  In my Detail.java page, I have:

protected void onSaveUser(User user) {
userManager.saveUser(user);
getSession().info("It worked!");
setRedirect(true);
setResponsePage(backPage);
}

First of all, is this the proper way to put messages in flash scope?

On my "backPage", I have the following code, but it never seems to find
anything.

// check for success messages
if (!getSession().getFeedbackMessages().isEmpty()) {
// just display first message for now
add(new Label("success-messages",
String.valueOf(getSession().getFeedbackMessages().iterator().next(;
} else {
add(new Label("success-messages", ""));
}

Thanks,

Matt
--
View this message in context:
http://www.nabble.com/Is-there-a-success-message-example--tf3642922.html#a10173842
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





--
Nick Heudecker
Professional Wicket Training & Consulting
http://www.systemmobile.com

Eventful - Intelligent Event Management
http://www.eventfulhq.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] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Eelco Hillenius
Fresh snapshots are deployed on our maven repository[1] by bamboo[2] .

So including:


  
wicket-stuff.org
http://wicketstuff.org/maven/repository/

  true

  


and:


  org.apache.wicket
wicket
1.3.0-incubating-SNAPSHOT


should do the trick.

There could still be a problem with our snapshot meta data, so you
might want to delete any existing jars when you're looking for an
update[3]

Eelco

[1] http://wicketstuff.org/maven/repository/ (e.g.
http://wicketstuff.org/maven/repository/org/apache/wicket/wicket/1.3.0-incubating-SNAPSHOT/)
[2] http://wicketstuff.org/bamboo/
[3] find ~/.m2/repository/org/apache/wicket -name
"1.3.0-incubating-SNAPSHOT" | xargs rm -rf


On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>
> The stack trace I was getting turned out to be caused by something else - the
> code I posted actually does work.
>
> As far as moving to 1.3, I'll be happy to do that if there's a beta (or
> snapshot) release in a public Maven repo.
>
> Thanks,
>
> Matt
>
>
> Eelco Hillenius wrote:
> >
> >> Thanks guys - I appreciate all your help.  I've decided to go with
> >> DataView
> >> over DefaultDataTable because I couldn't get the "click on column value
> >> for
> >> link"[1] to work.
> >>
> >> Unfortunately, the following doesn't work with Wicket 1.2.6:
> >>
> >> item.add(new AttributeModifier("class",
> >> true, new AbstractReadOnlyModel()
> >> {
> >> public Object getObject()
> >> {
> >> return (item.getIndex() %
> >> 2
> >> == 1) ? "even" : "odd";
> >> }
> >> }));
> >
> > That's correct. IModel#getObject() is Wicket 1.3 code; in Wicket 1.2
> > we had getObject(Component).
> >
> > There are quite a few differences between 1.3 and 1.2 (more than
> > initially planned, but you can read about that in the archives and on
> > ).
> >
> > A migration document from 1.2 to 1.3 can be found here
> > http://cwiki.apache.org/WICKET/migrate-13.html
> >
> > If you're starting out, I'd strongly encourage you to use 1.3. There
> > are many improvements in it, and we're getting very close to doing a
> > release (which at this stage will also be used to propose graduation
> > with Apache, or at least get a step further in that).
> >
> >> I tried the following (I'm a complete newbie, so sorry if this is dumb),
> >> but
> >> it doesn't work:
> >>
> >> public Object getObject(Component component) {
> >> Item item = (Item) component;
> >> return (item.getIndex() % 2 == 1) ? "even" :
> >> "odd";
> >> }
> >
> > Like I said, I think it is better if you use 1.3, but in 1.2 you the
> > component argument would be the component the behavior is added to.
> > I'm not sure whether that is the Item?
> >
> > If it is, what doesn't work? Is the CSS availalbe etc? Or do you get
> > an exception?
> >
> > Eelco
> >
> > -
> > 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/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10173898
> 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


Re: [Wicket-user] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread mraible

The stack trace I was getting turned out to be caused by something else - the
code I posted actually does work.

As far as moving to 1.3, I'll be happy to do that if there's a beta (or
snapshot) release in a public Maven repo.

Thanks,

Matt


Eelco Hillenius wrote:
> 
>> Thanks guys - I appreciate all your help.  I've decided to go with
>> DataView
>> over DefaultDataTable because I couldn't get the "click on column value
>> for
>> link"[1] to work.
>>
>> Unfortunately, the following doesn't work with Wicket 1.2.6:
>>
>> item.add(new AttributeModifier("class",
>> true, new AbstractReadOnlyModel()
>> {
>> public Object getObject()
>> {
>> return (item.getIndex() %
>> 2
>> == 1) ? "even" : "odd";
>> }
>> }));
> 
> That's correct. IModel#getObject() is Wicket 1.3 code; in Wicket 1.2
> we had getObject(Component).
> 
> There are quite a few differences between 1.3 and 1.2 (more than
> initially planned, but you can read about that in the archives and on
> ).
> 
> A migration document from 1.2 to 1.3 can be found here
> http://cwiki.apache.org/WICKET/migrate-13.html
> 
> If you're starting out, I'd strongly encourage you to use 1.3. There
> are many improvements in it, and we're getting very close to doing a
> release (which at this stage will also be used to propose graduation
> with Apache, or at least get a step further in that).
> 
>> I tried the following (I'm a complete newbie, so sorry if this is dumb),
>> but
>> it doesn't work:
>>
>> public Object getObject(Component component) {
>> Item item = (Item) component;
>> return (item.getIndex() % 2 == 1) ? "even" :
>> "odd";
>> }
> 
> Like I said, I think it is better if you use 1.3, but in 1.2 you the
> component argument would be the component the behavior is added to.
> I'm not sure whether that is the Item?
> 
> If it is, what doesn't work? Is the CSS availalbe etc? Or do you get
> an exception?
> 
> Eelco
> 
> -
> 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/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10173898
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] Is there a success message example?

2007-04-24 Thread mraible

I'm trying to success messages working.  In my Detail.java page, I have:

protected void onSaveUser(User user) {
userManager.saveUser(user);
getSession().info("It worked!");
setRedirect(true);
setResponsePage(backPage);
}

First of all, is this the proper way to put messages in flash scope?

On my "backPage", I have the following code, but it never seems to find
anything.

// check for success messages
if (!getSession().getFeedbackMessages().isEmpty()) {
// just display first message for now
add(new Label("success-messages",
String.valueOf(getSession().getFeedbackMessages().iterator().next(;
} else {
add(new Label("success-messages", ""));
}

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Is-there-a-success-message-example--tf3642922.html#a10173842
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] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Eelco Hillenius
> Thanks guys - I appreciate all your help.  I've decided to go with DataView
> over DefaultDataTable because I couldn't get the "click on column value for
> link"[1] to work.
>
> Unfortunately, the following doesn't work with Wicket 1.2.6:
>
> item.add(new AttributeModifier("class",
> true, new AbstractReadOnlyModel()
> {
> public Object getObject()
> {
> return (item.getIndex() % 2
> == 1) ? "even" : "odd";
> }
> }));

That's correct. IModel#getObject() is Wicket 1.3 code; in Wicket 1.2
we had getObject(Component).

There are quite a few differences between 1.3 and 1.2 (more than
initially planned, but you can read about that in the archives and on
).

A migration document from 1.2 to 1.3 can be found here
http://cwiki.apache.org/WICKET/migrate-13.html

If you're starting out, I'd strongly encourage you to use 1.3. There
are many improvements in it, and we're getting very close to doing a
release (which at this stage will also be used to propose graduation
with Apache, or at least get a step further in that).

> I tried the following (I'm a complete newbie, so sorry if this is dumb), but
> it doesn't work:
>
> public Object getObject(Component component) {
> Item item = (Item) component;
> return (item.getIndex() % 2 == 1) ? "even" : "odd";
> }

Like I said, I think it is better if you use 1.3, but in 1.2 you the
component argument would be the component the behavior is added to.
I'm not sure whether that is the Item?

If it is, what doesn't work? Is the CSS availalbe etc? Or do you get
an exception?

Eelco

-
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] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread mraible

Thanks guys - I appreciate all your help.  I've decided to go with DataView
over DefaultDataTable because I couldn't get the "click on column value for
link"[1] to work.

Unfortunately, the following doesn't work with Wicket 1.2.6:

item.add(new AttributeModifier("class",
true, new AbstractReadOnlyModel()
{
public Object getObject()
{
return (item.getIndex() % 2
== 1) ? "even" : "odd";
}
})); 

I tried the following (I'm a complete newbie, so sorry if this is dumb), but
it doesn't work:

public Object getObject(Component component) {
Item item = (Item) component;
return (item.getIndex() % 2 == 1) ? "even" : "odd";
}

Matt

[1] http://tinyurl.com/yw3e5l


Matej Knopp-2 wrote:
> 
> Hi,
> 
> the code for sortable pageable list can look like this:
> 
> public class SortingPage extends BasePage
> {
> 
>   public SortingPage()
>   {
>   SortableContactDataProvider dp = new 
> SortableContactDataProvider();
>   final DataView dataView = new DataView("sorting", dp)
>   {
>   protected void populateItem(final Item item)
>   {
>   Contact contact = 
> (Contact)item.getModelObject();
>   item.add(new ActionPanel("actions", 
> item.getModel()));
>   item.add(new Label("contactid", 
> String.valueOf(contact.getId(;
>   item.add(new Label("firstname", 
> contact.getFirstName()));
>   item.add(new Label("lastname", 
> contact.getLastName()));
>   item.add(new Label("homephone", 
> contact.getHomePhone()));
>   item.add(new Label("cellphone", 
> contact.getCellPhone()));
> 
>   item.add(new AttributeModifier("class", true, 
> new
> AbstractReadOnlyModel()
>   {
>   public Object getObject()
>   {
>   return (item.getIndex() % 2 == 
> 1) ? "even" : "odd";
>   }
>   }));
>   }
>   };
> 
>   dataView.setItemsPerPage(8);
> 
>   add(new OrderByBorder("orderByFirstName", "firstName", dp));
> 
>   add(new OrderByBorder("orderByLastName", "lastName", dp));
> 
>   add(dataView);
> 
>   add(new PagingNavigator("navigator", dataView));
>   }
> }
> 
> -Matej
> 
> On 4/25/07, mraible <[EMAIL PROTECTED]> wrote:
>>
>> That site has a way to view the source of the templates, but not the Java
>> code. Anywhere I can download that?
>>
>> What's the least amount of required classes to do a sortable/pageable
>> grid
>> with i18n?  Compared to all the other web frameworks I've used, Wicket
>> seems
>> to make this the most difficult. Stripes is 30 lines of Java code and 20
>> lines of JSP. ;-)
>>
>> I know, I know - Wicket gives you a much more powerful way to do grids -
>> but
>> does it offer a simplistic grid as well?
>>
>> Thanks,
>>
>> Matt
>>
>>
>> igor.vaynberg wrote:
>> >
>> > see
>> >
>> > http://wicketstuff.org/wicket13/repeater/
>> >
>> > namely the datatable example
>> >
>> > -igor
>> >
>> >
>> > On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> What's the easiest way to do a pageable/sortable list with
>> >> Wicket?  Looking
>> >> at the following example, there's quite a few files required to
>> replicate
>> >> the DisplayTag's functionality.
>> >>
>> >> http://www.wicket-library.com/wicket-examples/displaytag
>> >>
>> >> Is this packaged up as a component I can use?
>> >>
>> >> The other example I found was "wicket_crud" and it seems to require 4
>> >> Java
>> >> files just for a list screen - not example simple in my mind. ;-)
>> >>
>> >> Matt
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
>> >> 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/list

Re: [Wicket-user] question on localization

2007-04-24 Thread John Krasnay
Ah, yes, this is much better. It bothered me enough to put a warning in
the Javadoc, but that's a poor substitute for something that just works.
I'll be fixing our code in the morning. Thanks Igor.

jk

On Tue, Apr 24, 2007 at 11:00:05AM -0700, Igor Vaynberg wrote:
> this is bad. getpagetitle() might get called from a partially constructed
> object
> 
> it should be
> 
>public BasePage() {
>add(new Label("pageHeaderTitle", new pagetitlemodel()));
>}
> 
>private class pagetitlemodel extends abstractreadonlymodel {
>object getobject() { return getpagetitle().getobject(); }
>void detach() { getpagetitle().detach(); }
> }
> 
> -igor
> 
> On 4/24/07, John Krasnay <[EMAIL PROTECTED]> wrote:
> >
> >You might want to make it so you can dynamically generate a page title
> >where you need to, instead of always requiring a static page title. The
> >trick is to return an IModel from the getPageTitle method in your base
> >page. Here's how I've done it:
> >
> >Foo
> >
> >public class BasePage extends WebPage {
> >
> >public BasePage() {
> >add(new Label("pageHeaderTitle", getPageTitle()));
> >}
> >
> >public IModel getPageTitle() {
> >return new ResourceModel("page.title");
> >}
> >}
> >
> >jk
> >
> >On Tue, Apr 24, 2007 at 10:33:54AM +0900, David Leangen wrote:
> >> > i tried to use Label() with PropertyModel("pageTitle") but didn't work
> >for
> >> > me.  it rendered "Home" string all the time, no matter what the locale
> >was.
> >> > any ideas how to do this?
> >>
> >> You can do something like this:
> >>
> >> new Label( componentId, new StringResourceModel( "pageTitle", this, new
> >> Model() ) );
> >>
> >> In your properties file:
> >> pageTitle=Home
> >>
> >> In your html:
> >> Dummy text
> >>
> >>
> >> Look for StringResourceModel in ProWicket or in the API docs.
> >>
> >>
> >> HTH
> >> Dave
> >>
> >>
> >>
> >>
> >>
> >-
> >> 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
> >

> -
> 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


Re: [Wicket-user] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Igor Vaynberg

On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:



That site has a way to view the source of the templates, but not the Java
code. Anywhere I can download that?



what i pointed to is the wicket-examples project. the source code is
available in our svn. the link to that is available on our site.

What's the least amount of required classes to do a sortable/pageable grid

with i18n?  Compared to all the other web frameworks I've used, Wicket
seems
to make this the most difficult. Stripes is 30 lines of Java code and 20
lines of JSP. ;-)



let me paste the code and we can count together, the snippet is from
DataTablePage.java

1List columns = new ArrayList();

2   columns.add(new AbstractColumn(new Model("Actions"))
   {
3  public void populateItem(Item cellItem, String componentId,
IModel model) {
4 cellItem.add(new ActionPanel(componentId, model));
   }
   });

5columns.add(new PropertyColumn(new Model("ID"), "id"));
6columns.add(new PropertyColumn(new Model("First Name"),
"firstName", "firstName"));
7columns.add(new PropertyColumn(new Model("Last Name"), "lastName",
"lastName"));
8columns.add(new PropertyColumn(new Model("Home Phone"),
"homePhone"));
9columns.add(new PropertyColumn(new Model("Cell Phone"),
"cellPhone"));

10add(new DefaultDataTable("table", columns, new
SortableContactDataProvider(), 8));

DataTablePage.html
1 [table]

I know, I know - Wicket gives you a much more powerful way to do grids - but

does it offer a simplistic grid as well?



so for a quickndirty pageable/sortable grid you get 10 lines of java and 1
line of markup.

-igor



Thanks,


Matt


igor.vaynberg wrote:
>
> see
>
> http://wicketstuff.org/wicket13/repeater/
>
> namely the datatable example
>
> -igor
>
>
> On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>>
>>
>> What's the easiest way to do a pageable/sortable list with
>> Wicket?  Looking
>> at the following example, there's quite a few files required to
replicate
>> the DisplayTag's functionality.
>>
>> http://www.wicket-library.com/wicket-examples/displaytag
>>
>> Is this packaged up as a component I can use?
>>
>> The other example I found was "wicket_crud" and it seems to require 4
>> Java
>> files just for a list screen - not example simple in my mind. ;-)
>>
>> Matt
>> --
>> View this message in context:
>>
http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
>> 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/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10171203
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


Re: [Wicket-user] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Matej Knopp
Hi,

the code for sortable pageable list can look like this:

public class SortingPage extends BasePage
{

public SortingPage()
{
SortableContactDataProvider dp = new 
SortableContactDataProvider();
final DataView dataView = new DataView("sorting", dp)
{
protected void populateItem(final Item item)
{
Contact contact = 
(Contact)item.getModelObject();
item.add(new ActionPanel("actions", 
item.getModel()));
item.add(new Label("contactid", 
String.valueOf(contact.getId(;
item.add(new Label("firstname", 
contact.getFirstName()));
item.add(new Label("lastname", 
contact.getLastName()));
item.add(new Label("homephone", 
contact.getHomePhone()));
item.add(new Label("cellphone", 
contact.getCellPhone()));

item.add(new AttributeModifier("class", true, 
new AbstractReadOnlyModel()
{
public Object getObject()
{
return (item.getIndex() % 2 == 
1) ? "even" : "odd";
}
}));
}
};

dataView.setItemsPerPage(8);

add(new OrderByBorder("orderByFirstName", "firstName", dp));

add(new OrderByBorder("orderByLastName", "lastName", dp));

add(dataView);

add(new PagingNavigator("navigator", dataView));
}
}

-Matej

On 4/25/07, mraible <[EMAIL PROTECTED]> wrote:
>
> That site has a way to view the source of the templates, but not the Java
> code. Anywhere I can download that?
>
> What's the least amount of required classes to do a sortable/pageable grid
> with i18n?  Compared to all the other web frameworks I've used, Wicket seems
> to make this the most difficult. Stripes is 30 lines of Java code and 20
> lines of JSP. ;-)
>
> I know, I know - Wicket gives you a much more powerful way to do grids - but
> does it offer a simplistic grid as well?
>
> Thanks,
>
> Matt
>
>
> igor.vaynberg wrote:
> >
> > see
> >
> > http://wicketstuff.org/wicket13/repeater/
> >
> > namely the datatable example
> >
> > -igor
> >
> >
> > On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> What's the easiest way to do a pageable/sortable list with
> >> Wicket?  Looking
> >> at the following example, there's quite a few files required to replicate
> >> the DisplayTag's functionality.
> >>
> >> http://www.wicket-library.com/wicket-examples/displaytag
> >>
> >> Is this packaged up as a component I can use?
> >>
> >> The other example I found was "wicket_crud" and it seems to require 4
> >> Java
> >> files just for a list screen - not example simple in my mind. ;-)
> >>
> >> Matt
> >> --
> >> View this message in context:
> >> http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
> >> 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/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10171203
> 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.

Re: [Wicket-user] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Eelco Hillenius
You can check out the wicket-examples code from svn at
https://svn.apache.org/repos/asf/incubator/wicket/trunk/jdk-1.5/wicket-examples
(or download it, but where's the fun in that) and then check out
package org.apache.wicket.examples.repeater or
org.apache.wicket.examples.guestbook etc.

Eelco

On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>
> That site has a way to view the source of the templates, but not the Java
> code. Anywhere I can download that?
>
> What's the least amount of required classes to do a sortable/pageable grid
> with i18n?  Compared to all the other web frameworks I've used, Wicket seems
> to make this the most difficult. Stripes is 30 lines of Java code and 20
> lines of JSP. ;-)
>
> I know, I know - Wicket gives you a much more powerful way to do grids - but
> does it offer a simplistic grid as well?
>
> Thanks,
>
> Matt
>
>
> igor.vaynberg wrote:
> >
> > see
> >
> > http://wicketstuff.org/wicket13/repeater/
> >
> > namely the datatable example
> >
> > -igor
> >
> >
> > On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> What's the easiest way to do a pageable/sortable list with
> >> Wicket?  Looking
> >> at the following example, there's quite a few files required to replicate
> >> the DisplayTag's functionality.
> >>
> >> http://www.wicket-library.com/wicket-examples/displaytag
> >>
> >> Is this packaged up as a component I can use?
> >>
> >> The other example I found was "wicket_crud" and it seems to require 4
> >> Java
> >> files just for a list screen - not example simple in my mind. ;-)
> >>
> >> Matt
> >> --
> >> View this message in context:
> >> http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
> >> 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/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10171203
> 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


Re: [Wicket-user] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread mraible

That site has a way to view the source of the templates, but not the Java
code. Anywhere I can download that?

What's the least amount of required classes to do a sortable/pageable grid
with i18n?  Compared to all the other web frameworks I've used, Wicket seems
to make this the most difficult. Stripes is 30 lines of Java code and 20
lines of JSP. ;-)

I know, I know - Wicket gives you a much more powerful way to do grids - but
does it offer a simplistic grid as well? 

Thanks,

Matt


igor.vaynberg wrote:
> 
> see
> 
> http://wicketstuff.org/wicket13/repeater/
> 
> namely the datatable example
> 
> -igor
> 
> 
> On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:
>>
>>
>> What's the easiest way to do a pageable/sortable list with
>> Wicket?  Looking
>> at the following example, there's quite a few files required to replicate
>> the DisplayTag's functionality.
>>
>> http://www.wicket-library.com/wicket-examples/displaytag
>>
>> Is this packaged up as a component I can use?
>>
>> The other example I found was "wicket_crud" and it seems to require 4
>> Java
>> files just for a list screen - not example simple in my mind. ;-)
>>
>> Matt
>> --
>> View this message in context:
>> http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
>> 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/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10171203
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] Logging Out (What to do with the session)

2007-04-24 Thread Francisco Diaz Trepat - gmail

In the message that I sent I am sure that the text that Igor sent was
included.

if not here it is:

Igor Vaynberg wrote::
onclick() {
  final string url=urlfor(HomePage.class);
  getsession().invalidate();
  getrequestcycle().pushTarget(new RedirectRequestTarget(url));
}

Only this:
getRequestCycle().setRequestTarget(new RedirectRequestTarget(url));

Instead of this:
getrequestcycle().pushTarget

That is what I meant.

On 4/24/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:


> Great, both of them worked.
>
> Only this:
>
> getRequestCycle().setRequestTarget(new
> RedirectRequestTarget(url));

What do you mean?

Eelco

-
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


Re: [Wicket-user] Logging Out (What to do with the session)

2007-04-24 Thread Eelco Hillenius
> Great, both of them worked.
>
> Only this:
>
> getRequestCycle().setRequestTarget(new
> RedirectRequestTarget(url));

What do you mean?

Eelco

-
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] Logging Out (What to do with the session)

2007-04-24 Thread Francisco Diaz Trepat - gmail

Great, both of them worked.

Only this:

getRequestCycle().setRequestTarget(new RedirectRequestTarget(url));



On 4/24/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:


> onclick() {
>final string url=urlfor(HomePage.class);
>getsession().invalidate();
>getrequestcycle().pushTarget(new
> RedirectRequestTarget(url));
> }

Or just

onClick() {
  Session.get().invalidate(); // invalidated after the request is handled
  setResponsePage(Home.class);
}

This works for sure when your home page is stateless (and bookmarkable
of course). And I think it should work in other cases as well. If not,
you can try Session.get().invalidateNow();

Eelco

-
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


Re: [Wicket-user] Logging Out (What to do with the session)

2007-04-24 Thread Eelco Hillenius
> onclick() {
>final string url=urlfor(HomePage.class);
>getsession().invalidate();
>getrequestcycle().pushTarget(new
> RedirectRequestTarget(url));
> }

Or just

onClick() {
  Session.get().invalidate(); // invalidated after the request is handled
  setResponsePage(Home.class);
}

This works for sure when your home page is stateless (and bookmarkable
of course). And I think it should work in other cases as well. If not,
you can try Session.get().invalidateNow();

Eelco

-
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] Logging Out (What to do with the session)

2007-04-24 Thread Francisco Diaz Trepat - gmail

Off the top of your head again?

¬_¬ (me needs that head).

Great thanks.

On 4/24/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:


yes i would invalidate the session:

onclick() {
   final string url=urlfor(HomePage.class);
   getsession().invalidate();
   getrequestcycle().pushTarget(new RedirectRequestTarget(url));
}

something like that

-igor


On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:

> Hello everyone, I was wondering for a proper way to handle sessions and
> logging in and out of a wicket application in general.
>
> The thing is as follows.
>
> I have a Session called WicketSession, inside of which I use a CORBA
> BUISINESS object labeled m_cSession to do a Login.
>
> WicketSession has the following two methods:
>
>/**
> * Terminates the logged user for this Session.
> */
>public void logout() {
>   //Verify user isn't logged out already
>   if (!m_bUserLoggedIn) {
>  return;
>   }
>   //Execute a logout
>   try {
>  m_cSession.logout();
>  m_bUserLoggedIn = false;
>  m_cSessionLocale = Locale.getDefault();
>   }
>   catch (Exception xException) {
>  m_bUserLoggedIn = false;
>  m_cSessionLocale = Locale.getDefault();
>   }
>}
>
>/**
> * Initiates logged user for this Session.
> */
>public void login(String sUserId, String sUserPassword) {
>   //Verify input data and that the user isn't logged in already
>   if (m_bUserLoggedIn || sUserId == null || sUserPassword == null) {
>  m_bUserLoggedIn = false;
>  return;
>   }
>   //Execute a login
>   try {
>  //create a session
>  m_cSession = new ch.logismata.serverwrapper.Session();
>  //set user and password
>  m_cSession.setId(sUserId);
>  m_cSession.setPassword(sUserPassword);
>  //Execute and verify login
>  if (m_cSession.login() != null) {
> m_bUserLoggedIn = true;
>  }
>   } catch (Exception xException) {
>  m_bUserLoggedIn = false;
>   }
>}
>
>
> ...
>
> Very plain. The thing is this, Session also maintains certain state
> already in wicket, and a question was:
>
> Should I invalidate the session? If I do, can I redirect the user to a
> "Home Page" where he would get a new session going-on?
>
> Is this a proper approach?
>
> Usually when I close the Tab on my Firefox and I Call to the site, the
> Session is also remembered as the Locale is maintain as that of the last
> state (before I close the tab).
>
> Why is this?
>
> Sorry if my questions may feel sordid.
>
> f(t)
>
>
> -
> 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


-
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] Logging Out (What to do with the session)

2007-04-24 Thread Igor Vaynberg

yes i would invalidate the session:

onclick() {
  final string url=urlfor(HomePage.class);
  getsession().invalidate();
  getrequestcycle().pushTarget(new RedirectRequestTarget(url));
}

something like that

-igor


On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:


Hello everyone, I was wondering for a proper way to handle sessions and
logging in and out of a wicket application in general.

The thing is as follows.

I have a Session called WicketSession, inside of which I use a CORBA
BUISINESS object labeled m_cSession to do a Login.

WicketSession has the following two methods:

   /**
* Terminates the logged user for this Session.
*/
   public void logout() {
  //Verify user isn't logged out already
  if (!m_bUserLoggedIn) {
 return;
  }
  //Execute a logout
  try {
 m_cSession.logout();
 m_bUserLoggedIn = false;
 m_cSessionLocale = Locale.getDefault();
  }
  catch (Exception xException) {
 m_bUserLoggedIn = false;
 m_cSessionLocale = Locale.getDefault();
  }
   }

   /**
* Initiates logged user for this Session.
*/
   public void login(String sUserId, String sUserPassword) {
  //Verify input data and that the user isn't logged in already
  if (m_bUserLoggedIn || sUserId == null || sUserPassword == null) {
 m_bUserLoggedIn = false;
 return;
  }
  //Execute a login
  try {
 //create a session
 m_cSession = new ch.logismata.serverwrapper.Session();
 //set user and password
 m_cSession.setId(sUserId);
 m_cSession.setPassword(sUserPassword);
 //Execute and verify login
 if (m_cSession.login() != null) {
m_bUserLoggedIn = true;
 }
  } catch (Exception xException) {
 m_bUserLoggedIn = false;
  }
   }


...

Very plain. The thing is this, Session also maintains certain state
already in wicket, and a question was:

Should I invalidate the session? If I do, can I redirect the user to a
"Home Page" where he would get a new session going-on?

Is this a proper approach?

Usually when I close the Tab on my Firefox and I Call to the site, the
Session is also remembered as the Locale is maintain as that of the last
state (before I close the tab).

Why is this?

Sorry if my questions may feel sordid.

f(t)

-
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


[Wicket-user] Logging Out (What to do with the session)

2007-04-24 Thread Francisco Diaz Trepat - gmail

Hello everyone, I was wondering for a proper way to handle sessions and
logging in and out of a wicket application in general.

The thing is as follows.

I have a Session called WicketSession, inside of which I use a CORBA
BUISINESS object labeled m_cSession to do a Login.

WicketSession has the following two methods:

  /**
   * Terminates the logged user for this Session.
   */
  public void logout() {
 //Verify user isn't logged out already
 if (!m_bUserLoggedIn) {
return;
 }
 //Execute a logout
 try {
m_cSession.logout();
m_bUserLoggedIn = false;
m_cSessionLocale = Locale.getDefault();
 }
 catch (Exception xException) {
m_bUserLoggedIn = false;
m_cSessionLocale = Locale.getDefault();
 }
  }

  /**
   * Initiates logged user for this Session.
   */
  public void login(String sUserId, String sUserPassword) {
 //Verify input data and that the user isn't logged in already
 if (m_bUserLoggedIn || sUserId == null || sUserPassword == null) {
m_bUserLoggedIn = false;
return;
 }
 //Execute a login
 try {
//create a session
m_cSession = new ch.logismata.serverwrapper.Session();
//set user and password
m_cSession.setId(sUserId);
m_cSession.setPassword(sUserPassword);
//Execute and verify login
if (m_cSession.login() != null) {
   m_bUserLoggedIn = true;
}
 } catch (Exception xException) {
m_bUserLoggedIn = false;
 }
  }


...

Very plain. The thing is this, Session also maintains certain state already
in wicket, and a question was:

Should I invalidate the session? If I do, can I redirect the user to a "Home
Page" where he would get a new session going-on?

Is this a proper approach?

Usually when I close the Tab on my Firefox and I Call to the site, the
Session is also remembered as the Locale is maintain as that of the last
state (before I close the tab).

Why is this?

Sorry if my questions may feel sordid.

f(t)
-
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] How do I show/hide row

2007-04-24 Thread john . mattucci
Ok figured it out. I set  ListView.setReuseItems(true); and it works.

Thanks again for all your help



   
 john.mattuc   
 [EMAIL PROTECTED]  
   
 Sent by:   To 
 wicket-user wicket-user@lists.sourceforge.net 
 [EMAIL PROTECTED]
cc 
 sts.sourcef   
 orge.net  Subject 
 Re: [Wicket-user] How do I show/hide row  
   
 04/24/2007
 11:30 AM  
   
   
   Please  
 respond to
 wicket-user   
 @lists.sour   
 ceforge.net   
   
   




I tried what you suggested i.e. swap a different fragment in but I can't
seem to get it to work. I have the following. When I click on the delete
link I want fragment1 to be replaced with fragment2. However fragment2
remains and is shifted to the right. What am I missing or doing wrong?
Thanks again.

 

  
  

  
  
  
  
  
  

public class Fragment1 extends Fragment {
public Fragment1(String id, String markupId, ...) {
super(id, markupId);
add(new ModalWindowPanel("userSearchPanel", value));
add(new CheckBox("admin",...);
add(new DeletePanel("deletePanel", ..));
}
}

public class Fragment2 extends Fragment {
  ..
add(new Label("label", "Hello, World!"));
}
}

private class DeletePanel extends Panel {
  deleteItem = new AjaxLink("deleteItem") {

 public void onClick(AjaxRequestTarget target) {
f2 = new Fragment2("panel", "fragment2");
DeletePanel.this.getParent().getParent().replace(f2);
target.addComponent(listContainer);//WebMarkupContainer




 "Igor
 Vaynberg"
 cc
 Sent by:
 wicket-user   Subject
 [EMAIL PROTECTED] Re: [Wicket-user] How do I show/hide row
 sts.sourcef
 orge.net


 04/23/2007
 10:47 AM


   Please
 respond to
 wicket-user
 @lists.sour
 ceforge.net






what you have below seems pretty reasonable. if it is more then just links
changing i would swap a different fragment in, but it looks like overkill
for your case.

-igor

On 4/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  I have a table which contains a list of users. At the end of each row
  there
  is an delete/undo link. When the user clicks delete I want to hide the
  row
  and replace it with only the undo link. What would be the best way to do
  this? Thanks for your time.

  view = new ListView("rows", data) {
public void populateItem(ListItem listItem) {
  UserType value = (UserType
  )listItem.getModelObject();
  listItem.add(new
  ModalWindowPanel("userSearchPanel", value));

  listItem.add(new CheckBox("admin", new Model(new
  Boolean(value.isAdmin();
  listItem.add(new
  DeleteUndoPanel("deleteUndoPanel",
  listItem.getModel()));
}
  };


  private class DeleteUndoPanel extends Panel {


  public DeleteUndoPanel(String id, final IModel model) {
super(id, model);
setOutputMarkupId(true);
final UserType type = (UserType)this.getModelObject();

undoItem = new AjaxLink("undoItem") {

  @Override
public boolean isVisible() {
  
   }

  public voi

[Wicket-user] Validation of Date Range with DateValidator.

2007-04-24 Thread Francisco Diaz Trepat - gmail

Hi again group, I have the following problem. I use a DateValidator.range(min,
max) to add a validation to a text field.

Everything works fine, but as soon as I change the locale to german, french,
or italian, it does not validate again. It keeps validating wether or not is
required but not the range.

What could it be?

Is it because I don't have the proper message under the german and french
locales but the messages are there for the default locale (in this case
english) ? could this be?

Here is the code:

...


   //Create date of birth label, text field, and date picker
   WebMarkupContainer dateOfBirthLabel = new
WebMarkupContainer("dateOfBirthLabel");
   //add label
   form.add(dateOfBirthLabel);
   //create textfield - validate it with the Date type
   TextField dateOfBirth = new TextField("dateOfBirth", Date.class);
   //add a validator for range between a person born a maximum of 100
years ago and today
   
dateOfBirth.add(DateValidator.range(getMinimumDateAllowedForDateOfBirth(),
getMaximumDateAllowedForDateOfBirth()));
   //set also as required
   dateOfBirth.setRequired(true);
   //add the textfield
   form.add(dateOfBirth);
   //Create DatePicker
   DatePicker datePicker = new DatePicker("datePicker",
dateOfBirthLabel, dateOfBirth);
   //create date converter
   DateConverter dateConverter = new DateConverter();
   //Set the DateFormat and Locales
   dateConverter.setDateFormat(getWicketSession().getLocale(), new
SimpleDateFormat("dd.MM."));
   //asign the converter to the date picker
   datePicker.setDateConverter(dateConverter);
   //Add the datepicker
   form.add(datePicker);





   private Date getMinimumDateAllowedForDateOfBirth(){
   Calendar now = Calendar.getInstance();
   now.add(Calendar.YEAR, -MAXIMUM_LIFE_EXPECTANCY);
//MAXIMUM_LIFE_EXPECTANCY=100
   return now.getTime();
   }
   private Date getMaximumDateAllowedForDateOfBirth(){
   Calendar now = Calendar.getInstance();
   return now.getTime();
   }


f(t)
-
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 Visible (setVisible) inside onAttach(). Is this Right?

2007-04-24 Thread Francisco Diaz Trepat - gmail

Great, thanks Igor.

On 4/24/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:


yes, any time the component is rendered

-igor


On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED] >
wrote:
>
> Excelent. That means that isVisible is called every """page
> refresh"""?
>
> Thanks
>
> On 4/24/07, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
> >
> > change
> >
> > protected void onAttach() {
> >   //Verify visible status
> >   setVisible(getWicketSession().isUserLoggedIn());
> >}
> >
> > to
> >
> > boolean isVisible() { return getWicketSession().isUserLoggedIn(); }
> >
> > imho that is better
> >
> > -igor
> >
> >
> >
> > On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hi, I have this working code. But I feel I'am mistaking and this is
> > > not the most apropiate place for it.
> > >
> > > Very simple, a logout panel (just a link) that on attached sets
> > > itself visible or not. Here is the code.
> > >
> > >
> > > public class LogoutPanel extends BasePanel {
> > >
> > >/** Creates a new instance of LogoutPanel */
> > >public LogoutPanel(String id) {
> > >   super(id);
> > >   //Create logout link
> > >   Link cLogoutLink = new Link("logoutLink") {
> > >  //Logout action
> > >  public void onClick() {
> > > //Logout
> > > getWicketSession().logout();
> > >
> > > setResponsePage(Index.class);
> > >  }
> > >   };
> > >   //add class attribute.
> > >   cLogoutLink.add(new AttributeModifier("class", true, new
> > > AbstractReadOnlyModel() {
> > > public Object getObject(Component component) {
> > > return "headerWiteLink";
> > > }
> > > }));
> > >   //add the logoutLink
> > >   add(cLogoutLink);
> > >}
> > >
> > >protected void onAttach() {
> > >   //Verify visible status
> > >   setVisible(getWicketSession().isUserLoggedIn());
> > >}
> > >
> > > }
> > >
> > >
> > > This works fine, but is it the correct way of doing this?
> > >
> > > Some comments on it could really help.
> > >
> > > f(t)
> > >
> > >
> > >
> > > -
> > > 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
> >
> >
>
>
> -
> 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


-
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] DropDownChoice & Ajax to render 1 of 3 forms

2007-04-24 Thread John Carlson
Calling repaint on the entire panel did the job.
target.addComponent(dropdown.getParent()) Thanks 

 

John

 

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor
Vaynberg
Sent: Tuesday, April 24, 2007 8:38 AM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] DropDownChoice & Ajax to render 1 of 3 forms

 

do forms start out as invisible when the page renders first? if so try
calling setoutputmarkupplaceholdertag(true) on them, or repaint their
common parent.

-igor

On 4/24/07, John Carlson <[EMAIL PROTECTED]> wrote:

I have a page with a DropDownChoice box and 3 Forms.  The Forms and
DropDownChoice belong to the same Panel.  I would like to only show one
Form at a time via the selection made on the DropDownChoice box.  I have
added a AjaxFormComponentUpdatingBehavior "onchange" to the
DropDownChoice and overridden the onUpdate function to set the
visibility of each Form appropriate to the DropDownChoice and did a
target.addComponent on each Form to ask it to render.   I can trace the
visibilities being changed but no Form is ever rendered.

 

Thanks In Advance

 

John



-
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


Re: [Wicket-user] Setting Visible (setVisible) inside onAttach(). Is this Right?

2007-04-24 Thread Igor Vaynberg

yes, any time the component is rendered

-igor


On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:


Excelent. That means that isVisible is called every """page
refresh"""?

Thanks

On 4/24/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> change
>
> protected void onAttach() {
>   //Verify visible status
>   setVisible(getWicketSession().isUserLoggedIn());
>}
>
> to
>
> boolean isVisible() { return getWicketSession().isUserLoggedIn(); }
>
> imho that is better
>
> -igor
>
>
>
> On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
> wrote:
>
> > Hi, I have this working code. But I feel I'am mistaking and this is
> > not the most apropiate place for it.
> >
> > Very simple, a logout panel (just a link) that on attached sets itself
> > visible or not. Here is the code.
> >
> >
> > public class LogoutPanel extends BasePanel {
> >
> >/** Creates a new instance of LogoutPanel */
> >public LogoutPanel(String id) {
> >   super(id);
> >   //Create logout link
> >   Link cLogoutLink = new Link("logoutLink") {
> >  //Logout action
> >  public void onClick() {
> > //Logout
> > getWicketSession().logout();
> >
> > setResponsePage(Index.class);
> >  }
> >   };
> >   //add class attribute.
> >   cLogoutLink.add(new AttributeModifier("class", true, new
> > AbstractReadOnlyModel() {
> > public Object getObject(Component component) {
> > return "headerWiteLink";
> > }
> > }));
> >   //add the logoutLink
> >   add(cLogoutLink);
> >}
> >
> >protected void onAttach() {
> >   //Verify visible status
> >   setVisible(getWicketSession().isUserLoggedIn());
> >}
> >
> > }
> >
> >
> > This works fine, but is it the correct way of doing this?
> >
> > Some comments on it could really help.
> >
> > f(t)
> >
> >
> >
> > -
> > 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
>
>

-
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


Re: [Wicket-user] Setting Visible (setVisible) inside onAttach(). Is this Right?

2007-04-24 Thread Francisco Diaz Trepat - gmail

Excelent. That means that isVisible is called every """page
refresh"""?

Thanks

On 4/24/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:


change

protected void onAttach() {
  //Verify visible status
  setVisible(getWicketSession().isUserLoggedIn());
   }

to

boolean isVisible() { return getWicketSession().isUserLoggedIn(); }

imho that is better

-igor



On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:

> Hi, I have this working code. But I feel I'am mistaking and this is not
> the most apropiate place for it.
>
> Very simple, a logout panel (just a link) that on attached sets itself
> visible or not. Here is the code.
>
>
> public class LogoutPanel extends BasePanel {
>
>/** Creates a new instance of LogoutPanel */
>public LogoutPanel(String id) {
>   super(id);
>   //Create logout link
>   Link cLogoutLink = new Link("logoutLink") {
>  //Logout action
>  public void onClick() {
> //Logout
> getWicketSession().logout();
>
> setResponsePage(Index.class);
>  }
>   };
>   //add class attribute.
>   cLogoutLink.add(new AttributeModifier("class", true, new
> AbstractReadOnlyModel() {
> public Object getObject(Component component) {
> return "headerWiteLink";
> }
> }));
>   //add the logoutLink
>   add(cLogoutLink);
>}
>
>protected void onAttach() {
>   //Verify visible status
>   setVisible(getWicketSession().isUserLoggedIn());
>}
>
> }
>
>
> This works fine, but is it the correct way of doing this?
>
> Some comments on it could really help.
>
> f(t)
>
>
>
> -
> 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


-
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 Visible (setVisible) inside onAttach(). Is this Right?

2007-04-24 Thread Igor Vaynberg

change

protected void onAttach() {
 //Verify visible status
 setVisible(getWicketSession().isUserLoggedIn());
  }

to

boolean isVisible() { return getWicketSession().isUserLoggedIn(); }

imho that is better

-igor



On 4/24/07, Francisco Diaz Trepat - gmail <[EMAIL PROTECTED]>
wrote:


Hi, I have this working code. But I feel I'am mistaking and this is not
the most apropiate place for it.

Very simple, a logout panel (just a link) that on attached sets itself
visible or not. Here is the code.


public class LogoutPanel extends BasePanel {

   /** Creates a new instance of LogoutPanel */
   public LogoutPanel(String id) {
  super(id);
  //Create logout link
  Link cLogoutLink = new Link("logoutLink") {
 //Logout action
 public void onClick() {
//Logout
getWicketSession().logout();

setResponsePage(Index.class);
 }
  };
  //add class attribute.
  cLogoutLink.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel() {
public Object getObject(Component component) {
return "headerWiteLink";
}
}));
  //add the logoutLink
  add(cLogoutLink);
   }

   protected void onAttach() {
  //Verify visible status
  setVisible(getWicketSession().isUserLoggedIn());
   }

}


This works fine, but is it the correct way of doing this?

Some comments on it could really help.

f(t)


-
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


[Wicket-user] Setting Visible (setVisible) inside onAttach(). Is this Right?

2007-04-24 Thread Francisco Diaz Trepat - gmail

Hi, I have this working code. But I feel I'am mistaking and this is not the
most apropiate place for it.

Very simple, a logout panel (just a link) that on attached sets itself
visible or not. Here is the code.


public class LogoutPanel extends BasePanel {

  /** Creates a new instance of LogoutPanel */
  public LogoutPanel(String id) {
 super(id);
 //Create logout link
 Link cLogoutLink = new Link("logoutLink") {
//Logout action
public void onClick() {
   //Logout
   getWicketSession().logout();

   setResponsePage(Index.class);
}
 };
 //add class attribute.
 cLogoutLink.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel() {
   public Object getObject(Component component) {
   return "headerWiteLink";
   }
   }));
 //add the logoutLink
 add(cLogoutLink);
  }

  protected void onAttach() {
 //Verify visible status
 setVisible(getWicketSession().isUserLoggedIn());
  }

}


This works fine, but is it the correct way of doing this?

Some comments on it could really help.

f(t)
-
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] question on localization

2007-04-24 Thread Igor Vaynberg

this is bad. getpagetitle() might get called from a partially constructed
object

it should be

   public BasePage() {
   add(new Label("pageHeaderTitle", new pagetitlemodel()));
   }

   private class pagetitlemodel extends abstractreadonlymodel {
   object getobject() { return getpagetitle().getobject(); }
   void detach() { getpagetitle().detach(); }
}

-igor

On 4/24/07, John Krasnay <[EMAIL PROTECTED]> wrote:


You might want to make it so you can dynamically generate a page title
where you need to, instead of always requiring a static page title. The
trick is to return an IModel from the getPageTitle method in your base
page. Here's how I've done it:

Foo

public class BasePage extends WebPage {

public BasePage() {
add(new Label("pageHeaderTitle", getPageTitle()));
}

public IModel getPageTitle() {
return new ResourceModel("page.title");
}
}

jk

On Tue, Apr 24, 2007 at 10:33:54AM +0900, David Leangen wrote:
> > i tried to use Label() with PropertyModel("pageTitle") but didn't work
for
> > me.  it rendered "Home" string all the time, no matter what the locale
was.
> > any ideas how to do this?
>
> You can do something like this:
>
> new Label( componentId, new StringResourceModel( "pageTitle", this, new
> Model() ) );
>
> In your properties file:
> pageTitle=Home
>
> In your html:
> Dummy text
>
>
> Look for StringResourceModel in ProWicket or in the API docs.
>
>
> HTH
> Dave
>
>
>
>
>
-
> 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

-
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] Sending Emails Via Wicket?

2007-04-24 Thread Nick Heudecker

This should get you started:

http://www.theserverside.com/tt/blogs/showblog.tss?id=SpringVelocityEmail
-
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] question on localization

2007-04-24 Thread John Krasnay
You might want to make it so you can dynamically generate a page title
where you need to, instead of always requiring a static page title. The
trick is to return an IModel from the getPageTitle method in your base
page. Here's how I've done it:

Foo

public class BasePage extends WebPage {

public BasePage() {
add(new Label("pageHeaderTitle", getPageTitle()));
}

public IModel getPageTitle() {
return new ResourceModel("page.title");
}
}

jk

On Tue, Apr 24, 2007 at 10:33:54AM +0900, David Leangen wrote:
> > i tried to use Label() with PropertyModel("pageTitle") but didn't work for 
> > me.  it rendered "Home" string all the time, no matter what the locale was.
> > any ideas how to do this?
> 
> You can do something like this:
> 
> new Label( componentId, new StringResourceModel( "pageTitle", this, new
> Model() ) );
> 
> In your properties file:
> pageTitle=Home
> 
> In your html:
> Dummy text
> 
> 
> Look for StringResourceModel in ProWicket or in the API docs.
> 
> 
> HTH
> Dave
> 
> 
> 
> 
> -
> 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


Re: [Wicket-user] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread Igor Vaynberg

see

http://wicketstuff.org/wicket13/repeater/

namely the datatable example

-igor


On 4/24/07, mraible <[EMAIL PROTECTED]> wrote:



What's the easiest way to do a pageable/sortable list with
Wicket?  Looking
at the following example, there's quite a few files required to replicate
the DisplayTag's functionality.

http://www.wicket-library.com/wicket-examples/displaytag

Is this packaged up as a component I can use?

The other example I found was "wicket_crud" and it seems to require 4 Java
files just for a list screen - not example simple in my mind. ;-)

Matt
--
View this message in context:
http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
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


Re: [Wicket-user] Help: Creating a Apache-licensed Wysiwyg-Textarea for Wicket

2007-04-24 Thread Thomas R. Corbin
On Tuesday 24 April 2007 2:14 am, Johan Compagner escreveu:
> > And I  also admit that  I don't have  the same patience  as yours,
> > providing code snippets all the  time, answering to every question
> > with such accuracy :-)
> >
> > Congratulations, Igor!
>
> +1  Igor for president!

+1 Thanks to all of you.

-
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] Sending Emails Via Wicket?

2007-04-24 Thread Nathan Hamblen
This is not a particularly beautiful, finished, or even 
properly-indented (not sure how that happened) implementation but it 
does manage to send me text emails with templated contents including 
URLs going back into Wicket:

http://databinder.net/wsvn/Databinder/typeturner/trunk/src/main/java/com/typeturner/service/Notify.java?op=file

(The mail() method only. You probably don't need to ping Technorati!)

Nathan

fattymelt wrote:
> I understand. I'm using the wicket-contrib-velocity package for some page
> generation, but I am unsure how I would generate a template /just/ for an
> email. Would you have an example of that? Or be able to point me to a
> tutorial, etc.?
> 
> Much appreciated.
> 
> 
> Eelco Hillenius wrote:
>> For the actual sending, you need to use Java's normal mail API
>> (http://java.sun.com/products/javamail/) or e.g. Spring's mail module.
>>
>> If you want to create emails based on templates with some variable
>> substibution, I'd recommend you use e.g. Velocity for that.
>>
>> Eelco
>>
>>
>>> I DID search in the forums, and couldn't find reference to sending emails
>>> from within the framework.  I did find a post where someone mentioned
>>> writing there own class for doing this.
>>>
>>> Does that mean there isn't any "built-in" classes that handle sending of
>>> emails from within Wicket?  If not, can someone provide a solution or
>>> example of how I might accomplish this? I am a newbie to Wicket, and even
>>> a
>>> little to Java in general, so any help or reference points would be very
>>> much appreciated.
>>>
>>> Specifically, I need to send an email from within Wicket, where the email
>>> contains some dynamic data I would "insert" before sending.
>>>
>>> Thanks!


-
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] What's the easiest way to do a pageable/sortable list screen?

2007-04-24 Thread mraible

What's the easiest way to do a pageable/sortable list with Wicket?  Looking
at the following example, there's quite a few files required to replicate
the DisplayTag's functionality.

http://www.wicket-library.com/wicket-examples/displaytag

Is this packaged up as a component I can use?

The other example I found was "wicket_crud" and it seems to require 4 Java
files just for a list screen - not example simple in my mind. ;-)

Matt
-- 
View this message in context: 
http://www.nabble.com/What%27s-the-easiest-way-to-do-a-pageable-sortable-list-screen--tf3639929.html#a10165178
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] DropDownChoice & Ajax to render 1 of 3 forms

2007-04-24 Thread Igor Vaynberg

do forms start out as invisible when the page renders first? if so try
calling setoutputmarkupplaceholdertag(true) on them, or repaint their common
parent.

-igor

On 4/24/07, John Carlson <[EMAIL PROTECTED]> wrote:


 I have a page with a DropDownChoice box and 3 Forms.  The Forms and
DropDownChoice belong to the same Panel.  I would like to only show one Form
at a time via the selection made on the DropDownChoice box.  I have added a
AjaxFormComponentUpdatingBehavior "onchange" to the DropDownChoice and
overridden the onUpdate function to set the visibility of each Form
appropriate to the DropDownChoice and did a target.addComponent on each
Form to ask it to render.   I can trace the visibilities being changed but
no Form is ever rendered.



Thanks In Advance



John

-
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


[Wicket-user] DropDownChoice & Ajax to render 1 of 3 forms

2007-04-24 Thread John Carlson
I have a page with a DropDownChoice box and 3 Forms.  The Forms and
DropDownChoice belong to the same Panel.  I would like to only show one
Form at a time via the selection made on the DropDownChoice box.  I have
added a AjaxFormComponentUpdatingBehavior "onchange" to the
DropDownChoice and overridden the onUpdate function to set the
visibility of each Form appropriate to the DropDownChoice and did a
target.addComponent on each Form to ask it to render.   I can trace the
visibilities being changed but no Form is ever rendered.

 

Thanks In Advance

 

John

-
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] Sending Emails Via Wicket?

2007-04-24 Thread fattymelt

I understand. I'm using the wicket-contrib-velocity package for some page
generation, but I am unsure how I would generate a template /just/ for an
email. Would you have an example of that? Or be able to point me to a
tutorial, etc.?

Much appreciated.


Eelco Hillenius wrote:
> 
> For the actual sending, you need to use Java's normal mail API
> (http://java.sun.com/products/javamail/) or e.g. Spring's mail module.
> 
> If you want to create emails based on templates with some variable
> substibution, I'd recommend you use e.g. Velocity for that.
> 
> Eelco
> 
> 
>> I DID search in the forums, and couldn't find reference to sending emails
>> from within the framework.  I did find a post where someone mentioned
>> writing there own class for doing this.
>>
>> Does that mean there isn't any "built-in" classes that handle sending of
>> emails from within Wicket?  If not, can someone provide a solution or
>> example of how I might accomplish this? I am a newbie to Wicket, and even
>> a
>> little to Java in general, so any help or reference points would be very
>> much appreciated.
>>
>> Specifically, I need to send an email from within Wicket, where the email
>> contains some dynamic data I would "insert" before sending.
>>
>> Thanks!
>> --
>> View this message in context:
>> http://www.nabble.com/Sending-Emails-Via-Wicket--tf3639601.html#a10164083
>> 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/Sending-Emails-Via-Wicket--tf3639601.html#a10164511
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] Sending Emails Via Wicket?

2007-04-24 Thread Eelco Hillenius
For the actual sending, you need to use Java's normal mail API
(http://java.sun.com/products/javamail/) or e.g. Spring's mail module.

If you want to create emails based on templates with some variable
substibution, I'd recommend you use e.g. Velocity for that.

Eelco


> I DID search in the forums, and couldn't find reference to sending emails
> from within the framework.  I did find a post where someone mentioned
> writing there own class for doing this.
>
> Does that mean there isn't any "built-in" classes that handle sending of
> emails from within Wicket?  If not, can someone provide a solution or
> example of how I might accomplish this? I am a newbie to Wicket, and even a
> little to Java in general, so any help or reference points would be very
> much appreciated.
>
> Specifically, I need to send an email from within Wicket, where the email
> contains some dynamic data I would "insert" before sending.
>
> Thanks!
> --
> View this message in context: 
> http://www.nabble.com/Sending-Emails-Via-Wicket--tf3639601.html#a10164083
> 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


[Wicket-user] Sending Emails Via Wicket?

2007-04-24 Thread fattymelt

I DID search in the forums, and couldn't find reference to sending emails
from within the framework.  I did find a post where someone mentioned
writing there own class for doing this.

Does that mean there isn't any "built-in" classes that handle sending of
emails from within Wicket?  If not, can someone provide a solution or
example of how I might accomplish this? I am a newbie to Wicket, and even a
little to Java in general, so any help or reference points would be very
much appreciated.

Specifically, I need to send an email from within Wicket, where the email
contains some dynamic data I would "insert" before sending.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Sending-Emails-Via-Wicket--tf3639601.html#a10164083
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] How do I show/hide row

2007-04-24 Thread john . mattucci
I tried what you suggested i.e. swap a different fragment in but I can't
seem to get it to work. I have the following. When I click on the delete
link I want fragment1 to be replaced with fragment2. However fragment2
remains and is shifted to the right. What am I missing or doing wrong?
Thanks again.

 

  
  

  
  
  
  
  
  

public class Fragment1 extends Fragment {
public Fragment1(String id, String markupId, ...) {
super(id, markupId);
add(new ModalWindowPanel("userSearchPanel", value));
add(new CheckBox("admin",...);
add(new DeletePanel("deletePanel", ..));
}
}

public class Fragment2 extends Fragment {
  ..
add(new Label("label", "Hello, World!"));
}
}

private class DeletePanel extends Panel {
  deleteItem = new AjaxLink("deleteItem") {

 public void onClick(AjaxRequestTarget target) {
f2 = new Fragment2("panel", "fragment2");
DeletePanel.this.getParent().getParent().replace(f2);
target.addComponent(listContainer);//WebMarkupContainer



   
 "Igor 
 Vaynberg" 
 cc 
 Sent by:  
 wicket-user   Subject 
 [EMAIL PROTECTED] Re: [Wicket-user] How do I show/hide row 
 
 sts.sourcef   
 orge.net  
   
   
 04/23/2007
 10:47 AM  
   
   
   Please  
 respond to
 wicket-user   
 @lists.sour   
 ceforge.net   
   
   




what you have below seems pretty reasonable. if it is more then just links
changing i would swap a different fragment in, but it looks like overkill
for your case.

-igor

On 4/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  I have a table which contains a list of users. At the end of each row
  there
  is an delete/undo link. When the user clicks delete I want to hide the
  row
  and replace it with only the undo link. What would be the best way to do
  this? Thanks for your time.

  view = new ListView("rows", data) {
public void populateItem(ListItem listItem) {
  UserType value = (UserType
  )listItem.getModelObject();
  listItem.add(new
  ModalWindowPanel("userSearchPanel", value));

  listItem.add(new CheckBox("admin", new Model(new
  Boolean(value.isAdmin();
  listItem.add(new
  DeleteUndoPanel("deleteUndoPanel",
  listItem.getModel()));
}
  };


  private class DeleteUndoPanel extends Panel {


  public DeleteUndoPanel(String id, final IModel model) {
super(id, model);
setOutputMarkupId(true);
final UserType type = (UserType)this.getModelObject();

undoItem = new AjaxLink("undoItem") {

  @Override
public boolean isVisible() {
  
   }

  public void onClick(AjaxRequestTarget target) {
type.setDelete(false);
target.addComponent(DeleteUndoPanel.this);
  }
};
..
deleteItem = new AjaxLink("deleteItem") {


  
  NOTICE OF CONFIDENTIALITY
  This communication including any information transmitted with it is
  intended only for the use of the addressees and is confidential.
  If you are not an intended recipient or responsible for deliv

Re: [Wicket-user] RadioGroup, not only the radios inside

2007-04-24 Thread kubino

Shame on me, I didnt try this.

Thanks a lot.



igor.vaynberg wrote:
> 
> you can put any kind of component into your RadioGroup container, it only
> exists as a boundary for Radio components inside it. so to make it short
> add
> the textfields into the radiogroup.
> 
> -igor
> 
> 
> On 4/24/07, kubino <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hello, I tried to search through the forum, but I couldnt find answer, I
>> hope
>> it is easy.
>>
>> Consider html page where is a filtering form with this possibilities:
>>
>>
>>
>>  No filterFiltrSpecific :
>>Filtr all
>>
>>
>>
>> In java code, I am only adding the radio id's in to the radioGroup , not
>> the
>> textfield(s)(they are added to the form component)
>>
>> But  wicket gives me the exception the I didnt add the the textfield or
>> my
>> hierarchy doesn't match(I guess the hierarchy doesnt match).
>>
>> SO what can I do?
>>
>> I cannot put the textfield after the radio's buttons becouse , I have
>> more
>> than one textfields related to the radios
>>
>>
>> Thanks.
>> --
>> View this message in context:
>> http://www.nabble.com/RadioGroup%2C-not-only-the-radios-inside-tf3638812.html#a10161427
>> 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/RadioGroup%2C-not-only-the-radios-inside-tf3638812.html#a10163415
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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Igor Vaynberg

see IResponseFilter, install your own and you are good to go.

-igor


On 4/24/07, Andrew Moore <[EMAIL PROTECTED]> wrote:



I've had a go with the freemarker panel, and can get a simple example
going.

The thing is, instead of having a panel with a span tag, I'd like to
actually parse the whole .html template file that gets generated by
wicket.
Does anyone know if it's possible to do that?

Is there a way of getting at the whole markup response that's been
generated
and modifying it before it's rendered?



Eelco Hillenius wrote:
>
>> Hi,
>> Thanks for your reply.
>> I'm familiar with wicket (reasonably anyway), that may not have been
>> clear
>> from the post.
>> The admin of the CMS system is all using wicket, and I'm fairly happy
>> with
>> that.
>>
>> The situation is where the CMS content template pages are unknown in
>> structure, but I just want to be able to insert a marker into the page
to
>> replace certain values (as I'm not sure which component the references
>> may
>> be in - ie in the src attribute of an img tag, or in a parameter passed
>> to
>> some javascript etc), so I can't map wicket components to the dynamic
>> content.
>>
>> I've noticed the wicket velocity and wicket freemarker contrib
projects,
>> would these accomplish what I want?
>
> Yep, I think that's the way to go. Or something similar. You basically
> expose limited funcionality (e.g. via Velocity tools) and let the
> users decide what they want to do with it.
>
> Eelco
>
>
-
> 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/Replace-non-wicket-attributed-sections-of-a-html-document-tf3636913.html#a10162589
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


Re: [Wicket-user] NPE rendering ListView Item in 1.3

2007-04-24 Thread Igor Vaynberg

you best bet is to stay current via our svn.

there is also a maven repo with our stuff, but we make no guarantees about
it.
http://wicketstuff.org/maven/repository/

-igor


On 4/24/07, jamieballing <[EMAIL PROTECTED]> wrote:



Thanks... Where is the best place to keep up to date on the snapshots? Are
you versioning them yet and is there a current "recommended" snapshot or
should we plan to keep up to date with the latest?

Jamie



igor.vaynberg wrote:
>
> first start off by showing your code. second, update to the latest
> 1.3snapshot. in my code
> listview.java doesnt have line 709.
>
> -igor
>
>
> On 4/23/07, jamieballing <[EMAIL PROTECTED]> wrote:
>>
>>
>> We are trying to migrate to 1.3 and have encountered an issue. We
aren't
>> sure
>> if this is related to the way we are using it or if there might be a
bug.
>> We
>> are getting a NPE which bubbles up into a message that wicket can't
>> render
>> a
>> component. The stack trace is:
>>
>> Caused by: java.lang.NullPointerException
>> at wicket.markup.html.list.ListView.renderItem(ListView.java
:709)
>> at wicket.markup.html.list.ListView.onRender(ListView.java:670)
>> at wicket.Component.render(Component.java:1495)
>> at wicket.MarkupContainer.renderNext(MarkupContainer.java:1159)
>> at
>> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java
:1329)
>> at
>> wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1264)
>> at wicket.Component.renderComponent(Component.java:1670)
>>
>> One thing of note is that the component ID which wicket is ultimately
>> complaining about doesn't exist anywhere in the application... there is
>> no
>> "feedbackul", but is a "feedback". I know there are some suffixes that
>> get
>> added now, but I thought these should be numeric. Here is the message:
>>
>> wicket.WicketRuntimeException: Exception in rendering component:
>> [MarkupContainer [Component id = feedbackul, page =
>> test.page.search.SearchResultsPage, path =
>> 6:lpContent:uploadPanel:documentManagementModal:content:panel:for
>> m:urlArea:urlBorder:feedbackIndicator:feedback:
feedbackul.FeedbackPanel$2,
>> isVisible = true, isVersioned = false]]
>>
>> Do you have any thoughts or direction on how we should resolve this? We
>> are
>> trying to determine if we should proceed with 1.3 for our app or stick
>> with
>> 1.2.
>>
>> Many thanks,
>> Jamie
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/NPE-rendering-ListView-Item-in-1.3-tf3635715.html#a10152492
>> 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/NPE-rendering-ListView-Item-in-1.3-tf3635715.html#a10161932
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


Re: [Wicket-user] RadioGroup, not only the radios inside

2007-04-24 Thread Igor Vaynberg

you can put any kind of component into your RadioGroup container, it only
exists as a boundary for Radio components inside it. so to make it short add
the textfields into the radiogroup.

-igor


On 4/24/07, kubino <[EMAIL PROTECTED]> wrote:



Hello, I tried to search through the forum, but I couldnt find answer, I
hope
it is easy.

Consider html page where is a filtering form with this possibilities:



 No filterFiltrSpecific :
   Filtr all



In java code, I am only adding the radio id's in to the radioGroup , not
the
textfield(s)(they are added to the form component)

But  wicket gives me the exception the I didnt add the the textfield or my
hierarchy doesn't match(I guess the hierarchy doesnt match).

SO what can I do?

I cannot put the textfield after the radio's buttons becouse , I have more
than one textfields related to the radios


Thanks.
--
View this message in context:
http://www.nabble.com/RadioGroup%2C-not-only-the-radios-inside-tf3638812.html#a10161427
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


Re: [Wicket-user] onGoingBack2Page(+innerForm) => innerForm.fields = empty!?

2007-04-24 Thread Igor Vaynberg

you cannot navigate from page1->page2 via a link because that will not
submit the form, and so you will lose all your values.

try submitlink and make sure there are no form errors - ie all models have
been updated with proper values - and then navigate to page2.

-igor


On 4/24/07, manu <[EMAIL PROTECTED]> wrote:


Dear Sirs,

The scenario is the following:

- Page1 > Form1 (innerClass) > input1(String)... inputN(String)
- Page2 > Link/Button (whatever for going back to Page1 - has a reference
object of Page1)
...
- PageN > Link/Button (idem)

It happens that, when flowing-back from Page2, or... PageN, to Page1, then
Page1 displays but with all innerClass-Form1 fields empty!

The state of other things in Page1 keep there, but all the state of fields
in Form1 has desappeared.

What's wrong here, any idea?

Regards.



-
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


Re: [Wicket-user] General question on DetachableModel, edit form for based on set and components

2007-04-24 Thread Igor Vaynberg

On 4/24/07, Francois Armand <[EMAIL PROTECTED]> wrote:i only have time to
help you with one, so here goes

(I think that the printing of an entry would work on the same model,

say :
* given an entry {
  print the dn ;
  for each attribute {
select a formatting method;
for each value {
  print the value formatted according to the selected method;
}
  }
}
)



first you only need a top level detachable model

class DetachableEntryModel extends LoadableDetachableModel {
 private final String dn;
 private final SpringEntryDao dao;

 public DetacahbleEntryModel(Entry e, SpringEntryDao dao) {
 super(e);
 this.dn=e.getDn();
 this.dao=dao;
  }

  Object load() {
   return dao.get(dn);
   }
}


class PrintPanel extends Panel {
   public PrintPanel(String id, IModel entry) {
   // given an entry
   super(id, new CompoundPropertyModel(entry));

   //   print the dn ;
   add(new Label("dn"));
   add(new PropertyListView("attributes") {
  populateItem(ListItem item) {
 //  for each attribute {
 Attribute a=item.getModelObject();
 // select a formatting method;
 final AttributeFormatter f=;

  item.add(new Label("name"));
  item.add(new ListView("values") {
 populateItem(ListItem item) {
 Object value=item.getModelObject();
 String str=f.format(value);
 add(new Label("value", str));
  }
  });
  });
}
 }
}



dn: 










-igor
-
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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Andrew Moore

I've had a go with the freemarker panel, and can get a simple example going.

The thing is, instead of having a panel with a span tag, I'd like to
actually parse the whole .html template file that gets generated by wicket.
Does anyone know if it's possible to do that?

Is there a way of getting at the whole markup response that's been generated
and modifying it before it's rendered?



Eelco Hillenius wrote:
> 
>> Hi,
>> Thanks for your reply.
>> I'm familiar with wicket (reasonably anyway), that may not have been
>> clear
>> from the post.
>> The admin of the CMS system is all using wicket, and I'm fairly happy
>> with
>> that.
>>
>> The situation is where the CMS content template pages are unknown in
>> structure, but I just want to be able to insert a marker into the page to
>> replace certain values (as I'm not sure which component the references
>> may
>> be in - ie in the src attribute of an img tag, or in a parameter passed
>> to
>> some javascript etc), so I can't map wicket components to the dynamic
>> content.
>>
>> I've noticed the wicket velocity and wicket freemarker contrib projects,
>> would these accomplish what I want?
> 
> Yep, I think that's the way to go. Or something similar. You basically
> expose limited funcionality (e.g. via Velocity tools) and let the
> users decide what they want to do with it.
> 
> Eelco
> 
> -
> 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/Replace-non-wicket-attributed-sections-of-a-html-document-tf3636913.html#a10162589
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] Updating items of a Set...

2007-04-24 Thread ZedroS Schwart
Hi all

As I'm new to wicket, I often wonder (especially when I encounter
hurdles ;)) if the approach I take is the good one. So, if you don't
mind, I will quickly introduce what I try to do, then present the
solution I've retained up to now and, finally, the current hurdle ;).
Feel free to comment on any of these points!

So, the need is basically to browse a set to be able to
increase/decrease the value of each element. So, for each element, it
should look like this:
ElementName
ElementValue  + -

+ and – are links that the user can click on.

Then I would like a submit button under this to be able to submit the
whole stuff. As I'm Ajax curious, I would like the action on the + or
– to be done through Ajax.

Currently, I'm using a RefreshingView with, for each element of the
Set, some Labels (elementName, elementValue) and an action panel with
two AjaxLink, one for "plus" and one for "minus".

Up to now, I manage to retrieve on which AjaxLink the user has
clicked, but I don't manage to refresh the RefreshingView afterwards.
I've two issues : how to tell the View to refresh and how to deal with
the model, since I want to update it but not to save it to the
database…NB : I give to the Panel containing the RefreshingView the
model object containing the set.

Do you have any comment/question/clue ?

Thanks in advance
Joseph, aka ZedroS

-
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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Eelco Hillenius
> Hi,
> Thanks for your reply.
> I'm familiar with wicket (reasonably anyway), that may not have been clear
> from the post.
> The admin of the CMS system is all using wicket, and I'm fairly happy with
> that.
>
> The situation is where the CMS content template pages are unknown in
> structure, but I just want to be able to insert a marker into the page to
> replace certain values (as I'm not sure which component the references may
> be in - ie in the src attribute of an img tag, or in a parameter passed to
> some javascript etc), so I can't map wicket components to the dynamic
> content.
>
> I've noticed the wicket velocity and wicket freemarker contrib projects,
> would these accomplish what I want?

Yep, I think that's the way to go. Or something similar. You basically
expose limited funcionality (e.g. via Velocity tools) and let the
users decide what they want to do with it.

Eelco

-
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] NPE rendering ListView Item in 1.3

2007-04-24 Thread jamieballing

Thanks... Where is the best place to keep up to date on the snapshots? Are
you versioning them yet and is there a current "recommended" snapshot or
should we plan to keep up to date with the latest?

Jamie



igor.vaynberg wrote:
> 
> first start off by showing your code. second, update to the latest
> 1.3snapshot. in my code
> listview.java doesnt have line 709.
> 
> -igor
> 
> 
> On 4/23/07, jamieballing <[EMAIL PROTECTED]> wrote:
>>
>>
>> We are trying to migrate to 1.3 and have encountered an issue. We aren't
>> sure
>> if this is related to the way we are using it or if there might be a bug.
>> We
>> are getting a NPE which bubbles up into a message that wicket can't
>> render
>> a
>> component. The stack trace is:
>>
>> Caused by: java.lang.NullPointerException
>> at wicket.markup.html.list.ListView.renderItem(ListView.java:709)
>> at wicket.markup.html.list.ListView.onRender(ListView.java:670)
>> at wicket.Component.render(Component.java:1495)
>> at wicket.MarkupContainer.renderNext(MarkupContainer.java:1159)
>> at
>> wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1329)
>> at
>> wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1264)
>> at wicket.Component.renderComponent(Component.java:1670)
>>
>> One thing of note is that the component ID which wicket is ultimately
>> complaining about doesn't exist anywhere in the application... there is
>> no
>> "feedbackul", but is a "feedback". I know there are some suffixes that
>> get
>> added now, but I thought these should be numeric. Here is the message:
>>
>> wicket.WicketRuntimeException: Exception in rendering component:
>> [MarkupContainer [Component id = feedbackul, page =
>> test.page.search.SearchResultsPage, path =
>> 6:lpContent:uploadPanel:documentManagementModal:content:panel:for
>> m:urlArea:urlBorder:feedbackIndicator:feedback:feedbackul.FeedbackPanel$2,
>> isVisible = true, isVersioned = false]]
>>
>> Do you have any thoughts or direction on how we should resolve this? We
>> are
>> trying to determine if we should proceed with 1.3 for our app or stick
>> with
>> 1.2.
>>
>> Many thanks,
>> Jamie
>>
>> --
>> View this message in context:
>> http://www.nabble.com/NPE-rendering-ListView-Item-in-1.3-tf3635715.html#a10152492
>> 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/NPE-rendering-ListView-Item-in-1.3-tf3635715.html#a10161932
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] RadioGroup, not only the radios inside

2007-04-24 Thread kubino

Hello, I tried to search through the forum, but I couldnt find answer, I hope
it is easy.

Consider html page where is a filtering form with this possibilities:



 No filterFiltrSpecific :
   Filtr all 



In java code, I am only adding the radio id's in to the radioGroup , not the
textfield(s)(they are added to the form component)

But  wicket gives me the exception the I didnt add the the textfield or my
hierarchy doesn't match(I guess the hierarchy doesnt match).

SO what can I do? 

I cannot put the textfield after the radio's buttons becouse , I have more
than one textfields related to the radios


Thanks.
-- 
View this message in context: 
http://www.nabble.com/RadioGroup%2C-not-only-the-radios-inside-tf3638812.html#a10161427
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] Difficulty with TextFields in ListView

2007-04-24 Thread Jesse Barnum
Thanks, that's what I needed.

--Jesse Barnum, President, 360Works
http://www.360works.com
(770) 234-9293


On Apr 24, 2007, at 8:53 AM, Martijn Dashorst wrote:

> Sorry to make a short note:
> http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html
>
> Basically you need to setReuseItems(true) or use a repeater.
>
> Martijn
>
>
> On 4/24/07, Jesse Barnum <[EMAIL PROTECTED]> wrote:
>> This example renders correctly, but every time I edit one of the
>> values and hit the submit button, the TextFields are reverting to
>> their initial value. The desired behavior is that the 'strings' list
>> will be updated with whatever I enter into the text fields. What am I
>> doing wrong? I am using Wicket 1.2.5.
>>
>> --- ListViewForm.java ---
>> package com.prosc.test;
>>
>> import wicket.markup.html.WebPage;
>> import wicket.markup.html.form.TextField;
>> import wicket.markup.html.form.Form;
>> import wicket.markup.html.list.ListView;
>> import wicket.markup.html.list.ListItem;
>> import wicket.model.Model;
>>
>> import java.util.List;
>> import java.util.LinkedList;
>> import java.util.Arrays;
>>
>> public class ListViewForm extends WebPage {
>> String[] names = {"Jesse", "Lisa", "Sam"};
>> List strings = new LinkedList( Arrays.asList(names) );
>>
>> public  ListViewForm() {
>> Form form = new Form( "form" );
>> form.add( new ListView("names", strings) {
>> protected void populateItem( final  
>> ListItem item ) {
>> String eachName =  
>> item.getModelObjectAsString();
>> item.add( new TextField 
>> ("eachName", new Model(eachName) ) );
>> }
>> } );
>> add( form );
>> }
>> }
>>
>> --- ListViewForm.html ---
>> 
>> 
>> 
>> 
>> 
>> > wicket:id="eachName" />
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>> --Jesse Barnum, President, 360Works
>> http://www.360works.com
>> (770) 234-9293
>>
>>
>>
>> - 
>> 
>> 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
>>
>
>
> -- 
> Learn Wicket at ApacheCon Europe: http://apachecon.com
> Join the wicket community at irc.freenode.net: ##wicket
> Wicket 1.2.6 contains a very important fix. Download Wicket now!
> http://wicketframework.org
>
> -- 
> ---
> 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


Re: [Wicket-user] stateless and/ or bookmarkable pages in Wicket 1.3

2007-04-24 Thread ZedroS Schwart
Thanks for your answers.

I've read that one can override the method getStatelessHint() as following :
protected boolean getStatelessHint()
{
return true;
}
to have a stateless form/component.

However, in the SignInForm provided in the example, it's explicitly written:
public final class SignInForm extends Form
{
protected boolean getStatelessHint()
{
return false;
}

How comes? This form has two textfields and the "remember me" option.
Is this "remember me" option blocking the stateless aspect of the
form?

Thanks in advance
ZedroS

-
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] Wicket 1.2.6 has been released

2007-04-24 Thread ZedroS Schwart
I'm now using Wicket 1.3 but, still, thanks for this release,
especially this part :
"this interim release is provided outside of the ASF, solely as a service to
existing Wicket users to resolve existing bugs in the Wicket product. "

It really shows how great a team you're !

Keep up the good work !

Joseph, aka ZedroS

-
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] Difficulty with TextFields in ListView

2007-04-24 Thread Martijn Dashorst
Sorry to make a short note:
http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html

Basically you need to setReuseItems(true) or use a repeater.

Martijn


On 4/24/07, Jesse Barnum <[EMAIL PROTECTED]> wrote:
> This example renders correctly, but every time I edit one of the
> values and hit the submit button, the TextFields are reverting to
> their initial value. The desired behavior is that the 'strings' list
> will be updated with whatever I enter into the text fields. What am I
> doing wrong? I am using Wicket 1.2.5.
>
> --- ListViewForm.java ---
> package com.prosc.test;
>
> import wicket.markup.html.WebPage;
> import wicket.markup.html.form.TextField;
> import wicket.markup.html.form.Form;
> import wicket.markup.html.list.ListView;
> import wicket.markup.html.list.ListItem;
> import wicket.model.Model;
>
> import java.util.List;
> import java.util.LinkedList;
> import java.util.Arrays;
>
> public class ListViewForm extends WebPage {
> String[] names = {"Jesse", "Lisa", "Sam"};
> List strings = new LinkedList( Arrays.asList(names) );
>
> public  ListViewForm() {
> Form form = new Form( "form" );
> form.add( new ListView("names", strings) {
> protected void populateItem( final ListItem item ) {
> String eachName = 
> item.getModelObjectAsString();
> item.add( new TextField("eachName", new 
> Model(eachName) ) );
> }
> } );
> add( form );
> }
> }
>
> --- ListViewForm.html ---
> 
> 
> 
> 
> 
>  wicket:id="eachName" />
> 
> 
> 
> 
> 
> 
>
>
>
> --Jesse Barnum, President, 360Works
> http://www.360works.com
> (770) 234-9293
>
>
>
> -
> 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
>


-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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] Difficulty with TextFields in ListView

2007-04-24 Thread Jesse Barnum
This example renders correctly, but every time I edit one of the  
values and hit the submit button, the TextFields are reverting to  
their initial value. The desired behavior is that the 'strings' list  
will be updated with whatever I enter into the text fields. What am I  
doing wrong? I am using Wicket 1.2.5.

--- ListViewForm.java ---
package com.prosc.test;

import wicket.markup.html.WebPage;
import wicket.markup.html.form.TextField;
import wicket.markup.html.form.Form;
import wicket.markup.html.list.ListView;
import wicket.markup.html.list.ListItem;
import wicket.model.Model;

import java.util.List;
import java.util.LinkedList;
import java.util.Arrays;

public class ListViewForm extends WebPage {
String[] names = {"Jesse", "Lisa", "Sam"};
List strings = new LinkedList( Arrays.asList(names) );

public  ListViewForm() {
Form form = new Form( "form" );
form.add( new ListView("names", strings) {
protected void populateItem( final ListItem item ) {
String eachName = item.getModelObjectAsString();
item.add( new TextField("eachName", new 
Model(eachName) ) );
}
} );
add( form );
}
}

--- ListViewForm.html ---















--Jesse Barnum, President, 360Works
http://www.360works.com
(770) 234-9293



-
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] onGoingBack2Page(+innerForm) => innerForm.fields = empty!?

2007-04-24 Thread manu

Dear Sirs,

The scenario is the following:

- Page1 > Form1 (innerClass) > input1(String)... inputN(String)
- Page2 > Link/Button (whatever for going back to Page1 - has a reference
object of Page1)
...
- PageN > Link/Button (idem)

It happens that, when flowing-back from Page2, or... PageN, to Page1, then
Page1 displays but with all innerClass-Form1 fields empty!

The state of other things in Page1 keep there, but all the state of fields
in Form1 has desappeared.

What's wrong here, any idea?

Regards.
-
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] Getting error java.lang.ClassCastException: wicket.util.tester.WicketTester

2007-04-24 Thread Akshat

Providing the source class and its corresponding Test class

package com.bsideinc.bsidecom.wicket.pages.sections;

import com.bsideinc.bsidecom.wicket.pages.DefaultBsidePage;

/**
 * User: gutter
 * Date: Feb 8, 2007
 * Time: 1:38:03 PM
 */
public class DefaultHomePage extends DefaultBsidePage {


public static final String HOME = "home";

public String getSection() {
return HOME;
}

public String getTitle() {
return "B-Side Home";
}

}

Test Class

package com.bsideinc.bsidecom.wicket.pages.sections;

import wicket.util.tester.WicketTester;
import junit.framework.TestCase;

public class TestDefaultHomePage extends TestCase{
//private DefaultHomePage testDeafDefaultHomePage = new 
DefaultHomePage();
private WicketTester tester;

public TestDefaultHomePage(){
super ("Test DefaultHomePage class");
}

protected void setUp(){
tester = new WicketTester();
}

public void testgetTitle(){
tester.startPage(DefaultHomePage.class);
tester.assertRenderedPage(DefaultHomePage.class);
//tester.assertNoErrorMessage();
//System.out.println("" + 
testDeafDefaultHomePage.getTitle() );
}

}
-- 
View this message in context: 
http://www.nabble.com/Getting-error-java.lang.ClassCastException%3A-wicket.util.tester.WicketTester-tf3638328.html#a10159802
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] why AbstractRestartResponseException is abstract?

2007-04-24 Thread Martijn Dashorst
Because the exception is meant to be abstract. Use
RestartResponseException instead.

The generated javadoc [1] clearly tells the direct subclasses, and
your IDE should also be able to tell which are the subclasses
(Eclipse: press f4 on the AbstractRestartResponseException).

Martijn

[1] 
http://wicketframework.org/apidocs/wicket/AbstractRestartResponseException.html

On 4/24/07, Andrew Klochkov <[EMAIL PROTECTED]> wrote:
> I want to start responce step immediately and I have to use the
> following strange code:
>
> throw new AbstractRestartResponseException() {
> };
>
> Why is this class abstract?
>
> --
> Andrew Klochkov
>
>
> -
> 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
>


-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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] why AbstractRestartResponseException is abstract?

2007-04-24 Thread Andrew Klochkov
I want to start responce step immediately and I have to use the
following strange code:

throw new AbstractRestartResponseException() {
};

Why is this class abstract?

-- 
Andrew Klochkov


-
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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Erik van Oosten
Hi Andrew,

I see. Yes that makes it quite different. I am not knowledgeable enough 
on dynamic templates. So other could help you better.

There are a few other attempt to write Wicket components for a CMS. 
Perhaps you can learn from those.
http://burgerweeshuis.sourceforge.net/
http://wicket-stuff.svn.sourceforge.net/viewvc/wicket-stuff/branches/WICKET_1_2/wicket-kronos-cms/

Regards,
 Erik.



Andrew Moore wrote:
> Hi,
> Thanks for your reply.
> I'm familiar with wicket (reasonably anyway), that may not have been clear
> from the post.
> The admin of the CMS system is all using wicket, and I'm fairly happy with
> that.
>
> The situation is where the CMS content template pages are unknown in
> structure, but I just want to be able to insert a marker into the page to
> replace certain values (as I'm not sure which component the references may
> be in - ie in the src attribute of an img tag, or in a parameter passed to
> some javascript etc), so I can't map wicket components to the dynamic
> content.
>
> I've noticed the wicket velocity and wicket freemarker contrib projects,
> would these accomplish what I want?
>
> I still want to have the functionality of wicket (which is great), but just
> want to be able to do effectivley some global replaces on the generated html
> markup to replace some markers with actual values.
> Hope that makes it a little clearer.
> Cheers
> Andrew
>
>
>
>
> Erik van Oosten wrote:
>   
>> Hi Andrew,
>>
>> Your use-case is exactly what Wicket is about. In the template file, use 
>> wicket:id attributes on the img tag. Place these tags in some kind of 
>> container (span or div element) to be able to repeat it. In the code you 
>> can attach an instance of Image (or variations, see javadoc). Use a 
>> ListView or Repeater to repeat the images.
>>
>> You can find more information in the javadocs and on the Wiki. In 
>> particular
>> http://cwiki.apache.org/WICKET/newuserguide.html, 
>> http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html and 
>> http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html.
>>
>> Regards,
>>  Erik
>>
>>
>> Andrew Moore wrote:
>> 
>>> Hi,
>>> I'm currently writing a CMS in wicket. One of the things I'm wanting to
>>> do
>>> is make it nice and flexible to be able to design new templates for
>>> rendering the page.
>>>
>>> I'm looking at producing an image gallery at the moment.
>>>
>>> For the moment I'm using  dummy.jpg  or something similar in the html
>>> files,
>>> which is fine.
>>>
>>> image1 would then be replaced by a Static Image of something like
>>> "/images/gallery/realImage1.jpg" or whatever..
>>>
>>> The problem is, I'm wanting to be able to make it as flexible as possible
>>> for the designers to be able to use what they want re javascript and
>>> markup
>>> to get the page how they want it.
>>>
>>> So for example, instead of referencing "/images/gallery/realImage1.jpg"
>>> via
>>> the wicket:id of an img tag, the value may want to be put into other
>>> parts
>>> of the html markup:
>>> e.g. 
>>> # 
>>> or
>>>
>>>
>>> or anything else really!
>>>
>>> So is there anyway this could be done?
>>> Maybe there is a way to process the HTML and replace data, so for exmaple
>>> I
>>> could have something like:
>>>
>>> $image1$ 
>>> # 
>>>
>>>
>>> and replace $image1$ with '/images/gallery/realImage1.jpg' while
>>> rendering
>>> the page.
>>>
>>> Anyone any suggestions?
>>> Thanks
>>> Andrew
>>>
>>>   
>>>   
>> -- 
>> Erik van Oosten
>> http://www.day-to-day-stuff.blogspot.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
>>
>>
>> 
>
>   

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.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] Update to "Using frames" page on Wiki

2007-04-24 Thread Johan Compagner

updated

On 4/24/07, JulianS <[EMAIL PROTECTED]> wrote:


Update to "Using frames" on the Wicket Wiki:

http://cwiki.apache.org/WICKET/using-frames.html

I'm using 1.2.5 and I've found the syntax has changed slightly. Instead
of:



The syntax that works is:



If this is correct (I'm pretty sure is is, since it works for me), can
someone update the wiki page?
Julian
--
View this message in context: Update to "Using frames" page on 
Wiki
Sent from the Wicket - User mailing list 
archiveat
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


[Wicket-user] General question on DetachableModel, edit form for based on set and components

2007-04-24 Thread Francois Armand
Hello everybody, 

I'm quite new to Wicket, and to web component framework to. 
Until now I just try simple examples, which seem to work (really) fine.
So now, I want to pass to a little more complexe one, to try to
understand how things work in Wicket (version 1.3). 

I work on LDAP directories, so I play with *entries*, identified by
there "dn". Each entry has a Set of *attributes*. Attributes are linked
to an unique entry, are identified by there "name", and have a Set of
*values*. A spring managed DAO allows to do CRUD actions on entries. A
summary of these object is given at the end of the email.

I think I understand that I have to take care that objects are
detachable. I succeed in using spring annotation to use a spring proxy
to connect to my DAO and retrieve an entry and write his it on screen.

Now, I want to see how powerful is wicket, and for that I want to
translate this algo to edit an entry 
* given an entry {
  print the dn ;
  for each attribute {
select an input method base on the name of the attribute;
for each value {
  add an edit box according to the input method;
}
  }
}

(I think that the printing of an entry would work on the same model,
say :
* given an entry {
  print the dn ;
  for each attribute {
select a formatting method;
for each value {
  print the value formatted according to the selected method;
}
  }
}
)

If I well understand how works wicket, I need to define a detachable
model for the "entry" object, and a detachable model for each "type" of
attribute. Then, I have to play with repeaters at attribute and value
level. Or perhaps I need to define a component for each attribute ?
Well, as you see, I don't know where to begin. I look carefully in
examples and wiki, but I don't really find how to put concept together. 
Could you, please, point me some entries or give me some advice in the
main line of what I have to do to implement my algo ?


Any help would be welcome, 
Francois

-
PS : to detail a little bit mare, I have these objects (and I have to
deals with them, I cannot change them because I relay upon a framework):

SpringEntryDao {
  Entry get(String dn);
  ...
}

Entry { 
  String dn:
  Set attributes;
  Attribute getAttribute(String name)
  void setAttribute(Attribute attribute)
  ...
}

Attribute {
  String name;
  Set values;
  Value getValue(); //return next value if one remain, null otherwise
  Set getValues(); //return a set of all value
  ...
}

Value {
  Object value;
  Object getValue();
  ...
}



-
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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Andrew Moore

Hi,
Thanks for your reply.
I'm familiar with wicket (reasonably anyway), that may not have been clear
from the post.
The admin of the CMS system is all using wicket, and I'm fairly happy with
that.

The situation is where the CMS content template pages are unknown in
structure, but I just want to be able to insert a marker into the page to
replace certain values (as I'm not sure which component the references may
be in - ie in the src attribute of an img tag, or in a parameter passed to
some javascript etc), so I can't map wicket components to the dynamic
content.

I've noticed the wicket velocity and wicket freemarker contrib projects,
would these accomplish what I want?

I still want to have the functionality of wicket (which is great), but just
want to be able to do effectivley some global replaces on the generated html
markup to replace some markers with actual values.
Hope that makes it a little clearer.
Cheers
Andrew




Erik van Oosten wrote:
> 
> Hi Andrew,
> 
> Your use-case is exactly what Wicket is about. In the template file, use 
> wicket:id attributes on the img tag. Place these tags in some kind of 
> container (span or div element) to be able to repeat it. In the code you 
> can attach an instance of Image (or variations, see javadoc). Use a 
> ListView or Repeater to repeat the images.
> 
> You can find more information in the javadocs and on the Wiki. In 
> particular
> http://cwiki.apache.org/WICKET/newuserguide.html, 
> http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html and 
> http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html.
> 
> Regards,
>  Erik
> 
> 
> Andrew Moore wrote:
>> Hi,
>> I'm currently writing a CMS in wicket. One of the things I'm wanting to
>> do
>> is make it nice and flexible to be able to design new templates for
>> rendering the page.
>>
>> I'm looking at producing an image gallery at the moment.
>>
>> For the moment I'm using  dummy.jpg  or something similar in the html
>> files,
>> which is fine.
>>
>> image1 would then be replaced by a Static Image of something like
>> "/images/gallery/realImage1.jpg" or whatever..
>>
>> The problem is, I'm wanting to be able to make it as flexible as possible
>> for the designers to be able to use what they want re javascript and
>> markup
>> to get the page how they want it.
>>
>> So for example, instead of referencing "/images/gallery/realImage1.jpg"
>> via
>> the wicket:id of an img tag, the value may want to be put into other
>> parts
>> of the html markup:
>> e.g. 
>> # 
>> or
>>
>>
>> or anything else really!
>>
>> So is there anyway this could be done?
>> Maybe there is a way to process the HTML and replace data, so for exmaple
>> I
>> could have something like:
>>
>> $image1$ 
>> # 
>>
>>
>> and replace $image1$ with '/images/gallery/realImage1.jpg' while
>> rendering
>> the page.
>>
>> Anyone any suggestions?
>> Thanks
>> Andrew
>>
>>   
> 
> -- 
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Replace-non-wicket-attributed-sections-of-a-html-document-tf3636913.html#a10157408
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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Erik van Oosten
Hi Andrew,

Your use-case is exactly what Wicket is about. In the template file, use 
wicket:id attributes on the img tag. Place these tags in some kind of 
container (span or div element) to be able to repeat it. In the code you 
can attach an instance of Image (or variations, see javadoc). Use a 
ListView or Repeater to repeat the images.

You can find more information in the javadocs and on the Wiki. In 
particular
http://cwiki.apache.org/WICKET/newuserguide.html, 
http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html and 
http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html.

Regards,
 Erik


Andrew Moore wrote:
> Hi,
> I'm currently writing a CMS in wicket. One of the things I'm wanting to do
> is make it nice and flexible to be able to design new templates for
> rendering the page.
>
> I'm looking at producing an image gallery at the moment.
>
> For the moment I'm using  dummy.jpg  or something similar in the html files,
> which is fine.
>
> image1 would then be replaced by a Static Image of something like
> "/images/gallery/realImage1.jpg" or whatever..
>
> The problem is, I'm wanting to be able to make it as flexible as possible
> for the designers to be able to use what they want re javascript and markup
> to get the page how they want it.
>
> So for example, instead of referencing "/images/gallery/realImage1.jpg" via
> the wicket:id of an img tag, the value may want to be put into other parts
> of the html markup:
> e.g. 
> # 
> or
>
>
> or anything else really!
>
> So is there anyway this could be done?
> Maybe there is a way to process the HTML and replace data, so for exmaple I
> could have something like:
>
> $image1$ 
> # 
>
>
> and replace $image1$ with '/images/gallery/realImage1.jpg' while rendering
> the page.
>
> Anyone any suggestions?
> Thanks
> Andrew
>
>   

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.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] Which toolkit to use?

2007-04-24 Thread David Leangen

Peter,

Thank you for sharing your experience with me. I'm beginning to come to
the same conclusions, so it's nice to hear the experiences of others.

I've looked a little bit into mootools, yui, scriptaculous, and dojo.

mootools: unless I'm blind, I can't find any docs. Since I'm not a js
guru, I need docs or else I'm pretty useless.

scriptaculous: seems to be not so bad.

dojo: seems ok to develop with, but the demos don't perform very well.

yui: by far the most documentation of all of these, including
interactive demos. I think I'm going to give this a shot.


Cheers,
David



On Tue, 2007-04-24 at 11:18 +0530, Peter Thomas wrote:
> Hi,
> 
> I had recently tried to decide upon a toolkit to use, and chose Yahoo
> UI.  It is very touch to choose nowadays and I did not do a thorough
> evaluation but what leaned me towards Yahoo UI is that it appears to
> have the best documentation.  It is modular as well - so the footprint
> is reasonable.  So far my experience has been good.  I am already
> using the calendar (my own instead of using wicket-datetime - Wicket
> makes rolling your own really easy :), and a non-modal resizable
> dialog which looks nice.  I also plan to use the menu component soon. 
> 
> By the way the wicket-stuff minis project (which is what I think Eelco
> means by the misc components project) does not allow anonymous
> browsing, is this intentional?  I have submitted a draft of the dialog
> component in there, you may take a look at that. 
> 
> http://www.wicketstuff.org/jira/browse/WSMINIS
> 
> Thanks,
> 
> Peter.
> 
> On 4/24/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> How about that misc components project Igor just started?
> 
> Eelco
> 
> On 4/23/07, David Leangen <[EMAIL PROTECTED]> wrote:
> >
> > Awesome! Thank you for this superbly detailed reply! 
> >
> > Mind if I pick your brain some more?
> >
> >
> > > For choosing a library it is a matter of taste and
> priorities. If you
> > > want an actively maintained wicket project, then dojo
> should be your 
> > > cup of tea, if you want stability, probably prototype +
> some other
> > > library would be a better choice. If you want small
> footprint, then
> > > consider adopting mootools. If you want a huge company
> backing, YUI 
> > > would be a good library, with extjs as a nice extra.
> >
> > I think that given the project requirements, a small
> footprint needs to
> > be a priority. I'm only going to need a small number of
> widgets anyway. 
> >
> > To that end, your suggestion of mootools sounds enticing.
> However, I
> > noticed that it does not seem to be supported in
> wicket-stuff...
> >
> > Is it difficult to add support for the widgets I need? 
> >
> > Is there any doc about how to do this somewhere? (I wasn't
> able to find
> > any...)
> >
> > Would it be useful to start a new mootols wicket-stuff
> project?
> >
> >
> > Thanks! 
> > David
> >
> >
> >
> >
> >
> 
> -
> > 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
> 
> -
> 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] Replace non-wicket attributed sections of a html document

2007-04-24 Thread Andrew Moore

Hi,
I'm currently writing a CMS in wicket. One of the things I'm wanting to do
is make it nice and flexible to be able to design new templates for
rendering the page.

I'm looking at producing an image gallery at the moment.

For the moment I'm using  dummy.jpg  or something similar in the html files,
which is fine.

image1 would then be replaced by a Static Image of something like
"/images/gallery/realImage1.jpg" or whatever..

The problem is, I'm wanting to be able to make it as flexible as possible
for the designers to be able to use what they want re javascript and markup
to get the page how they want it.

So for example, instead of referencing "/images/gallery/realImage1.jpg" via
the wicket:id of an img tag, the value may want to be put into other parts
of the html markup:
e.g. 
# 
or


or anything else really!

So is there anyway this could be done?
Maybe there is a way to process the HTML and replace data, so for exmaple I
could have something like:

$image1$ 
# 


and replace $image1$ with '/images/gallery/realImage1.jpg' while rendering
the page.

Anyone any suggestions?
Thanks
Andrew

-- 
View this message in context: 
http://www.nabble.com/Replace-non-wicket-attributed-sections-of-a-html-document-tf3636913.html#a10155863
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] Programmatically Apply CSS To Links?

2007-04-24 Thread Dmitry Kandalov


fattymelt wrote:
> 
> I am trying to create a reusable navigation that would "highlight" the
> current page in the navigation.
> 
> Is there a way to set the "class" attribute of the link tag dynamically in
> Wicket? If not, does someone have a workaround? This seems like a pretty
> common thing one would want to be able to do.
> 
> Thanks!
> 
> 

I have every page annotated and do it like that:

public final class HighlightLinkBehavior extends AbstractBehavior
{
private Class annotation;

public HighlightLinkBehavior( final Class
annotation )
{
this.annotation = annotation;
}

public void onComponentTag( final Component component, final
ComponentTag tag )
{
if( component.getPage().getClass().isAnnotationPresent( annotation )
)
{
tag.put( "class", "highlightedLink" );
}
}
}
-- 
View this message in context: 
http://www.nabble.com/Programmatically-Apply-CSS-To-Links--tf3633182.html#a10155861
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] Help: Creating a Apache-licensed Wysiwyg-Textarea for Wicket

2007-04-24 Thread Johan Compagner


And I  also admit that  I don't have  the same patience  as yours,
providing code snippets all the  time, answering to every question
with such accuracy :-)

Congratulations, Igor!



+1  Igor for president!
-
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] AjaxFormComponentUpdatingBehavior w / RadioChoice

2007-04-24 Thread Johan Compagner

https://issues.apache.org/jira/browse/WICKET-470

And already an implementation attached that works.
just need to test that for multiply situations

johan


On 4/24/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:


That's a good point. How about opening a feature request for this
(though no promise we can fix it, but it's good to think about it).

Eelco


On 4/13/07, Carlos Pita <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> how do you catch events triggered by radio choice changes? If you
> simply add the ajaxformcomponentupdatingbehavior to the radiochoice,
> the span which is wrapping the radios is instrumented instead of the
> radios themselves:
>
>  
> 
> 
> 
>
> Cheers,
> Carlos
>
>
-
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> opinions on IT & business topics through brief surveys-and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> 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

-
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] DBsessionstore ?

2007-04-24 Thread Johan Compagner

1.3



On 4/23/07, M.A.Bednarz <[EMAIL PROTECTED]> wrote:


So Elco,

this sounds like wicket is more alive then ever before. I have
totally misunderstood one prior posting :-)))

Where can I find SecondLevelCacheSessionStore? Is this part of wicket 1.25
oder 1.3?

Maciek


- Original Message -
From: "Eelco Hillenius" <[EMAIL PROTECTED]>
To: "M.A.Bednarz" <[EMAIL PROTECTED]>;

Sent: Monday, April 23, 2007 8:04 PM
Subject: Re: [Wicket-user] DBsessionstore ?


>> I would like to ask about custom implementations of wickets
>> ISessionStore.
>> Are there
>> any implementations regarding to store SessionInformation to a
database?
>> Maybe something
>> like an DBsessionstore ?
>
> Nope. But it should be doable. E.g. by using
> SecondLevelCacheSessionStore with a custom of IPageStore. Please keep
> up informed if you're trying to get this implemented.
>
>>I read that someone has worked on a Terracotta Session Store but
>> I can not find a source for this.
>
> For a bit. But it turned out not necessary. Default stores work fine
> with Terracotta.
>
>> Second question: Why is wicket 2.0 marked as discontinued within the
svn?
>> Will there be a
>> 2.0 version in near future ??
>
> Read the various entries on that here
http://www.martijndashorst.com/blog/
>
> Eelco


-
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