Re: Login page stateless??

2012-04-25 Thread Serban.Balamaci
Dan, how about an attacker who uses a script to just call the login page 
lots of time. Could it not cause an OutOfMemory error or at least a
degradation of your application performance by your web server having to
manage millions of sessions apart for the legit ones?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Login-page-stateless-tp4584483p4585721.html
Sent from the Users forum 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



Re: wicket yui 1.5.5

2012-04-25 Thread Martin Grigorov
Hi,

Unfortunately no one so far migrated it to 1.5.x
https://github.com/wicketstuff/core/blob/core-1.5.x/jdk-1.5-parent/pom.xml#L85

On Tue, Apr 24, 2012 at 8:53 PM, fachhoch fachh...@gmail.com wrote:
 I am upgrading my project to 1.5 , I use wicketstuff   yui,  is there  1.5
 release for yui ?



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-yui-1-5-5-tp4584353p4584353.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Wicket dropdownchoice onselectionchanged must override or implement a supertype method

2012-04-25 Thread Martin Grigorov
On Tue, Apr 24, 2012 at 9:22 PM, Sebastien seb...@gmail.com wrote:
 Right, should probably be something like:
 protected void onSelectionChanged(SelectOption newSelection) {};

 Also, note that SelectOption is generic...

I hope his SelectOption is not
org.apache.wicket.extensions.markup.html.form.select.SelectOption
because there is no much sense in that.


 Regards,
 Sebastien.


 On Tue, Apr 24, 2012 at 8:18 PM, Per Newgro per.new...@gmx.ch wrote:

 it is because of the @override annotation on a non-existent method.
 Check the signature of the

 onSelectionChanged


 Cheers
 Per

 Am 24.04.2012 20:04, schrieb kshitiz:

  Hi,

 I am trying to implement wicket drop down choice with on selection changed
 feature. But as I write :

 final DropDownChoiceSelectOption  postCategoriesDropDown = new
 DropDownChoiceSelectOption(**postCategories, iModel,
 Arrays.asList(selectOption), choiceRenderer)
            {
                /**
                         *
                         */
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected boolean wantOnSelectionChangedNotifica**
 tions()
                {
                 return true;
             }

                        @Override
                        protected void onSelectionChanged(final Object
 newSelection)
                        {
                                SelectOption selectOption = (SelectOption)
 newSelection;

                        }

                };

 eclipse shows an error:

 *The method onSelectionChanged(Object) of type new
 DropDownChoiceSelectOption()**{} must override or implement a supertype
 method*

 Can you please tell me what can be the reason?? I am following
 https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.htmlhttps://cwiki.apache.org/WICKET/dropdownchoice-examples.html
 https://cwiki.apache.org/**WICKET/dropdownchoice-**examples.htmlhttps://cwiki.apache.org/WICKET/dropdownchoice-examples.html

 --
 View this message in context: http://apache-wicket.1842946.**
 n4.nabble.com/Wicket-**dropdownchoice-**onselectionchanged-must-**
 override-or-implement-a-**supertype-method-**tp4584391p4584391.htmlhttp://apache-wicket.1842946.n4.nabble.com/Wicket-dropdownchoice-onselectionchanged-must-override-or-implement-a-supertype-method-tp4584391p4584391.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: AbstractAjaxBehavior and second request

2012-04-25 Thread Martin Grigorov
Hi,

On Wed, Apr 25, 2012 at 12:44 AM, Brian Mulholland
blmulholl...@gmail.com wrote:
 I have a javascript widget on my page that will issue multiple
 requests.  I am using an AbstractAjaxBehavior and priming the
 javascript component with the uri from getCallbackUri().  First
 request works flawlessly.  But the next request using the same uri
 (excepting the extra parameters that the javascript widget tacks on),
 and it is not getting to the onRequest() method.

 I can confirm that the request is going out because I can see it in firebug.

 first request:
 http://localhost:9080/ManagementCenter/?wicket:interface=:7:subscriptionList::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true_dc=1335302423707page=1start=0limit=20group=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5Dsort=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5D

 second request:
 http://localhost:9080/ManagementCenter/?wicket:interface=:7:subscriptionList::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true_dc=1335302444162page=2start=20limit=20group=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5Dsort=%5B%7B%22property%22%3A%22RECIPIENT_USER%22%2C%22direction%22%3A%22ASC%22%7D%5D

 I see the wicket:interface portion in there.  Does this number need to
 increment or something?

I think wicket:interface value is OK.
Put a breakpoint in WicketFilter#doFilter() and see what happens.


 Brian Mulholland
 For every complex problem, there is an answer that is clear, simple and 
 wrong.
 --H.L. Mencken

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



How to add unknown number of components?

2012-04-25 Thread cosmindumy
Hello,
I want to add multiple ajaxlinks. Actually I don't know the number. How cand
I add them dinamically and generate the html dinamically? 
Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-add-unknown-number-of-components-tp4585816p4585816.html
Sent from the Users forum 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



Re: How to add unknown number of components?

2012-04-25 Thread Martin Grigorov
Hi,

You can use any kind of repeater component for that.

On Wed, Apr 25, 2012 at 10:45 AM, cosmindumy cosmind...@yahoo.com wrote:
 Hello,
 I want to add multiple ajaxlinks. Actually I don't know the number. How cand
 I add them dinamically and generate the html dinamically?
 Thanks.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-add-unknown-number-of-components-tp4585816p4585816.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Login page stateless??

2012-04-25 Thread Martin Grigorov
Hi,

