Re: onclick AjaxEventBehaviour on feedback messages broken in 1.4?

2009-08-27 Thread Igor Vaynberg
well, its either removing components or an outofmemoryexception. which
one do you prefer? :)

we need to find another way to fix the OOME. can you see one?

-igor

On Wed, Aug 26, 2009 at 10:48 PM, Ian MacLartyian.macla...@gmail.com wrote:
 Here is an example of some less trivial behaviour that is done when
 you click an error.  This changes to a specific tab that contains the
 erroneous field.  The error message that has this behaviour is added
 with some custom validation.

                   �...@override
                    protected void onClick(AjaxRequestTarget target) {
                        boolean fieldSelected = false;
                        TabbedPanel mainTabs =
 (TabbedPanel)container.findParent(TabbedPanel.class);
                        if (mainTabs != null) {
                            mainTabs.setSelectedTab(0); // Go to general tab.
                            target.addComponent(mainTabs);

 target.appendJavascript(adjust_feedback_panel_size(););
                            Component clientDOB =
 mainTabs.get(panel:client.dateOfBirth);
                            if
 (subj.equals(thisModel.getClient().getResource().toString())) {
                                target.appendJavascript($('# +
 clientDOB.getMarkupId() +
                                    ').addClass('error').select(););
                                fieldSelected = true;
                            }
                            if
 (Nulls.falseIfNull(thisModel.getClient().getHasPartner())) {
                                Component partnerDOB =
 mainTabs.get(panel:client.partner.dateOfBirth);
                                if
 (subj.equals(thisModel.getClient().getPartner().getResource().toString()))
 {
                                    String JS = $('# +
 partnerDOB.getMarkupId() + ').addClass('error');
                                    if (! fieldSelected) {
                                        JS += .select();;
                                    } else {
                                        JS += ;;
                                    }
                                    target.appendJavascript(JS);
                                }
                            }
                        }
                    }

 This would not very easy to implement as Javascript.

 On Thu, Aug 27, 2009 at 3:37 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote:
 it doesnt really look like you need a callback, you can simply
 represent the link as a webmarkupcontainer that adds an onclick
 javascript. more efficient and does the same thing.

 -igor

 On Wed, Aug 26, 2009 at 10:11 PM, Ian MacLartyian.macla...@gmail.com wrote:
 It depends on the error.  Most of the time the onclick behaviour
 simply returns some javascript that highlights the invalid field.
 Sometimes it changes the current tab, because the invalid field is on
 a different tab.  The code looks like this:

        add(new AjaxEventBehavior(onclick) {
           �...@override
            protected void onEvent(AjaxRequestTarget target) {
                target.appendJavascript(onClickJS);
                if (msg instanceof PfpFeedbackMessage) {
                    PfpFeedbackMessage pfpMsg = (PfpFeedbackMessage)msg;
                    if (pfpMsg.getExtraClickBehavior() != null) {
                        pfpMsg.getExtraClickBehavior().onClick(target);
                    }
                }
            }
        });

 The getExtraClickBehaviour method can return any extra behaviour to do
 when the message is clicked (e.g. change the current tab).

 On Thu, Aug 27, 2009 at 3:01 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 what do these links do?

 -igor

 On Wed, Aug 26, 2009 at 9:51 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 Hi Igor,

 The commit log is simply:

 Issue: WICKET-2384.


 From http://issues.apache.org/jira/browse/WICKET-2384:

 Problem is that we keep reference to FeedbackMessage in component
 inside MessageListView item. The feedback message references previous
 page - that causes the problem, because the previous page is
 serialized together with current (and the page before, etc).

 Simply removing components from MessageListView should fix the problem.

 class MessageListView
 {
  ...
 �...@override
  protected void onDetach()
  {
    removeAll();
    super.onDetach();
  }

 }


 By the way if you have any suggestions on how I could work around my
 problem without having to go back to 1.3.6 I'd love to hear them.

 Cheers,
 Ian.

 On Thu, Aug 27, 2009 at 2:43 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 before you file a bug report, what was the commit log for that svn
 change you found?

 -igor

 On Wed, Aug 26, 2009 at 9:42 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 On Thu, Aug 27, 2009 at 2:09 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 On Thu, Aug 27, 2009 at 1:41 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 Hi,

 I recently upgraded to Wicket 1.4 and am now having a problem with a
 feedback panel.

 I 

Re: onclick AjaxEventBehaviour on feedback messages broken in 1.4?

2009-08-27 Thread Ian MacLarty
I tried the fix to populateItem proposed by the original bug reporter
(http://issues.apache.org/jira/browse/WICKET-2384) and that seems to
work.

On Thu, Aug 27, 2009 at 4:32 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote:
 well, its either removing components or an outofmemoryexception. which
 one do you prefer? :)

 we need to find another way to fix the OOME. can you see one?

 -igor

 On Wed, Aug 26, 2009 at 10:48 PM, Ian MacLartyian.macla...@gmail.com wrote:
 Here is an example of some less trivial behaviour that is done when
 you click an error.  This changes to a specific tab that contains the
 erroneous field.  The error message that has this behaviour is added
 with some custom validation.

                   �...@override
                    protected void onClick(AjaxRequestTarget target) {
                        boolean fieldSelected = false;
                        TabbedPanel mainTabs =
 (TabbedPanel)container.findParent(TabbedPanel.class);
                        if (mainTabs != null) {
                            mainTabs.setSelectedTab(0); // Go to general tab.
                            target.addComponent(mainTabs);

 target.appendJavascript(adjust_feedback_panel_size(););
                            Component clientDOB =
 mainTabs.get(panel:client.dateOfBirth);
                            if
 (subj.equals(thisModel.getClient().getResource().toString())) {
                                target.appendJavascript($('# +
 clientDOB.getMarkupId() +
                                    ').addClass('error').select(););
                                fieldSelected = true;
                            }
                            if
 (Nulls.falseIfNull(thisModel.getClient().getHasPartner())) {
                                Component partnerDOB =
 mainTabs.get(panel:client.partner.dateOfBirth);
                                if
 (subj.equals(thisModel.getClient().getPartner().getResource().toString()))
 {
                                    String JS = $('# +
 partnerDOB.getMarkupId() + ').addClass('error');
                                    if (! fieldSelected) {
                                        JS += .select();;
                                    } else {
                                        JS += ;;
                                    }
                                    target.appendJavascript(JS);
                                }
                            }
                        }
                    }

 This would not very easy to implement as Javascript.

 On Thu, Aug 27, 2009 at 3:37 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 it doesnt really look like you need a callback, you can simply
 represent the link as a webmarkupcontainer that adds an onclick
 javascript. more efficient and does the same thing.

 -igor

 On Wed, Aug 26, 2009 at 10:11 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 It depends on the error.  Most of the time the onclick behaviour
 simply returns some javascript that highlights the invalid field.
 Sometimes it changes the current tab, because the invalid field is on
 a different tab.  The code looks like this:

        add(new AjaxEventBehavior(onclick) {
           �...@override
            protected void onEvent(AjaxRequestTarget target) {
                target.appendJavascript(onClickJS);
                if (msg instanceof PfpFeedbackMessage) {
                    PfpFeedbackMessage pfpMsg = (PfpFeedbackMessage)msg;
                    if (pfpMsg.getExtraClickBehavior() != null) {
                        pfpMsg.getExtraClickBehavior().onClick(target);
                    }
                }
            }
        });

 The getExtraClickBehaviour method can return any extra behaviour to do
 when the message is clicked (e.g. change the current tab).

 On Thu, Aug 27, 2009 at 3:01 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 what do these links do?

 -igor

 On Wed, Aug 26, 2009 at 9:51 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 Hi Igor,

 The commit log is simply:

 Issue: WICKET-2384.


 From http://issues.apache.org/jira/browse/WICKET-2384:

 Problem is that we keep reference to FeedbackMessage in component
 inside MessageListView item. The feedback message references previous
 page - that causes the problem, because the previous page is
 serialized together with current (and the page before, etc).

 Simply removing components from MessageListView should fix the problem.

 class MessageListView
 {
  ...
 �...@override
  protected void onDetach()
  {
    removeAll();
    super.onDetach();
  }

 }


 By the way if you have any suggestions on how I could work around my
 problem without having to go back to 1.3.6 I'd love to hear them.

 Cheers,
 Ian.

 On Thu, Aug 27, 2009 at 2:43 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 before you file a bug report, what was the commit log for that svn
 change you found?

 -igor

 On Wed, Aug 26, 2009 at 9:42 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 On Thu, Aug 27, 

Re: onclick AjaxEventBehaviour on feedback messages broken in 1.4?

2009-08-27 Thread Ian MacLarty
BTW I've logged bug 2438.

On Thu, Aug 27, 2009 at 5:01 PM, Ian MacLartyian.macla...@gmail.com wrote:
 I tried the fix to populateItem proposed by the original bug reporter
 (http://issues.apache.org/jira/browse/WICKET-2384) and that seems to
 work.

 On Thu, Aug 27, 2009 at 4:32 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote:
 well, its either removing components or an outofmemoryexception. which
 one do you prefer? :)

 we need to find another way to fix the OOME. can you see one?

 -igor

 On Wed, Aug 26, 2009 at 10:48 PM, Ian MacLartyian.macla...@gmail.com wrote:
 Here is an example of some less trivial behaviour that is done when
 you click an error.  This changes to a specific tab that contains the
 erroneous field.  The error message that has this behaviour is added
 with some custom validation.

                   �...@override
                    protected void onClick(AjaxRequestTarget target) {
                        boolean fieldSelected = false;
                        TabbedPanel mainTabs =
 (TabbedPanel)container.findParent(TabbedPanel.class);
                        if (mainTabs != null) {
                            mainTabs.setSelectedTab(0); // Go to general tab.
                            target.addComponent(mainTabs);

 target.appendJavascript(adjust_feedback_panel_size(););
                            Component clientDOB =
 mainTabs.get(panel:client.dateOfBirth);
                            if
 (subj.equals(thisModel.getClient().getResource().toString())) {
                                target.appendJavascript($('# +
 clientDOB.getMarkupId() +
                                    ').addClass('error').select(););
                                fieldSelected = true;
                            }
                            if
 (Nulls.falseIfNull(thisModel.getClient().getHasPartner())) {
                                Component partnerDOB =
 mainTabs.get(panel:client.partner.dateOfBirth);
                                if
 (subj.equals(thisModel.getClient().getPartner().getResource().toString()))
 {
                                    String JS = $('# +
 partnerDOB.getMarkupId() + ').addClass('error');
                                    if (! fieldSelected) {
                                        JS += .select();;
                                    } else {
                                        JS += ;;
                                    }
                                    target.appendJavascript(JS);
                                }
                            }
                        }
                    }

 This would not very easy to implement as Javascript.

 On Thu, Aug 27, 2009 at 3:37 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 it doesnt really look like you need a callback, you can simply
 represent the link as a webmarkupcontainer that adds an onclick
 javascript. more efficient and does the same thing.

 -igor

 On Wed, Aug 26, 2009 at 10:11 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 It depends on the error.  Most of the time the onclick behaviour
 simply returns some javascript that highlights the invalid field.
 Sometimes it changes the current tab, because the invalid field is on
 a different tab.  The code looks like this:

        add(new AjaxEventBehavior(onclick) {
           �...@override
            protected void onEvent(AjaxRequestTarget target) {
                target.appendJavascript(onClickJS);
                if (msg instanceof PfpFeedbackMessage) {
                    PfpFeedbackMessage pfpMsg = (PfpFeedbackMessage)msg;
                    if (pfpMsg.getExtraClickBehavior() != null) {
                        pfpMsg.getExtraClickBehavior().onClick(target);
                    }
                }
            }
        });

 The getExtraClickBehaviour method can return any extra behaviour to do
 when the message is clicked (e.g. change the current tab).

 On Thu, Aug 27, 2009 at 3:01 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 what do these links do?

 -igor

 On Wed, Aug 26, 2009 at 9:51 PM, Ian MacLartyian.macla...@gmail.com 
 wrote:
 Hi Igor,

 The commit log is simply:

 Issue: WICKET-2384.


 From http://issues.apache.org/jira/browse/WICKET-2384:

 Problem is that we keep reference to FeedbackMessage in component
 inside MessageListView item. The feedback message references previous
 page - that causes the problem, because the previous page is
 serialized together with current (and the page before, etc).

 Simply removing components from MessageListView should fix the problem.

 class MessageListView
 {
  ...
 �...@override
  protected void onDetach()
  {
    removeAll();
    super.onDetach();
  }

 }


 By the way if you have any suggestions on how I could work around my
 problem without having to go back to 1.3.6 I'd love to hear them.

 Cheers,
 Ian.

 On Thu, Aug 27, 2009 at 2:43 PM, Igor Vaynbergigor.vaynb...@gmail.com 
 wrote:
 before you file a bug report, what was the commit log for that svn
 change you found?

 

Re: AjaxLink/Behaviour with shortcut

2009-08-27 Thread danisevsky
look at
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/input-events-parent/

2009/8/26 Johannes Schneider maili...@cedarsoft.com

 Hi,

 I have here several AjaxLinks that should be triggered using a shortcut
 (e.g. PageDown or Delete).
 Does anybody have some lines of code or a hint how that could be done?

 Alternatively a AjaxBehaviour could be used to start the action.


 Any ideas?
 Thanks,


 Johannes

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




Re: How to get Dynamic value of TextField

2009-08-27 Thread Dipu
take a look at the user guide at
http://cwiki.apache.org/WICKET/newuserguide.html

take a look at the example  http://wicketstuff.org/wicket13/forminput/
click on the  source code link on the right of the page to see the source code


if possible buy the book wicket in action

regards


On Thu, Aug 27, 2009 at 5:33 AM, Gerald
Fernandogerald.anto.ferna...@gmail.com wrote:
 I dont know how to attach model to form or textField.
 my requirement is that

 when i give input to text field and submit it gives some data then i want to
 populate the data into DataGrid or table view

 if possible give me some samples

 ThanksRegards,
 Gerald A

 On Wed, Aug 26, 2009 at 7:20 PM, Dipu dipu@googlemail.com wrote:

 is the text field in a form ?
 do you have a model attached to the form or the text field ?


 when you submit the form or click the button the input value will be
 updated to the model and you can read it from the model.

 hope that make sense.

 regards




 On Wed, Aug 26, 2009 at 2:45 PM, Gerald
 Fernandogerald.anto.ferna...@gmail.com wrote:
  Hello Friends,
 
  i have a TextField and button.
  when i click a button i need to get value of textField and pass it to the
  another function.
  How it is possible
  --
  Thanksregards,
  Gerald A
 

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




 --
 Thanksregards,
 Gerald A


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



Re: How to detect model leakage into session

2009-08-27 Thread Eelco Hillenius
One 'hack' of a way to check whether you have stuff in your session
that shouldn't be, is to make sure that the objects you don't want
sticking around are not serializable, and you'll see stacktraces soon
enough. If that's an options, it's a useful hack...

Eelco

On Wed, Aug 26, 2009 at 12:29 PM, Bas Goorenb...@iswd.nl wrote:
 Hi all,

 My problem is as follows: I use LoadableDetachableModels throughout my 
 application, and have made sure I never use a model without it being attached 
 to a component to prevent models which never get their detach() method called.
 Nonetheless, after hitting two fairly simple pages which list some database 
 data in my application, I get a 100kb session which is filled with literal 
 strings from model objects.

 I've fired up my (Eclipse) debugger and have stepped through all models on 
 one of the pages after setting a breakpoint on the pages onDetach() method. I 
 see all LoadableDetachableModels are detached, so I have no idea what's 
 causing this.

 What would be a good strategy for finding the source of this problem?

 Bas

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



Re: How to detect model leakage into session

2009-08-27 Thread Bas Gooren

Eelco,

Thanks for your tip.

Bas

- Original Message - 
From: Eelco Hillenius eelco.hillen...@gmail.com

To: users@wicket.apache.org
Sent: Thursday, August 27, 2009 10:09 AM
Subject: Re: How to detect model leakage into session



One 'hack' of a way to check whether you have stuff in your session
that shouldn't be, is to make sure that the objects you don't want
sticking around are not serializable, and you'll see stacktraces soon
enough. If that's an options, it's a useful hack...

Eelco

On Wed, Aug 26, 2009 at 12:29 PM, Bas Goorenb...@iswd.nl wrote:

Hi all,

My problem is as follows: I use LoadableDetachableModels throughout my 
application, and have made sure I never use a model without it being 
attached to a component to prevent models which never get their detach() 
method called.
Nonetheless, after hitting two fairly simple pages which list some 
database data in my application, I get a 100kb session which is filled 
with literal strings from model objects.


I've fired up my (Eclipse) debugger and have stepped through all models 
on one of the pages after setting a breakpoint on the pages onDetach() 
method. I see all LoadableDetachableModels are detached, so I have no 
idea what's causing this.


What would be a good strategy for finding the source of this problem?

Bas


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





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



Re: How to detect model leakage into session

2009-08-27 Thread Martijn Dashorst
Or check your pages for references to your entities at the end of the request:

private void testDetachedObjects(final Page page)
{
Page responsePage = getResponsePage();
if (page == null || page.isErrorPage()
|| (responsePage != null  responsePage.isErrorPage()))
{
return;
}

try
{
NotSerializableException exception = new 
NotSerializableException();
EntityAndSerializableChecker checker = new
EntityAndSerializableChecker(exception);
checker.writeObject(page);
}
catch (Exception ex)
{
log.error(Couldn't test/serialize the Page:  + page + 
, error:  + ex);
}
}

Copy the SerializableChecker code (included in Wicket) and modify it
to discover your entities.

Here's a patch (against 1.4) that our app uses to perform the check:

@@ -330,21 +410,40 @@
writeObjectMethodCache.clear();
}

+   @SuppressWarnings(all)
private void check(Object obj)
{
-   if (obj == null)
+   if (obj == null || 
obj.getClass().isAnnotationPresent(Deprecated.class)
+   || obj.getClass().isAnnotationPresent(SkipClass.class))
{
return;
}

-   Class? cls = obj.getClass();
+   Class cls = obj.getClass();
nameStack.add(simpleName);
traceStack.add(new TraceSlot(obj, fieldDescription));

if (!(obj instanceof Serializable)  
(!Proxy.isProxyClass(cls)))
{
-   throw new WicketNotSerializableException(
-   toPrettyPrintedStack(obj.getClass().getName()), 
exception);
+   throw new 
WicketNotSerializableException(toPrettyPrintedStack(obj.getClass().getName())
+   .toString(), exception);
+   }
+   if (obj instanceof IdObject)
+   {
+   Serializable id = ((IdObject) 
obj).getIdAsSerializable();
+   if (id != null  !(id instanceof Long  ((Long) id) 
= 0))
+   {
+   throw new 
WicketContainsEntityException(toPrettyPrintedStack(
+   obj.getClass().getName()).toString(), 
exception);
+   }
+   // Deze uitgezet aangezien objecten die nieuw zijn 
*wel* gewoon in de sessie
+   // mogen komen.
+   // else
+   // {
+   // log.info(New Id Object (
+   // + obj.getClass().getSimpleName() + ) Found ' + obj
+   // + ' found:  + stack);
+   // }
}

ObjectStreamClass desc;


On Thu, Aug 27, 2009 at 10:09 AM, Eelco
Hilleniuseelco.hillen...@gmail.com wrote:
 One 'hack' of a way to check whether you have stuff in your session
 that shouldn't be, is to make sure that the objects you don't want
 sticking around are not serializable, and you'll see stacktraces soon
 enough. If that's an options, it's a useful hack...

 Eelco

 On Wed, Aug 26, 2009 at 12:29 PM, Bas Goorenb...@iswd.nl wrote:
 Hi all,

 My problem is as follows: I use LoadableDetachableModels throughout my 
 application, and have made sure I never use a model without it being 
 attached to a component to prevent models which never get their detach() 
 method called.
 Nonetheless, after hitting two fairly simple pages which list some database 
 data in my application, I get a 100kb session which is filled with literal 
 strings from model objects.

 I've fired up my (Eclipse) debugger and have stepped through all models on 
 one of the pages after setting a breakpoint on the pages onDetach() method. 
 I see all LoadableDetachableModels are detached, so I have no idea what's 
 causing this.

 What would be a good strategy for finding the source of this problem?

 Bas

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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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



Subclass of base page class not rendered

2009-08-27 Thread Bergmann Manfred

Hi there.

I've run into an issue and don't know how to solve it.
My experience with Wicket is still low.

I have a BasePage, subclass of WebPage. This page has some links,  
including links to change the language.
This BasePage is not a page that is rendered directly. Only though  
subclasses.
However the link events are handled on the BasePage. In the link  
handler the locale is changed in the session and the last rendered  
page should get re-rendered.
It looks like that BasePage subclass is re-rendered because  
wicket:message/ messages are localized. But some others components  
are not.
In fact the constructor of the subclass is not called again and that's  
the reason for some components are still in the old language.
How can I force to re-instantiate this subclass while not knowing  
which subclass it is in the link click-handler?



Regards,
Manfred

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



calendar or room/time reservation components?

2009-08-27 Thread Troy Cauble
Are there any components or extensions that would help me give a calendar
based rendering of something like a room reservation system.

Multiple rooms vs time, visual blocks like meetings on google calendar,
easy to spot openings.

I've seen references to calendarviews and ddcalendar in wicketstuff,
but I didn't find any docs or examples, just where to pull source.  So I  don't
know if they're applicable, yet.

Thanks,
-troy

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



Re: calendar or room/time reservation components?

2009-08-27 Thread Tomasz Dziurko
If you need some calendar-like component with time duration and multi-events
presentation I suggest
http://www.simile-widgets.org/timeline/

and it's Wicket child (didn't use it, but functionality should is similar to
your needs):

http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-simile-timeline

-- 
Pozdrawiam,
Tomasz Dziurko


using behaviors as borders - how to?

2009-08-27 Thread Joe Hudson
Hello,

I would like to add a behavior to a component which alters the HTML output 
related to that component.  I know that you can use setComponentBorder but I 
saw a posting that mentioned behaviors were the more appropriate way to do this 
as explicit component borders might become deprecated.

I am trying to do something simple like wrap a form component with a label.
For example:
Instead of a form component rendering as:
 input type=text .../

I would like the behavior to help the component to render as
lilabelSome Label/label input type=text ...//li

So, the label component would be responsible for wrapping the inner content 
with:
lilabelSome Label/label {inner content} /li

Here is where I am at:

-  I know I probably want to extend AbstractBehavior

-  I know I probably want to use the beforeRender and afterRender 
methods to do this

Would anyone be able to give me some pointers to get started on this?  Thank 
you very much.


Regards,

Joe


Re: using behaviors as borders - how to?

2009-08-27 Thread Peter Thomas
On Thu, Aug 27, 2009 at 5:31 PM, Joe Hudson joe.hud...@clear2pay.comwrote:

 Hello,

 I would like to add a behavior to a component which alters the HTML output
 related to that component.  I know that you can use setComponentBorder but I
 saw a posting that mentioned behaviors were the more appropriate way to do
 this as explicit component borders might become deprecated.

 I am trying to do something simple like wrap a form component with a label.
 For example:
 Instead of a form component rendering as:
  input type=text .../

 I would like the behavior to help the component to render as
 lilabelSome Label/label input type=text ...//li

 So, the label component would be responsible for wrapping the inner content
 with:
 lilabelSome Label/label {inner content} /li

 Here is where I am at:

 -  I know I probably want to extend AbstractBehavior

 -  I know I probably want to use the beforeRender and afterRender
 methods to do this

 Would anyone be able to give me some pointers to get started on this?
  Thank you very much.


Al Maw's Forms With Flair presentation is a good start, you can find it
here:

http://jweekend.co.uk/dev/ArticlesPage



 Regards,

 Joe



Choose one

2009-08-27 Thread Gatos
After I choose something in DropDownChoice then 'Choose one' item is removed
from the list.

If I will try to use setNullValid(true) then 'Choose one' string is
replaced with '' (emptry string).

How is it possible to display 'Choose one' if another item has been
selected?


Re: Choose one

2009-08-27 Thread Gatos
Is it possible to reuse existing translation - I like 'Choose one'?

If my app has 32 languages, then I should create 32 records in each file?


On Thu, Aug 27, 2009 at 3:58 PM, Dipu dipu@googlemail.com wrote:

 add this in your .properties file

 yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
 to appear)

 regards


 On Thu, Aug 27, 2009 at 1:45 PM, Gatosega...@gmail.com wrote:
  After I choose something in DropDownChoice then 'Choose one' item is
 removed
  from the list.
 
  If I will try to use setNullValid(true) then 'Choose one' string is
  replaced with '' (emptry string).
 
  How is it possible to display 'Choose one' if another item has been
  selected?
 

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




Re: Choose one

2009-08-27 Thread Matthias Keller

Hi
The implementation tries these keys:
getId() + .nullValid
nullValid

So you could also have a global 'nullValid' entry somewhere in your 
resources which would be the default for ALL AbstractSingleSelectChoices 
such as DropDownChoice and RadioChoice


Matt

Gatos wrote:

Is it possible to reuse existing translation - I like 'Choose one'?

If my app has 32 languages, then I should create 32 records in each file?


On Thu, Aug 27, 2009 at 3:58 PM, Dipu dipu@googlemail.com wrote:

  

add this in your .properties file

yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
to appear)

regards


On Thu, Aug 27, 2009 at 1:45 PM, Gatosega...@gmail.com wrote:


After I choose something in DropDownChoice then 'Choose one' item is
  

removed


from the list.

If I will try to use setNullValid(true) then 'Choose one' string is
replaced with '' (emptry string).

How is it possible to display 'Choose one' if another item has been
selected?

  

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





  




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Choose one

2009-08-27 Thread Gatos
Thank you. The case is solved.

Maybe it would be a good idea to add nullValid to Wicket global translation
files, then it won't be needed to create a new record in my file. nullValid
could be used if I wan't something to override. It's something similar to
Convention over Configuration.



On Thu, Aug 27, 2009 at 4:12 PM, Matthias Keller
matthias.kel...@ergon.chwrote:

 Hi
 The implementation tries these keys:
 getId() + .nullValid
 nullValid

 So you could also have a global 'nullValid' entry somewhere in your
 resources which would be the default for ALL AbstractSingleSelectChoices
 such as DropDownChoice and RadioChoice

 Matt


 Gatos wrote:

 Is it possible to reuse existing translation - I like 'Choose one'?

 If my app has 32 languages, then I should create 32 records in each file?


 On Thu, Aug 27, 2009 at 3:58 PM, Dipu dipu@googlemail.com wrote:



 add this in your .properties file

 yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
 to appear)

 regards


 On Thu, Aug 27, 2009 at 1:45 PM, Gatosega...@gmail.com wrote:


 After I choose something in DropDownChoice then 'Choose one' item is


 removed


 from the list.

 If I will try to use setNullValid(true) then 'Choose one' string is
 replaced with '' (emptry string).

 How is it possible to display 'Choose one' if another item has been
 selected?



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











Re: Subclass of base page class not rendered

2009-08-27 Thread Pedro Santos
To force re-instantiate of an unknow subclass you can use reflection like:

setResponsePage(getPage().getClass().getConstructors()[0].newInstance());

but a simple setResponsePage(getPage()) should work to update resources used
by wicket:message for example

On Thu, Aug 27, 2009 at 6:47 AM, Bergmann Manfred
m...@software-by-mabe.comwrote:

 Hi there.

 I've run into an issue and don't know how to solve it.
 My experience with Wicket is still low.

 I have a BasePage, subclass of WebPage. This page has some links, including
 links to change the language.
 This BasePage is not a page that is rendered directly. Only though
 subclasses.
 However the link events are handled on the BasePage. In the link handler
 the locale is changed in the session and the last rendered page should get
 re-rendered.
 It looks like that BasePage subclass is re-rendered because
 wicket:message/ messages are localized. But some others components are
 not.
 In fact the constructor of the subclass is not called again and that's the
 reason for some components are still in the old language.
 How can I force to re-instantiate this subclass while not knowing which
 subclass it is in the link click-handler?


 Regards,
 Manfred

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




Dump wicket rendered html

2009-08-27 Thread Martin Makundi
Hi!

I need to dump a HTML page rendered by wicket into a file INSTEAD of
rendering it to HTTPServletResponse. How can this be done?

The reason why I need to do this is that the user wants to download
the page as PDF. I want to dump it into file, convert html-pdf and
then redirect the user to a dynamic resource which will allow the user
to download the generated pdf file.

The beef is how to dump the wicket html output of a page without
breaking anything and still being able to (after dumping) redirect the
user to the download page.

**
Martin

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



Re: Dump wicket rendered html

2009-08-27 Thread Jeremy Thomerson
search nabble for email wicket page - or something similar.  you
should be able to find a thread that answers your question.  There
have been quite a few about dumping a Wicket page to a stream or
string to email.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, Aug 27, 2009 at 8:57 AM, Martin
Makundimartin.maku...@koodaripalvelut.com wrote:
 Hi!

 I need to dump a HTML page rendered by wicket into a file INSTEAD of
 rendering it to HTTPServletResponse. How can this be done?

 The reason why I need to do this is that the user wants to download
 the page as PDF. I want to dump it into file, convert html-pdf and
 then redirect the user to a dynamic resource which will allow the user
 to download the generated pdf file.

 The beef is how to dump the wicket html output of a page without
 breaking anything and still being able to (after dumping) redirect the
 user to the download page.

 **
 Martin

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



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



Re: Subclass of base page class not rendered

2009-08-27 Thread Jeremy Thomerson
You're going about this the wrong way.  You shouldn't force a
re-instantiation.  The real problem here is that your components are
not shown as localized because apparently you are pushing the strings
into your components in the constructors.  Instead, you should use a
model that always pulls the strings based on current state.

i.e., instead of:

MyConstructor {
  add(new Label(foo, getString(some.key));
}

You should be doing:

MyConstructor {
  add(new Label(foo, new ResourceModel(some.key));
}

Incorrect use of models is the most common Wicket learning mistake.  I
suspect that's what this is.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, Aug 27, 2009 at 4:47 AM, Bergmann
Manfredm...@software-by-mabe.com wrote:
 Hi there.

 I've run into an issue and don't know how to solve it.
 My experience with Wicket is still low.

 I have a BasePage, subclass of WebPage. This page has some links, including
 links to change the language.
 This BasePage is not a page that is rendered directly. Only though
 subclasses.
 However the link events are handled on the BasePage. In the link handler the
 locale is changed in the session and the last rendered page should get
 re-rendered.
 It looks like that BasePage subclass is re-rendered because
 wicket:message/ messages are localized. But some others components are
 not.
 In fact the constructor of the subclass is not called again and that's the
 reason for some components are still in the old language.
 How can I force to re-instantiate this subclass while not knowing which
 subclass it is in the link click-handler?


 Regards,
 Manfred

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



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



Re: calendar or room/time reservation components?

2009-08-27 Thread Jeremy Thomerson
There's a calendarviews project in Wicket Stuff that I have written
and used here:
http://www.texashuntfish.com/app/calendar

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, Aug 27, 2009 at 4:57 AM, Troy Caubletroycau...@gmail.com wrote:
 Are there any components or extensions that would help me give a calendar
 based rendering of something like a room reservation system.

 Multiple rooms vs time, visual blocks like meetings on google calendar,
 easy to spot openings.

 I've seen references to calendarviews and ddcalendar in wicketstuff,
 but I didn't find any docs or examples, just where to pull source.  So I  
 don't
 know if they're applicable, yet.

 Thanks,
 -troy

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



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



Re: Dump wicket rendered html

2009-08-27 Thread Martin Makundi
Tnx

http://www.nabble.com/Generating-email-body-with-wicket-td14042459.html#a14042459

http://www.danwalmsley.com/2008/10/23/sending-html-email-with-wicket-part-ii-converting-links/

t. Martin

2009/8/27 Jeremy Thomerson jer...@wickettraining.com:
 search nabble for email wicket page - or something similar.  you
 should be able to find a thread that answers your question.  There
 have been quite a few about dumping a Wicket page to a stream or
 string to email.

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Thu, Aug 27, 2009 at 8:57 AM, Martin
 Makundimartin.maku...@koodaripalvelut.com wrote:
 Hi!

 I need to dump a HTML page rendered by wicket into a file INSTEAD of
 rendering it to HTTPServletResponse. How can this be done?

 The reason why I need to do this is that the user wants to download
 the page as PDF. I want to dump it into file, convert html-pdf and
 then redirect the user to a dynamic resource which will allow the user
 to download the generated pdf file.

 The beef is how to dump the wicket html output of a page without
 breaking anything and still being able to (after dumping) redirect the
 user to the download page.

 **
 Martin

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



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



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



Re: Dump wicket rendered html

2009-08-27 Thread Martin Makundi
Which one is the right answer?

http://www.danwalmsley.com/2008/10/21/render-a-wicket-page-to-a-string-for-html-email/

2009/8/27 Martin Makundi martin.maku...@koodaripalvelut.com:
 Tnx

 http://www.nabble.com/Generating-email-body-with-wicket-td14042459.html#a14042459

 http://www.danwalmsley.com/2008/10/23/sending-html-email-with-wicket-part-ii-converting-links/

 t. Martin

 2009/8/27 Jeremy Thomerson jer...@wickettraining.com:
 search nabble for email wicket page - or something similar.  you
 should be able to find a thread that answers your question.  There
 have been quite a few about dumping a Wicket page to a stream or
 string to email.

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Thu, Aug 27, 2009 at 8:57 AM, Martin
 Makundimartin.maku...@koodaripalvelut.com wrote:
 Hi!

 I need to dump a HTML page rendered by wicket into a file INSTEAD of
 rendering it to HTTPServletResponse. How can this be done?

 The reason why I need to do this is that the user wants to download
 the page as PDF. I want to dump it into file, convert html-pdf and
 then redirect the user to a dynamic resource which will allow the user
 to download the generated pdf file.

 The beef is how to dump the wicket html output of a page without
 breaking anything and still being able to (after dumping) redirect the
 user to the download page.

 **
 Martin

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



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




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



RE: Choose one

2009-08-27 Thread Warren Bell
I needed to do the same thing. I saw this on another post and it works
fine. Override getDefaultChoice:

protected CharSequence getDefaultChoice(Object selected)
{
  return option selected=\selected\ value=\\Choose One/option;

}

You can use
getLocalizer().getString(yourpage.dropdownchoice.defaultvalue, this)
for your different languages.

Warren


-Original Message-
From: Gatos [mailto:ega...@gmail.com] 
Sent: Thursday, August 27, 2009 5:46 AM
To: users@wicket.apache.org
Subject: Choose one

After I choose something in DropDownChoice then 'Choose one' item is
removed from the list.

If I will try to use setNullValid(true) then 'Choose one' string is
replaced with '' (emptry string).

How is it possible to display 'Choose one' if another item has been
selected?

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



Re: Quick model/user/session question

2009-08-27 Thread Dane Laverty
Thanks for the suggestion. I've actually already got OpenSessionInViewFilter
in my web.xml, like so:

filter
filter-namewicket.filter/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationFactoryClassName/param-name

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
/filter

filter
   filter-nameopen.hibernate.session.in.view/filter-name

filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class
/filter

!-- Important! This filter mapping must come before Wickets! --
filter-mapping
   filter-nameopen.hibernate.session.in.view/filter-name
   url-pattern/*/url-pattern
/filter-mapping

filter-mapping
filter-namewicket.filter/filter-name
url-pattern/*/url-pattern
/filter-mapping

Is there anything else I need to do in order to make OSIV work? Everything
I've read says it just needs to be placed in the web.xml.

Thanks,

Dane



On Wed, Aug 26, 2009 at 7:58 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Wed, Aug 26, 2009 at 6:30 PM, Dane Lavertydanelave...@gmail.com
 wrote:
  As I understand it, the LazyInitializationException is thrown because the
  Hibernate session closes after I call EntityDao.load(). But if that's the
  problem, then why should an LDM help? Won't the Hibernate session close
  again as soon as the LDM's load() is called?

 google OpenSessionInViewFilter, it keeps the hibernate session open
 for the entire request.

 -igor

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




Re: Wicketstuff releases?

2009-08-27 Thread Johannes Schneider
Any news here? I want to use input-events which has not been released
yet. Any timeline for that module?


Thanks,

Johannes

Erik van Oosten wrote:
 Hello,
 
 Now that Wicket 1.4.0 is out, I wonder which wicketstuff core version is
 compatible. There is no 1.4.0 version of wicketstuff core (yet?). Should I
 use 1.4-rc8-SNAPSHOT?
 
 I guess http://sourceforge.net/projects/wicket-stuff/files/ is no longer in
 use.
 
 Regards,
Erik.
 
 
 --
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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



Male/Female messages

2009-08-27 Thread Arie Fishler
Hi,

Assuming that I am localizing to a language that has different text required
for male and female is there a generic way for hadling that. This is of
course based on the fact that I can provide a user object that contains that
property (if the user is a male or female)

I can think of a convention that will add to all resource file keys a
.female extension to handle female text if required and wrap the
ResourceModel with an object that will get the user. Using the gender
property of the user it will manipulate the key to add the .female extension
if required, check if the female text exist at all (and if no default to the
no extension version) etc.

This may work. Are there any other suggestions? What about the
wicket:message markup that goes directly to the resource files...how do I
handle that? (I have lots of markup already so changing all of it to labels
is not the easiest way)

Thanks,
Arie


Re: Male/Female messages

2009-08-27 Thread Cserep Janos
use setStyle()  and different styles for property files. That means
you should have 2 files:

MyApplication_male.properties
MyApplication_female.properties

j


On Thu, Aug 27, 2009 at 5:32 PM, Arie Fishlerarie@gmail.com wrote:
 Hi,

 Assuming that I am localizing to a language that has different text required
 for male and female is there a generic way for hadling that. This is of
 course based on the fact that I can provide a user object that contains that
 property (if the user is a male or female)

 I can think of a convention that will add to all resource file keys a
 .female extension to handle female text if required and wrap the
 ResourceModel with an object that will get the user. Using the gender
 property of the user it will manipulate the key to add the .female extension
 if required, check if the female text exist at all (and if no default to the
 no extension version) etc.

 This may work. Are there any other suggestions? What about the
 wicket:message markup that goes directly to the resource files...how do I
 handle that? (I have lots of markup already so changing all of it to labels
 is not the easiest way)

 Thanks,
 Arie


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



Re: users Digest 27 Aug 2009 15:08:59 -0000 Issue 2060

2009-08-27 Thread Bergmann Manfred

Thanks for that pointer.
I've looked over the model and got it working with overriding  
getObject() in PropertyModel.



Manfred




Von: Jeremy Thomerson jer...@wickettraining.com
Datum: 27. August 2009 15:17:49 GMT+01:00
An: users@wicket.apache.org
Betreff: Re: Subclass of base page class not rendered


You're going about this the wrong way.  You shouldn't force a
re-instantiation.  The real problem here is that your components are
not shown as localized because apparently you are pushing the strings
into your components in the constructors.  Instead, you should use a
model that always pulls the strings based on current state.

i.e., instead of:

MyConstructor {
 add(new Label(foo, getString(some.key));
}

You should be doing:

MyConstructor {
 add(new Label(foo, new ResourceModel(some.key));
}

Incorrect use of models is the most common Wicket learning mistake.  I
suspect that's what this is.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, Aug 27, 2009 at 4:47 AM, Bergmann
Manfredm...@software-by-mabe.com wrote:

Hi there.

I've run into an issue and don't know how to solve it.
My experience with Wicket is still low.

I have a BasePage, subclass of WebPage. This page has some links,  
including

links to change the language.
This BasePage is not a page that is rendered directly. Only though
subclasses.
However the link events are handled on the BasePage. In the link  
handler the
locale is changed in the session and the last rendered page should  
get

re-rendered.
It looks like that BasePage subclass is re-rendered because
wicket:message/ messages are localized. But some others  
components are

not.
In fact the constructor of the subclass is not called again and  
that's the

reason for some components are still in the old language.
How can I force to re-instantiate this subclass while not knowing  
which

subclass it is in the link click-handler?


Regards,
Manfred



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



Re: Wicketstuff releases?

2009-08-27 Thread Johannes Schneider
By the way:

Wicketstuff contains an old repository definition that should be removed
(in input-events).


Thanks,

Johannes


Johannes Schneider wrote:
 Any news here? I want to use input-events which has not been released
 yet. Any timeline for that module?
 
 
 Thanks,
 
 Johannes
 
 Erik van Oosten wrote:
 Hello,

 Now that Wicket 1.4.0 is out, I wonder which wicketstuff core version is
 compatible. There is no 1.4.0 version of wicketstuff core (yet?). Should I
 use 1.4-rc8-SNAPSHOT?

 I guess http://sourceforge.net/projects/wicket-stuff/files/ is no longer in
 use.

 Regards,
Erik.


 --
 Erik van Oosten
 http://day-to-day-stuff.blogspot.com/


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

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

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



Re: AbstractAjaxTimerBehavior on Modal Window causes PageExpiredException

2009-08-27 Thread Mathias Nilsson

Does all your models and obejcts implement Serializable?
-- 
View this message in context: 
http://www.nabble.com/AbstractAjaxTimerBehavior-on-Modal-Window-causes-PageExpiredException-tp25159539p25178263.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



label fails serializable check when i override model().getObject (wicket 1.3.6)

2009-08-27 Thread james o'brien
I'm trying to change the text of label based on whether a flag is set for
graph or not graph.
graphLink.add(new Label(graphLinkLabel, new Model() {
@Override
public Object getObject() {
return isGraph ? List : Graph;
}
}));

When I do this, I get a private
org.apache.wicket.markup.html.link.PopupSettings
org.apache.wicket.markup.html.link.Link.popupSettings[6]
[class=com.spinn.ui.person.weight.ViewWeights$4, path=6:border:graphLink]
  final javax.servlet.http.HttpServletRequest
com.spinn.ui.person.weight.ViewWeights$4.val$request
[class=org.apache.catalina.connector.RequestFacade] - field that is not
serializable
at
org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:339)

If I change it to a normal label I do not.
Any ideas?
-jim


Re: Choose one

2009-08-27 Thread Erik van Oosten

Call setRequired(false) on the dropdownchoice.

Regards,
   Erik.


Gatos wrote:

After I choose something in DropDownChoice then 'Choose one' item is removed
from the list.

If I will try to use setNullValid(true) then 'Choose one' string is
replaced with '' (emptry string).

How is it possible to display 'Choose one' if another item has been
selected?

  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: AjaxLink/Behaviour with shortcut

2009-08-27 Thread Johannes Schneider
That thing works great with normal links. But I have a problem with
Ajax(Fallback)Links. The created JavaScript looks good but it does not work.
Since I really don't understand JavaScript I don't have a clue what to
do next. I have modified the example to reproduce the problem:


Add to HomePage.html:

 hra href=# wicket:id=ajaxLinkAjax here!/a


Added to HomePage.java:

 AjaxLinkObject ajaxLink = new AjaxLinkObject(ajaxLink) {
  @Override
  public void onClick( AjaxRequestTarget ajaxRequestTarget ) {
System.out.println( # );
  }
};

ajaxLink.add( new InputBehavior( new KeyType[]{KeyType.n} ) );
add( ajaxLink );



Any ideas?


Thanks,

Johannes


danisevsky wrote:
 look at
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/input-events-parent/
 
 2009/8/26 Johannes Schneider maili...@cedarsoft.com
 
 Hi,

 I have here several AjaxLinks that should be triggered using a shortcut
 (e.g. PageDown or Delete).
 Does anybody have some lines of code or a hint how that could be done?

 Alternatively a AjaxBehaviour could be used to start the action.


 Any ideas?
 Thanks,


 Johannes

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


 

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



DataTable NavigationToolbar visibility problem

2009-08-27 Thread Aaron Hiniker
I have a DefaultDataTable that is sourcing data from a custom
SortableDataTable.

My size() and iterator() implementations are not cached, but are executing
each on each call (I have confirmed that size() is getting called on each
page render).

My problem is:

When I add a filter to my query that returns a 0 row count, the
NavigationToolbar is hidden, and when I remove the filter, the results come
back as expected but the NavigationToolbar doesn't reappear.

I attached a debugger and it appears that the
NavigationToolbar#onBeforeRender() is not getting called when I remove the
filter, so the visibility state will never be updated.  Using
wicket+wicket-extensions 1.4.0.  How do I ensure that the nav toolbar
reappears properly when the number of results become pageable again?

Thanks,

Aaron


RE: AbstractAjaxTimerBehavior on Modal Window causes PageExpiredException

2009-08-27 Thread Warren Bell
Yes all my objects that need to be serialized are being serialized.

I put together a workaround. In the onClick() that closes the Modal
Window. I called AbstractAjaxTimerBehavior#stop() then waited for a
period longer than the Duration of the AbstractAjaxTimerBehavior and
then closed the Modal Window. This worked, but it is kinda clunky and I
could see cases where it wouldn't. I think what is happening is that the
AbstractAjaxTimerBehavior requests are conflicting with the closeing of
the Modal Window. I was looking for a way that would close the Modal
Window only after the last request/response was made from the
AbstractAjaxTimerBehavior.

Is there a way of finding out when the last AbstractAjaxTimerBehavior
response comes back from the server before closeing the Modal Window or
am I going down the wrong path here?

Warren

-Original Message-
From: Mathias Nilsson [mailto:wicket.program...@gmail.com] 
Sent: Thursday, August 27, 2009 12:18 PM
To: users@wicket.apache.org
Subject: Re: AbstractAjaxTimerBehavior on Modal Window causes
PageExpiredException


Does all your models and objects that you use in the wicket page
implement Serializable?
--
View this message in context:
http://www.nabble.com/AbstractAjaxTimerBehavior-on-Modal-Window-causes-P
ageExpiredException-tp25159539p25178263.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: DataTable NavigationToolbar visibility problem

2009-08-27 Thread Maarten Bosteels
Hi,

Can't really tell you what the solution is.
But the wicket devs might be interested to know that I noticed the same
problem in the wicket phonebook example.
So at least reproducing the problem should be easy :-)

http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook/

regards,
Maarten

On Thu, Aug 27, 2009 at 10:19 PM, Aaron Hiniker hin...@gmail.com wrote:

 I have a DefaultDataTable that is sourcing data from a custom
 SortableDataTable.

 My size() and iterator() implementations are not cached, but are executing
 each on each call (I have confirmed that size() is getting called on each
 page render).

 My problem is:

 When I add a filter to my query that returns a 0 row count, the
 NavigationToolbar is hidden, and when I remove the filter, the results come
 back as expected but the NavigationToolbar doesn't reappear.

 I attached a debugger and it appears that the
 NavigationToolbar#onBeforeRender() is not getting called when I remove the
 filter, so the visibility state will never be updated.  Using
 wicket+wicket-extensions 1.4.0.  How do I ensure that the nav toolbar
 reappears properly when the number of results become pageable again?

 Thanks,

 Aaron



Re: AjaxLink/Behaviour with shortcut

2009-08-27 Thread Johannes Schneider
I made some progress:

When using the (newly created) EventType onclick the behvious seems to
be improved.

The first time it works great, but if I add the link to the
AjaxRequestTarget (so that the link is updated), the event is executed
multiple times...


Regards,

Johannes


Johannes Schneider wrote:
 That thing works great with normal links. But I have a problem with
 Ajax(Fallback)Links. The created JavaScript looks good but it does not work.
 Since I really don't understand JavaScript I don't have a clue what to
 do next. I have modified the example to reproduce the problem:
 
 
 Add to HomePage.html:
 
  hra href=# wicket:id=ajaxLinkAjax here!/a
 
 
 Added to HomePage.java:
 
  AjaxLinkObject ajaxLink = new AjaxLinkObject(ajaxLink) {
   @Override
   public void onClick( AjaxRequestTarget ajaxRequestTarget ) {
 System.out.println( # );
   }
 };
 
 ajaxLink.add( new InputBehavior( new KeyType[]{KeyType.n} ) );
 add( ajaxLink );
 
 
 
 Any ideas?
 
 
 Thanks,
 
 Johannes
 
 
 danisevsky wrote:
 look at
 https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/input-events-parent/

 2009/8/26 Johannes Schneider maili...@cedarsoft.com

 Hi,

 I have here several AjaxLinks that should be triggered using a shortcut
 (e.g. PageDown or Delete).
 Does anybody have some lines of code or a hint how that could be done?

 Alternatively a AjaxBehaviour could be used to start the action.


 Any ideas?
 Thanks,


 Johannes

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


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

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



RE: TinyMCE in an Ajax loaded panel

2009-08-27 Thread Martin Heras

Sverre,

Could you paste the code in a formatted way? I tried to use that code, but
its syntax is not right...
I don't understand the fragment where you use AjaxCallDecorator... The
fragment just says return new AjaxCallDecorator but that is not inside any
method... Please I need this as soon as possible for my project!

Thank you ver much for your time,
Regards,
Martin


Sverre Boschman wrote:
 
 For wicket 1.3.4/5 in combination with the latest 1.3 wicket-tinymce
 snaphot I solved this problem the following way. 
 
 Note: Also linked to newer tinymce scripts than those supplied in the
 wicket-tinymce jar (building my own javascript reference for that, as
 you will notice in the code).
 
 Create a page behaviour, supply your tinymce settings in the contructor
 f.e.
 This page behaviour will initialize the tinymce editor on the page, but
 does not make any textfields tinymce aware. Having the editor
 initialized on the page will allow you to add textfields with ajax calls
 and make them tinymce aware. See below for some example code.
 
 Next you have to make your own TinyMCEBehavior. The default renderHead
 method does not handle ajax reponses very well. So I rewrote the part
 where it generates the javascript that has to be attached to the
 component (the textfield most likely).
 The real voodoo is the getRenderOnDomReadyJavascript() method, which
 checks for an AjaxHeaderResponse (private inner class... so an ugly
 string comparison on the classname) and makes the javascript call
 (tinyMCE.execCommand('mceAddControl'...) to the editor already
 initialized on the page to transform a textfield in an tinymce
 textfield.
 
 If you want to play around with the focus, you can use this (I have this
 in an onAjaxLoad() method on the panel, which get called when the panel
 is loaded by an ajax call):
 tinyMCE.execCommand('mceFocus',false,' + markupId + ');
 
 But more important is adding an AjaxCallDecorator to the panel that gets
 fired when the panel is unloaded. It has to sync to tinymce input with
 the original textfield and it has to remove the textarea from the
 tinymce editor instance. If you don't, you run into problems with text
 not syncing after the second ajax replace.
 
 Good luck with it,
 Sverre
 
 
 ---
 
 public class TinyMceAjaxPageBehavior extends AbstractBehavior
 {
   public TinyMceAjaxPageBehavior()
   {
   this(new TinyMCESettings());
   }
 
   /**
* @param settings
*/
   public TinyMceAjaxPageBehavior(TinyMCESettings settings)
   {
   this.settings = settings;
   }
 
   /**
* @see
 org.apache.wicket.behavior.AbstractBehavior#bind(org.apache.wicket.Compo
 nent)
*/
   @Override
   public void bind(Component component)
   {
   super.bind(component);
   path =
 component.getRequest().getRelativePathPrefixToContextRoot();
   }
 
   /**
* @see
 wicket.contrib.tinymce.TinyMceBehavior#renderHead(org.apache.wicket.mark
 up.html.IHeaderResponse)
*/
   @Override
   public void renderHead(IHeaderResponse response)
   {
 
   response.renderJavascriptReference(path +
 tiny_mce/tiny_mce.js, tiny_mce);
   response.renderJavascript(getAddTinyMceSettingsScript(),
 null);
   }
 
   /**
* @see IridiumTinyMceBehavior.getAddTinyMceSettingsScript
*/
   protected String getAddTinyMceSettingsScript()
   {
   return  +  tinyMCE.init({
   + settings.toJavaScript(Mode.none, new
 ArrayListComponent()) +  });\n
   + settings.getLoadPluginJavaScript() +
 settings.getAdditionalPluginJavaScript();
   }
 }
 
 
 public class MyTinyMceBehavior extends TinyMceBehavior
 {
   /**
* @see
 wicket.contrib.tinymce.TinyMceBehavior#renderHead(org.apache.wicket.mark
 up.html.IHeaderResponse)
*/
   @Override
   public void renderHead(IHeaderResponse response)
   {
   if (getComponent() == null)
   throw new IllegalStateException(TinyMceBehavior
 is not bound to a component);
 
   String path =
 getComponent().getRequest().getRelativePathPrefixToContextRoot();
   response.renderJavascriptReference(path +
 tiny_mce/tiny_mce.js, tiny_mce);
 
   // Supplied tinyMCE version in the wicket-tinymce jar
   //
 response.renderJavascriptReference(TinyMCESettings.javaScriptReference()
 );
 
   String renderOnDomReady =
 getRenderOnDomReadyJavascript(response);
   if (renderOnDomReady != null)
   {
   
 response.renderOnDomReadyJavascript(renderOnDomReady);
 
   return;
   }
 
   String renderJavaScript = getRenderJavascript(response);
   if (renderJavaScript != null)
   response.renderJavascript(renderJavaScript,
 null);
   }
 
   /**
* 

how to format DateField

2009-08-27 Thread Sadhna Ahuja
Hi,

 

I am using a DateField and in my css I am trying to make the font size
smaller for this component.

 

I notice that the DatePicker calendar font has become smaller, but the
DateTextField does not get that style.

 

How should I make the DateTextField get the same style?

 

Here's the relevant pieces from my code.

 

HTML:

-

wicket:extend

form wicket:id=depositSummarySearchForm

fieldset

table

tr

tdspan wicket:id=dtTm class=gwformdate
tabindex=1 //td

/tr

tr

tdinput type=submit value=Search
name=submitSearch tabindex=3/td

/tr

/table

/fieldset

/form

 

CSS:



span.gwformdate {

color: Black;

font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

font-size: x-small;

font-weight: 500;

}

 

Thanks,

Sadhna.

 



rendering dom in modal window

2009-08-27 Thread Fernando Wermus
Hi all,
 Nino has commented that it could be some problem in a modal window with
another javascript library. For instance, I tried adding SWFObject to the
modal window without success. Nico has said that this could be related to a
DOM issue. Could anyone explain this point in more detail?

What I know is that DOM is the api to interact with the html tree and I cant
imagine in which way this could influence

Thanks in advance.

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: [announce] wicket 1.4.x branched

2009-08-27 Thread Jörn Zaefferer
Is this the right place to look for planned features for 1.5?
http://cwiki.apache.org/WICKET/wicket-15-wish-list.html

Jörn

On Thu, Aug 20, 2009 at 5:10 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote:
 Wicket 1.4.x has been branched and now lives in
 https://svn.apache.org/repos/asf/wicket/branches/wicket-1.4.x
 Trunk is now what will become 1.5.0.

 Trunk may be broken in the early days of development and contain a lot
 of API breaks, so if you are following bleeding edge you may want to
 do so on the 1.4.x branch for a while.

 -igor

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



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



Re: FileUploadField bug in Chrome with ajax?

2009-08-27 Thread Tauren Mills
Peter,

Thanks for pointing out the other thread. I'll try the quickstart
attached to the JIRA issue and see if I can replicate the problem I'm
having.

Tauren



2009/8/26 Major Péter majorpe...@sch.bme.hu:
 Hi,

 I was experiencing the same thing, but it was in FF (3.5.2) for me.
 See details:
 http://osdir.com/ml/users-wicket.apache.org/2009-08/msg00836.html

 Regards,
 Peter

 2009-08-26 05:46 keltezéssel, Tauren Mills írta:

 I haven't confirmed this is really a bug yet, but it looks like there
 may be a problem using Ajax form submit with FileUploadField in
 Chrome.  I'm using Wicket 1.4.1.  Using an ajaxbutton submitted form,
 I get this error in wicket-ajax-debug:

 ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Could
 not find rootajax-response  element

 If i take the FileUploadField out of my form, it works fine.  Add it
 back, it fails.  The form works fine in FF with or without the
 FileUploadField. Is anyone else experiencing this?

 Tauren

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



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



RE: using behaviors as borders - how to?

2009-08-27 Thread Joe Hudson
Thank you Peter.  That link was extremely helpful!

Joe

-Original Message-
From: Peter Thomas [mailto:ptrtho...@gmail.com] 
Sent: Thursday, August 27, 2009 8:12 AM
To: users@wicket.apache.org
Subject: Re: using behaviors as borders - how to?

On Thu, Aug 27, 2009 at 5:31 PM, Joe Hudson joe.hud...@clear2pay.comwrote:

 Hello,

 I would like to add a behavior to a component which alters the HTML output
 related to that component.  I know that you can use setComponentBorder but I
 saw a posting that mentioned behaviors were the more appropriate way to do
 this as explicit component borders might become deprecated.

 I am trying to do something simple like wrap a form component with a label.
 For example:
 Instead of a form component rendering as:
  input type=text .../

 I would like the behavior to help the component to render as
 lilabelSome Label/label input type=text ...//li

 So, the label component would be responsible for wrapping the inner content
 with:
 lilabelSome Label/label {inner content} /li

 Here is where I am at:

 -  I know I probably want to extend AbstractBehavior

 -  I know I probably want to use the beforeRender and afterRender
 methods to do this

 Would anyone be able to give me some pointers to get started on this?
  Thank you very much.


Al Maw's Forms With Flair presentation is a good start, you can find it
here:

http://jweekend.co.uk/dev/ArticlesPage



 Regards,

 Joe


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



Page redirect after POST

2009-08-27 Thread bht
Hi,

With forms on Wicket pages, it appears that on submit which is HTTP
POST, Wicket redirects to the same page (the page from where the data
was sent) ad this is how we show feedback on the form page.

How is it possible to send the rendered form page back to the broser
as a direct response to the POST, not via a redirect?

Many thanks.

Bernard

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



Re: Page redirect after POST

2009-08-27 Thread Jeremy Thomerson
http://cwiki.apache.org/WICKET/render-strategies.html

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, Aug 27, 2009 at 11:01 PM, b...@actrix.gen.nz wrote:
 Hi,

 With forms on Wicket pages, it appears that on submit which is HTTP
 POST, Wicket redirects to the same page (the page from where the data
 was sent) ad this is how we show feedback on the form page.

 How is it possible to send the rendered form page back to the broser
 as a direct response to the POST, not via a redirect?

 Many thanks.

 Bernard

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



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



How to use session

2009-08-27 Thread Gerald Fernando
Hello Friends,
I have page in which textField and button .
when submit a form (onClick )  i need to call same page and pass argument to
that page.
so that page will take argument from session variable.How to store and how
to get that value
*for loading same page*,Shall i call the page using *setResponsePage*
and *shall
i get the argument* for that page from session variable?
how can i achieve this.

-- 
Thanksregards,
Gerald A


Re: How to use session

2009-08-27 Thread Jeremy Thomerson
Why put the variable in the session at all?  Do this in your onSubmit:

onSubmit() {
setResponsePage(new SomePage(this.someVariable));
}

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, Aug 28, 2009 at 12:17 AM, Gerald
Fernandogerald.anto.ferna...@gmail.com wrote:
 Hello Friends,
 I have page in which textField and button .
 when submit a form (onClick )  i need to call same page and pass argument to
 that page.
 so that page will take argument from session variable.How to store and how
 to get that value
 *for loading same page*,Shall i call the page using *setResponsePage*
 and *shall
 i get the argument* for that page from session variable?
 how can i achieve this.

 --
 Thanksregards,
 Gerald A


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