As Bas said this means that there is another component in the page
that makes it stateful.
You can use wicket-devutils's @StatelessComponent and StatelessChecker
to find out which component is causing this.

On Tue, Apr 24, 2012 at 9:50 PM, Alfonso Quiroga alfonsose...@gmail.com wrote:
 Hi, in my job we have an application, and the LoginPage is like any
 other page. The testing team reported that when you see the login
 page, a new Session is being created by wicket (they see it in
 jProfiler). I've used a StatelessForm, but the session is still being
 created.

 The problem is that the application will be in internet, and is VERY
 easy to attack if we create a session in the login page. The only
 workaround I am thining... is creating a plain html file (login), and
 then redirect to a wicket page. Any other solution? thanks!!

This is an option too. The only small problem here is that Wicket's
PageParameters do not parse POST parameters, so you will have to use
getRequest().getRequestParameters() in that page to read the submitted
credentials.


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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Any news on 1.5 - mapping different error pages for specific errors

2012-04-25 Thread jensiator
I Think is something like: 
public IRequestHandler onException(RequestCycle pCycle, Exception
pException) {
if(pException instanceof SomeException) {
 return new RenderPageRequestHandler(new PageProvider(new
SomeSpecialOwnErrorPage()));
}
}

From my peek in the super class. Have not tested it. Please correct me if
I'm wrong. 
Let us all try to give each other code example in these discussion instead
of referring to sourcecode. Have anyone looked at competing languages like
Csharp. They got a lot of example codes i MSDN. Lets do the same!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Any-news-on-1-5-mapping-different-error-pages-for-specific-errors-tp3602151p4585856.html
Sent from the Users forum 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



Wicket 1.5 ListMultipleChoice add Serializable values

2012-04-25 Thread dpmihai
Hi.

I have a code that was working in 1.4 but it shows an error message in
wicket 1.5.

I have a TextField, an AjaxSubmitLink and a ListMultipleChoice. When I click
the submit link I want to add the value from text field to the list.

ArrayListSerializable list = new ArrayListSerializable();
list.add(1);
list.add(2);
list.add(3);
listModel = new ModelArrayListlt;Serializable(list);

Form form = new Form(form);

final FeedbackPanel feedbackPanel = new FeedbackPanel(feedback);
feedbackPanel.setOutputMarkupId(true);
form.add(feedbackPanel);

final TextFieldString textField = new TextFieldString(txtValue, new
PropertyModelString(this, objectModel));

final ModelArrayListlt;Serializable choiceModel = new
ModelArrayListlt;Serializable();
final ListMultipleChoice listChoice = new ListMultipleChoice(listChoice,
choiceModel, listModel);
listChoice.setMaxRows(100);
listChoice.setOutputMarkupId(true);   

AjaxSubmitLink addLink = new AjaxSubmitLink(addElement, form) {

@Override
protected void onSubmit(AjaxRequestTarget target, Form? form) {   
if (objectModel == null) {
return;
}
ArrayListSerializable model = listModel.getObject();
if (objectModel instanceof String) {
try {
if (!model.contains(objectModel)) {
model.add(objectModel);
}
} catch (NumberFormatException ex) {
error(Invalid value type.);
}
} 

if (target != null) {
target.add(listChoice);
}
}

@Override
protected void onError(AjaxRequestTarget target, Form? form) {
target.add(form);
}

};

form.add(textField);
form.add(listChoice);
form.add(addLink);   
add(form);

In Wicket 1.5 I get : '4' is not a valid Serializable.
I have to use Serializable because I have more components text field, date
field to take the value.
I I use String instead of Serializable, it works.

What is wrong in wicket 1,5? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-tp4585991p4585991.html
Sent from the Users forum 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



Re: Any news on 1.5 - mapping different error pages for specific errors

2012-04-25 Thread Martin Grigorov
Hi Jens,

On Wed, Apr 25, 2012 at 11:04 AM, jensiator jens.alen...@gmail.com wrote:
 I Think is something like:
 public IRequestHandler onException(RequestCycle pCycle, Exception
 pException) {
 if(pException instanceof SomeException) {
  return new RenderPageRequestHandler(new PageProvider(new
 SomeSpecialOwnErrorPage()));
 }
 }

 From my peek in the super class. Have not tested it. Please correct me if
 I'm wrong.
 Let us all try to give each other code example in these discussion instead
 of referring to sourcecode. Have anyone looked at competing languages like
 Csharp. They got a lot of example codes i MSDN. Lets do the same!

Since we don't have few hundred paid employees which main task is too
keep the documentation up-to-date we rely on the community to
update the Wiki and send patches (for javadocs as well) ;-)


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Any-news-on-1-5-mapping-different-error-pages-for-specific-errors-tp3602151p4585856.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Wicket 1.5 ListMultipleChoice add Serializable values

2012-04-25 Thread Martin Grigorov
Hi,

It is pure Java, not Wicket: ArrayList? extends Serializable

On Wed, Apr 25, 2012 at 11:58 AM, dpmihai dpmi...@yahoo.com wrote:
 Hi.

 I have a code that was working in 1.4 but it shows an error message in
 wicket 1.5.

 I have a TextField, an AjaxSubmitLink and a ListMultipleChoice. When I click
 the submit link I want to add the value from text field to the list.

 ArrayListSerializable list = new ArrayListSerializable();
 list.add(1);
 list.add(2);
 list.add(3);
 listModel = new ModelArrayListSerializable(list);

 Form form = new Form(form);

 final FeedbackPanel feedbackPanel = new FeedbackPanel(feedback);
 feedbackPanel.setOutputMarkupId(true);
 form.add(feedbackPanel);

 final TextFieldString textField = new TextFieldString(txtValue, new
 PropertyModelString(this, objectModel));

 final ModelArrayListSerializable choiceModel = new
 ModelArrayListSerializable();
 final ListMultipleChoice listChoice = new ListMultipleChoice(listChoice,
 choiceModel, listModel);
 listChoice.setMaxRows(100);
 listChoice.setOutputMarkupId(true);

 AjaxSubmitLink addLink = new AjaxSubmitLink(addElement, form) {

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form? form) {
                if (objectModel == null) {
                    return;
                }
                ArrayListSerializable model = listModel.getObject();
                if (objectModel instanceof String) {
                    try {
                            if (!model.contains(objectModel)) {
                                model.add(objectModel);
                            }
                    } catch (NumberFormatException ex) {
                        error(Invalid value type.);
                    }
                }

                if (target != null) {
                    target.add(listChoice);
                }
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form? form) {
                target.add(form);
        }

    };

        form.add(textField);
        form.add(listChoice);
        form.add(addLink);
        add(form);

 In Wicket 1.5 I get : '4' is not a valid Serializable.
 I have to use Serializable because I have more components text field, date
 field to take the value.
 I I use String instead of Serializable, it works.

 What is wrong in wicket 1,5?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-tp4585991p4585991.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Why everything is stored in Session?

2012-04-25 Thread Martin Grigorov
On Tue, Apr 24, 2012 at 11:49 PM, Philipp Oppermann
p.opperm...@googlemail.com wrote:
 Thank you for your fast answer! I think I understood it ;) But reading from
 disk store decreases the performance?! Is wicket scalable anyway?

It scales well for our application. And we run few hundred thousand
concurrent users.
The disk store is hit only if you go several pages back. How often do
you do that anyway ?



 On 24.04.2012 14:44, Martin Grigorov wrote:

 Hi,

 Only the last used instance of the page is stored in the session. And
 only if this page is stateful.
 Wicket does this because if the page is stateful and you have a Link
 in that page for example then clicking on this Link will execute its
 #onClick() method. To be able to execute it Wicket finds the stored
 page instance, finds the Link in the page's component tree and
 executes the method.
 Without this, Wicket will create a new instance of the page, find the
 Link and execute its method - this is how stateless page work.
 Pages are stateless by default until you add the first stateful
 component or behavior to it.

 If you go several pages back (you press several times the back button)
 then Wicket will read the page from the disk store.
 Read https://cwiki.apache.org/confluence/x/qIaoAQ for more details.

 On Tue, Apr 24, 2012 at 3:34 PM, Philipp Oppermann
 p.opperm...@googlemail.com  wrote:

 Hi, I'm PHP-Programmer and now switching to java (and wicket ;) ). But
 one thing confuses me:

 Why everything is stored in Session?

 In PHP the session is empty except you put something in. And there's
 no Back-button-problem in PHP, when you go back then the site with
 the previous URL will be loaded.

 So why you need to store so much in the session?

 Philipp Oppermann

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








-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: about the modalwindow in the wicket

2012-04-25 Thread lxw_first
Hi,I follow you code,but the error is still exists。

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/about-the-modalwindow-in-the-wicket-tp4580873p4586074.html
Sent from the Users forum 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



Re: wicket yui 1.5.5

2012-04-25 Thread fachhoch
The latest version of wicketstuff yui is 1.4.20 , will this work with wicket
1.5 ?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-yui-1-5-5-tp4584353p4586092.html
Sent from the Users forum 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



Re: wicket yui 1.5.5

2012-04-25 Thread Martin Grigorov
On Wed, Apr 25, 2012 at 12:47 PM, fachhoch fachh...@gmail.com wrote:
 The latest version of wicketstuff yui is 1.4.20 , will this work with wicket
 1.5 ?

No. You need to migrate the code.


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-yui-1-5-5-tp4584353p4586092.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Sonar (Architecture) and Wicket

2012-04-25 Thread romanasu
Copypaste from Sonar:

Package tangle index
11.7%
 46 cycles

Dependencies to cut
13 between packages
16 between files

Sonar say (probably true) that there are 'Suspect dependency (cycle)'
between packages and also between files, and then i receive a low grade on
Architecture.

For example, one suspect cycling dependency is: 
com.myPackage.TemplatePage  USES com.myPackage.login.LoginPage

If i move LoginPage to com.myPackage, sonar will be very happy, but, I don't
like this stupid solution.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Sonar-Architecture-and-Wicket-tp4573798p4586175.html
Sent from the Users forum 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



Re: Wicket 1.5 ListMultipleChoice add Serializable values

2012-04-25 Thread dpmihai
I forgot to say my object model from TextField is

private Serializable objectModel;

I do not understand how a String is not Serializable?

This code worked on wicket 1.4 without problems. I think something is done
different in wicket framework.

Can you tell me what class throws this error message?

A code like you suggested :
ArrayList? extends Serializable list = new ArrayListSerializable();
list.add(1);

doesn't even compile.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-tp4585991p4586221.html
Sent from the Users forum 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



Re: Wicket 1.5 ListMultipleChoice add Serializable values

2012-04-25 Thread Decebal Suiu
Maybe you must override TextField.getConverter() because the text field
component cannot knows to convert text to object/serializable.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-tp4585991p4586299.html
Sent from the Users forum 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



Re: Wicket 1.5 ListMultipleChoice add Serializable values

2012-04-25 Thread dpmihai
Yes Decebal. You are right. If I have a TextField of some type but my model
is a generic one (in my case objectModel is of type Serializable), I have to
overwrite getConverter method like:

final TextFieldString textField = new TextFieldString(txtValue,
new PropertyModelString(this, objectModel)) {
@Override
public C IConverterC getConverter(ClassC type) {
return new AbstractConverter() {

public Object convertToObject(String 
value, Locale locale) {
return value;
}

@Override
protected Class getTargetType() {
return String.class;
}

};
}
};

This was not necessary in wicket 1.4. Something was changed in converters
area in wicket 1.5

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-tp4585991p4586325.html
Sent from the Users forum 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



Re: Sonar (Architecture) and Wicket

2012-04-25 Thread Martijn Dashorst
Are you building software for your customers/users or to satisfy
random quirks of some fricking tool?

Martijn

On Wed, Apr 25, 2012 at 12:22 PM, romanasu dacia_berl...@yahoo.com wrote:
 Copypaste from Sonar:

 Package tangle index
 11.7%
 46 cycles

 Dependencies to cut
 13 between packages
 16 between files

 Sonar say (probably true) that there are 'Suspect dependency (cycle)'
 between packages and also between files, and then i receive a low grade on
 Architecture.

 For example, one suspect cycling dependency is:
 com.myPackage.TemplatePage      USES com.myPackage.login.LoginPage

 If i move LoginPage to com.myPackage, sonar will be very happy, but, I don't
 like this stupid solution.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Sonar-Architecture-and-Wicket-tp4573798p4586175.html
 Sent from the Users forum 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




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: Wicket 1.5 ListMultipleChoice add Serializable values

2012-04-25 Thread dpmihai
A DateTimeField does not need the converter to populate a Serializable model:

final DateTimeField txtTime = new DateTimeField(txtTime,
new PropertyModelDate(this, objectModel));

But there are other bugs with it
(https://issues.apache.org/jira/browse/WICKET-4496), so if something will be
done here maybe it will also be necessary to add the converter.

But this is some redundant code. Maybe something will be done in the future.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-tp4585991p4586363.html
Sent from the Users forum 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



property converting model

2012-04-25 Thread Tom Eugelink


I've got a form bound to a CompoundPropertyModel. One of the properties 
contains a XML document. In order to edit that property, I've added a TextArea 
to the form (with the CodeMirror javascript XML editor bound to it), but I need 
to convert the XML document property to string and back again. I've implemented 
this by creating an anonymous model, like this:

lForm.add(new TextArea(services, new IModelString()
{
@Override
public void detach()
{
}

@Override
public String getObject()
{
return 
JAXBUtil.extractAndSerializeServicesElement(lLicenseJAXB);
}

@Override
public void setObject(String s)
{
try
{
JAXBUtil.parseAndSpliceServicesElement(lLicenseJAXB, s);
}
catch (Exception e)
{
lErrorOccurredAtomicBoolean.set(true);
slf4j.error(Error during submit, e);
error(e.getLocalizedMessage());
}
}
}).setOutputMarkupId(true).setMarkupId(codemirror));

There are a few question I have:
1. Is this the right way to add such a conversion?
2. Will this model be persisted to the session as well? I of course do not want 
that, it just needs to convert.
3. If there is an exception in setObject, I use an AtomicBoolean to register 
that, so that the Form.onSubmit knows that something is amiss. Otherwise I get 
a big fat exception on the screen or the ssubmit just continues. Is there a 
better way?
4. If there is an error, I would like getObject to return the value that was 
submitted by the form, so that the user can correct his mistake. Now it always 
returns the value before the edit. How to do that?




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



Re: property converting model

2012-04-25 Thread Martin Grigorov
Hi,

Use a custom IConverter instead - override TextArea#getConverter(Class) method.
Conversion of data is part of form submit process and if it fails with
org.apache.wicket.util.convert.ConversionException then the model of
that component is not updated and Form#onError() will be called. Point
4) below will be automatically handled for you by Wicket.

On Wed, Apr 25, 2012 at 3:18 PM, Tom Eugelink t...@tbee.org wrote:

 I've got a form bound to a CompoundPropertyModel. One of the properties
 contains a XML document. In order to edit that property, I've added a
 TextArea to the form (with the CodeMirror javascript XML editor bound to
 it), but I need to convert the XML document property to string and back
 again. I've implemented this by creating an anonymous model, like this:

            lForm.add(new TextArea(services, new IModelString()
            {
                @Override
                public void detach()
                {
                }

                @Override
                public String getObject()
                {
                    return
 JAXBUtil.extractAndSerializeServicesElement(lLicenseJAXB);
                }

                @Override
                public void setObject(String s)
                {
                    try
                    {
                        JAXBUtil.parseAndSpliceServicesElement(lLicenseJAXB,
 s);
                    }
                    catch (Exception e)
                    {
                        lErrorOccurredAtomicBoolean.set(true);
                        slf4j.error(Error during submit, e);
                        error(e.getLocalizedMessage());
                    }
                }
            }).setOutputMarkupId(true).setMarkupId(codemirror));

 There are a few question I have:
 1. Is this the right way to add such a conversion?
 2. Will this model be persisted to the session as well? I of course do not
 want that, it just needs to convert.
 3. If there is an exception in setObject, I use an AtomicBoolean to register
 that, so that the Form.onSubmit knows that something is amiss. Otherwise I
 get a big fat exception on the screen or the ssubmit just continues. Is
 there a better way?
 4. If there is an error, I would like getObject to return the value that was
 submitted by the form, so that the user can correct his mistake. Now it
 always returns the value before the edit. How to do that?




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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: property converting model

2012-04-25 Thread Tom Eugelink


The converter correctly converts, but if there is an error in the converter, 
I'm getting a exception dump on screen.

Root cause:

org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 3; The element type notificationx 
must be terminated by the matching end-tag /notificationx.
 at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
 at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
 at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
 at 
com.service2media.licenseframework.service.license.jaxb.JAXBUtil.parseServicesElement(JAXBUtil.java:256)
 at 
com.service2media.licenseframework.wicket.MasterLicenseEdit$13$1.convertToObject(MasterLicenseEdit.java:395)
 at 
org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1141)
 at 
org.apache.wicket.markup.html.form.AbstractTextComponent.convertInput(AbstractTextComponent.java:129)
 at 
org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1083)
 at org.apache.wicket.markup.html.form.Form$16.validate(Form.java:1759)
 at 
org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:170)
 at 
org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:154)
 at 
org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:273)
 at 
org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:261)
 at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:244)
 at 
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:349)
 at 
org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:998)
 at 
org.apache.wicket.markup.html.form.Form.validateComponents(Form.java:1751)
 at org.apache.wicket.markup.html.form.Form.validate(Form.java:1716)
 at org.apache.wicket.markup.html.form.Form.process(Form.java:803)
 at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
 at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:692)
 at java.lang.reflect.Method.invoke(Method.java:601)
 at 
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
 at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
 at 
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
 at 
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
 at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
 at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
 at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
 at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
 at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:185)
 at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:241)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
 at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
 at 
org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:175)
 at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
 at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
 at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
 at 
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
 at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
 at 
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
 at 
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
 at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
 at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
 at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
 at 
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
 at 
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
 at 
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
 at 
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
 

Re: property converting model

2012-04-25 Thread Martin Grigorov
... and if it fails with
org.apache.wicket.util.convert.ConversionException ...

try/catch your code and wrap the original exception in
ConversionException and rethrow

On Wed, Apr 25, 2012 at 3:53 PM, Tom Eugelink t...@tbee.org wrote:

 The converter correctly converts, but if there is an error in the converter,
 I'm getting a exception dump on screen.

 Root cause:

 org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 3; The element
 type notificationx must be terminated by the matching end-tag
 /notificationx.
     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
     at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
     at
 com.service2media.licenseframework.service.license.jaxb.JAXBUtil.parseServicesElement(JAXBUtil.java:256)
     at
 com.service2media.licenseframework.wicket.MasterLicenseEdit$13$1.convertToObject(MasterLicenseEdit.java:395)
     at
 org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1141)
     at
 org.apache.wicket.markup.html.form.AbstractTextComponent.convertInput(AbstractTextComponent.java:129)
     at
 org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1083)
     at org.apache.wicket.markup.html.form.Form$16.validate(Form.java:1759)
     at
 org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:170)
     at
 org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:154)
     at
 org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:273)
     at
 org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:261)
     at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:244)
     at
 org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:349)
     at
 org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:998)
     at
 org.apache.wicket.markup.html.form.Form.validateComponents(Form.java:1751)
     at org.apache.wicket.markup.html.form.Form.validate(Form.java:1716)
     at org.apache.wicket.markup.html.form.Form.process(Form.java:803)
     at
 org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
     at
 org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:692)
     at java.lang.reflect.Method.invoke(Method.java:601)
     at
 org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
     at
 org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
     at
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
     at
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
     at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
     at
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
     at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
     at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
     at
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:185)
     at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:241)
     at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
     at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
     at
 org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:175)
     at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
     at
 org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
     at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
     at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
     at
 org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
     at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
     at
 com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
     at
 com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
     at
 com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
     at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
     at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
     at
 com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
     at
 

Radio Choice Weirdness

2012-04-25 Thread Richard W. Adams
My understanding of this class must be faulty. When Wicket calls my 
onSelectionChanged(), the argument is the display string, not the id 
value. For example, I'm expecting a milepost value like 123.456, but 
instead I get End (123.456) (the display value). Here's the code. can 
anyone see what I'm doing wrong?

private RadioChoiceString createMilepostChoice(final String id, final 
TrackModel track) {

final Milepost startMP = track.getStartMP();
final Milepost endMP   = track.getEndMP  ();
final ListString choices = Arrays.asList(new 
String[]{format(START, startMP), format(END, endMP), OTHER});
final ChoiceRendererString renderer = new 
ChoiceRendererString() {
private static final long serialVersionUID = 1L;
@Override public Object getDisplayValue(final String model) {
return model;
}
@Override public String getIdValue(final String model, final int 
index) {
String value;
switch (index) {
case 0:
value = startMP.toString();
break;
case 1 :
value = endMP.toString();
break;
default :
value = ;
}
return value;
}
};
final RadioChoiceString choice = new RadioChoiceString(id, 
choices, renderer) {
private static final long serialVersionUID = 1L;
@Override protected void onSelectionChanged(final Object 
new selection) {
final String selection = (String)newSelection;
if (track == primaryTrack) {
primaryMpChoice = selection;
} else {
secondaryMpChoice = selection;
}
}
@Override protected boolean 
wantOnSelectionChangedNotifications() {
return true;
}
};
return choice;
}


**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: property converting model

2012-04-25 Thread Tom Eugelink


You are right. I'm sorry.


On 25-4-2012 14:56, Martin Grigorov wrote:

... and if it fails with
org.apache.wicket.util.convert.ConversionException ...

try/catch your code and wrap the original exception in
ConversionException and rethrow





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



FilterForm Date column formatting

2012-04-25 Thread Sandor Feher
Hi,


I need to add date formater and/or validator to a column in the filterform. 


IColumn col_cru=columns.add(new TextFilteredPropertyColumnHrpContent,
String(new ResourceModel(contentlisttable.cru), cru, cru));


TIA, Sandor


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FilterForm-Date-column-formatting-tp4586557p4586557.html
Sent from the Users forum 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



Re: FilterForm Date column formatting

2012-04-25 Thread Martin Grigorov
Hi,

See 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn#populateItem()
You'll need to override that method and add some Date**Field to the item

On Wed, Apr 25, 2012 at 4:20 PM, Sandor Feher sfe...@bluesystem.hu wrote:
 Hi,


 I need to add date formater and/or validator to a column in the filterform.

 
 IColumn col_cru=columns.add(new TextFilteredPropertyColumnHrpContent,
 String(new ResourceModel(contentlisttable.cru), cru, cru));
 

 TIA, Sandor


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/FilterForm-Date-column-formatting-tp4586557p4586557.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Radio Choice Weirdness

2012-04-25 Thread Sven Meier
When Wicket calls my onSelectionChanged(), the argument is the display 
string, not the id value.


Your RadioChoice is working on string choices so it will hand you the 
selected string.


I'd suggest to let your RadioChoice work with ints or preferably 
directly on the Milepost objects:


final RadioChoiceMilepost choice = new RadioChoiceMilepost(...);

Sven

On 04/25/2012 03:00 PM, Richard W. Adams wrote:

My understanding of this class must be faulty. When Wicket calls my
onSelectionChanged(), the argument is the display string, not the id
value. For example, I'm expecting a milepost value like 123.456, but
instead I get End (123.456) (the display value). Here's the code. can
anyone see what I'm doing wrong?

private RadioChoiceString  createMilepostChoice(final String id, final
TrackModel track) {

 final Milepost startMP = track.getStartMP();
 final Milepost endMP   = track.getEndMP  ();
 final ListString  choices = Arrays.asList(new
String[]{format(START, startMP), format(END, endMP), OTHER});
 final ChoiceRendererString  renderer = new
ChoiceRendererString() {
 private static final long serialVersionUID = 1L;
 @Override public Object getDisplayValue(final String model) {
 return model;
 }
 @Override public String getIdValue(final String model, final int
index) {
 String value;
 switch (index) {
 case 0:
 value = startMP.toString();
 break;
 case 1 :
 value = endMP.toString();
 break;
 default :
 value = ;
 }
 return value;
 }
 };
 final RadioChoiceString  choice = new RadioChoiceString(id,
choices, renderer) {
 private static final long serialVersionUID = 1L;
 @Override protected void onSelectionChanged(final Object
new selection) {
 final String selection = (String)newSelection;
 if (track == primaryTrack) {
 primaryMpChoice = selection;
 } else {
 secondaryMpChoice = selection;
 }
 }
 @Override protected boolean
wantOnSelectionChangedNotifications() {
 return true;
 }
 };
 return choice;
}


**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**




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



Re: CryptoMapper - Error decoding text

2012-04-25 Thread fachhoch
I am getting the same error , I am trying to migrate to wicket 1.5.5, is
there a fix  for this ?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-Error-decoding-text-tp4034573p4586850.html
Sent from the Users forum 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



Re: CryptoMapper - Error decoding text

2012-04-25 Thread Martin Grigorov
It is fixed in 1.5.4 so you have a new problem.
Create a ticket with a quickstart app

On Wed, Apr 25, 2012 at 5:59 PM, fachhoch fachh...@gmail.com wrote:
 I am getting the same error , I am trying to migrate to wicket 1.5.5, is
 there a fix  for this ?


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-Error-decoding-text-tp4034573p4586850.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Radio Choice Weirdness

2012-04-25 Thread Richard W. Adams
Ok, I tried changing it to RadioChoiceMilepostModel (code below). 
However, the onSelectionChanged() method STILL gets a String argument, as 
verified by the printf() output New selection is a class 
java.lang.String: End (538.200). But following that output, an exception 
is now thrown. I REALLY don't understand what's going on here. I've 
studied the Javadocs for RadioChoice, but they seem awfully sketchy, and 
don't shed any light on this.

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast 
to com.uprr.enm.web.track.mend.MilepostModel
at com.uprr.enm.web.track.mend.MendStepChooseMP$4.getIdValue(
MendStepChooseMP.java:1)
at 
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(
AbstractSingleSelectChoice.java:166)
at org.apache.wicket.markup.html.form.FormComponent.getValue(
FormComponent.java:911)
at 
org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(
RadioChoice.java:422)
at org.apache.wicket.Component.renderComponent(Component.java:2725
)
... 198 more


==

//--
private RadioChoiceMilepostModel createTestChoice(final String id, final 
TrackModel track) {

final ListMilepostModel choices = new 
ArrayListMilepostModel();
choices.add(new MilepostModel(track.getStartMP(), Start));
choices.add(new MilepostModel(track.getEndMP(), End));
choices.add(new MilepostModel(Other));

final ChoiceRendererMilepostModel renderer = new 
ChoiceRendererMilepostModel() {
private static final long serialVersionUID = 1L;
@Override public String getIdValue(final MilepostModel model, 
final int index) {
final Milepost mp = model.getObject();
return mp == null ?  : mp.toString();
}
};
final RadioChoiceMilepostModel choice =
new RadioChoiceMilepostModel(id, choices, renderer) {
private static final long serialVersionUID = 1L;
@Override protected void onSelectionChanged(final Object 
newSelection) {
System.out.printf(New selection is a %s: %s%n, 
newSelection.getClass(), newSelection);
}
@Override protected boolean 
wantOnSelectionChangedNotifications() {
return true;
}
};
return choice;
}

The milepost model class:

package com.uprr.enm.web.track.mend;

import org.apache.wicket.model.IModel;

import com.uprr.eni.read.vo.mp.Milepost;

//--
/**
 * Data model for milepost values.
 * @author Dick Adams
 * @.copyright Union Pacific 2012
 */
class MilepostModel implements IModelMilepost {

private static final long serialVersionUID = 1L;

private final String text;
private Milepost mp;

//--
/**
* Constructor.
* @param value The milepost value.
* @param text The textual description of the value. For example, if it 
represents the end
* of a milepost range, the text might be {@code End}.
*/
public MilepostModel(final Milepost value, final String text) {
mp = value;
this.text = text;
}
//--
/**
 * Constructor with no value.
 * @param text The textual description of a {@code null} value.
 */
public MilepostModel(final String text) {
this(null, text);
}
//--
@Override public void detach() {
mp = null;
}
//--
@Override public Milepost getObject() {
return mp;
}
//--
@Override public void setObject(final Milepost object) {
mp = object;
}
//--
@Override public String toString() {
return mp == null ? text : String.format(%s (%s), text, 
mp.toString());
}
//--
}





From:   Sven Meier s...@meiers.net
To: users@wicket.apache.org
Date:   04/25/2012 09:55 AM
Subject:Re: Radio Choice Weirdness



 When Wicket calls my onSelectionChanged(), the argument is the display 
string, not the id value.

Your RadioChoice is working on string choices so it will hand you the 
selected string.

I'd suggest to let your RadioChoice work with ints or preferably 
directly on the Milepost objects:

 final RadioChoiceMilepost choice = 

Re: Sonar (Architecture) and Wicket

2012-04-25 Thread Igor Vaynberg
these types of cycles are common in applications. they are only a
problem *iff* you want to separate your base page into a different jar
than the subclass pages. if you are planning on doing that there are
well known patterns for how to do that, but they will make your code
more complex.

so you have to weigh whether or not the complexity is a reasonable tradeoff.

-igor

On Wed, Apr 25, 2012 at 3:22 AM, romanasu dacia_berl...@yahoo.com wrote:
 Copypaste from Sonar:

 Package tangle index
 11.7%
 46 cycles

 Dependencies to cut
 13 between packages
 16 between files

 Sonar say (probably true) that there are 'Suspect dependency (cycle)'
 between packages and also between files, and then i receive a low grade on
 Architecture.

 For example, one suspect cycling dependency is:
 com.myPackage.TemplatePage      USES com.myPackage.login.LoginPage

 If i move LoginPage to com.myPackage, sonar will be very happy, but, I don't
 like this stupid solution.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Sonar-Architecture-and-Wicket-tp4573798p4586175.html
 Sent from the Users forum 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: Wicket 1.5 - new browser window support detection

2012-04-25 Thread Martin Grigorov
Hi David,

What is your use case ?
How do you use this callback method ?

On Tue, Apr 24, 2012 at 12:13 PM, David Rain david_r...@kb.cz wrote:
 OK, I also think so.
 But I really need to detect the fact, that new window was opened. The
 Listener was perfect... I wonder why it has been removed?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-new-browser-window-support-detection-tp4582538p4582816.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Radio Choice Weirdness

2012-04-25 Thread Richard W. Adams
Oops. Got it figured out. The page class was trying to store the choice in 
a String variable instead of a MilepostModel variable. All is well now. 
Thanks!

RAM /abr./: Rarely Adequate Memory. 



From:   Richard W. Adams rwada...@up.com
To: users@wicket.apache.org
Cc: cdsch...@up.com
Date:   04/25/2012 10:24 AM
Subject:Re: Radio Choice Weirdness



Ok, I tried changing it to RadioChoiceMilepostModel (code below). 
However, the onSelectionChanged() method STILL gets a String argument, as 
verified by the printf() output New selection is a class 
java.lang.String: End (538.200). But following that output, an exception 
is now thrown. I REALLY don't understand what's going on here. I've 
studied the Javadocs for RadioChoice, but they seem awfully sketchy, and 
don't shed any light on this.

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast 
to com.uprr.enm.web.track.mend.MilepostModel
at com.uprr.enm.web.track.mend.MendStepChooseMP$4.getIdValue(
MendStepChooseMP.java:1)
at 
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(
AbstractSingleSelectChoice.java:166)
at org.apache.wicket.markup.html.form.FormComponent.getValue(
FormComponent.java:911)
at 
org.apache.wicket.markup.html.form.RadioChoice.onComponentTagBody(
RadioChoice.java:422)
at org.apache.wicket.Component.renderComponent(Component.java:2725
)
... 198 more


==

//--
private RadioChoiceMilepostModel createTestChoice(final String id, final 

TrackModel track) {

final ListMilepostModel choices = new 
ArrayListMilepostModel();
choices.add(new MilepostModel(track.getStartMP(), Start));
choices.add(new MilepostModel(track.getEndMP(), End));
choices.add(new MilepostModel(Other));

final ChoiceRendererMilepostModel renderer = new 
ChoiceRendererMilepostModel() {
private static final long serialVersionUID = 1L;
@Override public String getIdValue(final MilepostModel model, 
final int index) {
final Milepost mp = model.getObject();
return mp == null ?  : mp.toString();
}
};
final RadioChoiceMilepostModel choice =
new RadioChoiceMilepostModel(id, choices, renderer) {
private static final long serialVersionUID = 1L;
@Override protected void onSelectionChanged(final Object 
newSelection) {
System.out.printf(New selection is a %s: %s%n, 
newSelection.getClass(), newSelection);
}
@Override protected boolean 
wantOnSelectionChangedNotifications() {
return true;
}
};
return choice;
}

The milepost model class:

package com.uprr.enm.web.track.mend;

import org.apache.wicket.model.IModel;

import com.uprr.eni.read.vo.mp.Milepost;

//--
/**
 * Data model for milepost values.
 * @author Dick Adams
 * @.copyright Union Pacific 2012
 */
class MilepostModel implements IModelMilepost {

private static final long serialVersionUID = 1L;

private final String text;
private Milepost mp;

//--
/**
* Constructor.
* @param value The milepost value.
* @param text The textual description of the value. For example, if it 
represents the end
* of a milepost range, the text might be {@code End}.
*/
public MilepostModel(final Milepost value, final String text) {
mp = value;
this.text = text;
}
//--
/**
 * Constructor with no value.
 * @param text The textual description of a {@code null} value.
 */
public MilepostModel(final String text) {
this(null, text);
}
//--
@Override public void detach() {
mp = null;
}
//--
@Override public Milepost getObject() {
return mp;
}
//--
@Override public void setObject(final Milepost object) {
mp = object;
}
//--
@Override public String toString() {
return mp == null ? text : String.format(%s (%s), text, 
mp.toString());
}
//--
}





From:   Sven Meier s...@meiers.net
To: users@wicket.apache.org
Date:   04/25/2012 09:55 AM

Re: CryptoMapper - Error decoding text

2012-04-25 Thread fachhoch
I could not reproduce  with the  quick start , it works in quick start   I
also tried with 1.5.1 still I could not produce it , not sure why my app is
getting error.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-Error-decoding-text-tp4034573p4587229.html
Sent from the Users forum 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



Re: FilterForm Date column formatting

2012-04-25 Thread Sandor Feher
Hi,

Thank you for the prompt answer. I had a try but it does not work as I
expect.

---
IColumn crdCol=new TextFilteredPropertyColumnHrpContent, String(new
ResourceModel(contentlisttable.crd), crd, crd) {

@Override
public void populateItem(ItemICellPopulatorlt;HrpContent
item, String componentId, IModelHrpContent rowModel) {
DateConverter dc=new DateConverter(true) {

@Override
public String getDatePattern(Locale locale) {
return  mm dd;
}

@Override
protected DateTimeFormatter getFormat(Locale locale) {
 DateTimeFormatter
fm=DateTimeFormat.forPattern( mm DD);
 return fm; 
}
};
item.addOrReplace(new DateTextField(componentId,dc));
}

};  
columns.add(crdCol);

Rgds, Sandor


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FilterForm-Date-column-formatting-tp4586557p4587855.html
Sent from the Users forum 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



Re: FilterForm Date column formatting

2012-04-25 Thread Martin Grigorov
But you don't say what is the problem

Sandor Feher sfe...@bluesystem.hu wrote:

Hi,

Thank you for the prompt answer. I had a try but it does not work as I
expect.

---
IColumn crdCol=new TextFilteredPropertyColumnHrpContent, String(new
ResourceModel(contentlisttable.crd), crd, crd) {

@Override
public void populateItem(ItemICellPopulatorlt;HrpContent
item, String componentId, IModelHrpContent rowModel) {
DateConverter dc=new DateConverter(true) {

@Override
public String getDatePattern(Locale locale) {
return  mm dd;
}

@Override
protected DateTimeFormatter getFormat(Locale locale) {
DateTimeFormatter
fm=DateTimeFormat.forPattern( mm DD);
return fm; 
}
}; 
item.addOrReplace(new DateTextField(componentId,dc));
}

}; 
columns.add(crdCol);

Rgds, Sandor


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FilterForm-Date-column-formatting-tp4586557p4587855.html
Sent from the Users forum 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



Re: Wicket 1.5 - new browser window support detection

2012-04-25 Thread David Rain
Hello Martin!

I do not use it right now but I would like to. I knew it was there because
I've studied API and sources of Wicket. But it was in time we used Wicket
1.4 and I knew I came across this onNewBrowserWindow method and many classes
implemented it
http://wicket.apache.org/apidocs/1.4/index.html?org/apache/wicket/markup/html/INewBrowserWindowListener.html

Now it is gone (we use Wicket 1.5.5 now). We have an application that is
completely AJAX like. Only 2 page (login  main) a the content inside is
switched (via replace methods and AjaxRequestTarget#add). But - as far as
security is concerned - we have to logout user and destroy session when he
opens another window or tab. That's a rule we cannot break. So I need some
detection of new window opened event.
I use logout and session invalidation in onConfigure now - the main page is
rendered only once, everything is made via AJAX calls then. Thus another
render attempt means that user opened new window or tab (but he could have
also pressed F5 - and it would end in logout too, but in this case we do
not want it - that's why I said it's just a temporary workaround).

Thanks for any ideas.

David

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-new-browser-window-support-detection-tp4582538p4588927.html
Sent from the Users forum 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