Re: Bean not properly injected into another bean when using Wicket stateless page

2017-04-05 Thread Tomasz Dziurko
Ok, thank you Martin for detailed explanation. I understand your rationale,
to avoid future problems I have added check to our tests that makes sure
that all classes annotated with @SpringBean must have no-args constructor :)

On 5 April 2017 at 09:52, Martin Grigorov <mgrigo...@apache.org> wrote:

> On Tue, Apr 4, 2017 at 9:40 PM, Tomasz Dziurko <tdziu...@gmail.com> wrote:
>
> > Hi Martin
> >
> > Two questions:
> > 1. Which class? HomePageHandler ?
> >
>
> Yes, HomePageHandler.
> The problem is the following:
>  @SpringBean tell Wicket to inject a proxy in the Wicket components.
> If the class is an interface then Wicket uses java.lang.reflect.Proxy and
> all is fine.
> If it is a proper class then Wicket uses CGLIB to create the proxy. CGLIB
> requires a default constructor to be able to create the specialization
> class.
>
>
> > 2. I have digged deeper and in fact there is a check whether to use CGLib
> > or Objenesis (if there is no-args constructor Objenesis is chosen) but is
> >
>
> Objenesis is a bit smarter than CGLIB. It looks for the available
> constructors and creates proxies for the parameters to be able to
> instantiate the class (HomePageHandler).
>
> Wicket uses CGLIB since day 1 of wicket-inject module.
> Objenesis fallback has been added recently (1-2 years ago) so that people
> can "migrate" from CGLIB to the more powerful Objenesis if they want by
> excluding CGLIB from the classpath and adding Objenesis.
> Few months ago there was a discussion at dev@ to replace CGLIB with
> ByteBuddy (the most powerful and maintained proxy creation library at the
> moment) but we decided that it is not worth the troubles yet.
>
>
> > it an expected behaviour? Or maybe this case could be a trigger to
> discuss
> > proper way to deal with such cases?
> >
> > On 4 April 2017 at 21:26, Martin Grigorov <martin.grigo...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > On Apr 4, 2017 7:38 PM, "Tomasz Dziurko" <tdziu...@gmail.com> wrote:
> > >
> > > Hello
> > >
> > > I have a problem with wicket-spring-boot <-> wicket integration. Bean
> > > annotated with @Serviceis not properly injected into a backing bean
> that
> > is
> > > injected into a stateless Page using @SpringBean annotation.
> > >
> > > Generally:
> > >
> > > @StatelessComponent
> > > @MountPath("home-page")
> > > public class HomePage extends WebPage {
> > >
> > > @SpringBean
> > > private HomePageHandler handler;
> > > }
> > >
> > > and
> > >
> > > @Service
> > > public class HomePageHandler {
> > >
> > > private final CommandPublisher commandPublisher;
> > >
> > > @Autowired
> > > public HomePageHandler(
> > >
> > >
> > > I think you will need an additional default constructor for this class.
> > > CGLIB needs it.
> > > It might have lesser visibility than public too.
> > >
> > > CommandPublisher commandPublisher) {
> > > this.commandPublisher = commandPublisher;
> > > }
> > >
> > > public void executeAction(String name) {
> > > commandPublisher.publish(name); /// <--- NPE
> > > (commandPublisher is null)
> > > }
> > > }
> > >
> > > and:
> > >
> > > @Service
> > > public class CommandPublisher {
> > >
> > > public void publish(String text) {
> > > eventPublisher.publishEvent(text);
> > > }
> > >
> > > }
> > >
> > > Wicket 7.6.0, wicket-spring-boot 1.0.6.
> > >
> > > I have created a simple starter (
> > > https://github.com/tdziurko/wicket-spring-bean-issue) to reproduce the
> > > problem. Problem disappears when page is not stateless (more info in
> > readme
> > > in the starter).
> > >
> > >
> > > Thank you in advance for help.
> > >
> > > --
> > > Regards / Pozdrawiam,
> > > Tomek Dziurko
> > > http://tomaszdziurko.com/
> > >
> >
> >
> >
> > --
> > Regards / Pozdrawiam,
> > Tomek Dziurko
> > http://tomaszdziurko.com/
> >
>



-- 
Regards / Pozdrawiam,
Tomek Dziurko
http://tomaszdziurko.com/


Re: Bean not properly injected into another bean when using Wicket stateless page

2017-04-04 Thread Tomasz Dziurko
Hi Martin

Two questions:
1. Which class? HomePageHandler ?
2. I have digged deeper and in fact there is a check whether to use CGLib
or Objenesis (if there is no-args constructor Objenesis is chosen) but is
it an expected behaviour? Or maybe this case could be a trigger to discuss
proper way to deal with such cases?

On 4 April 2017 at 21:26, Martin Grigorov <martin.grigo...@gmail.com> wrote:

> Hi,
>
> On Apr 4, 2017 7:38 PM, "Tomasz Dziurko" <tdziu...@gmail.com> wrote:
>
> Hello
>
> I have a problem with wicket-spring-boot <-> wicket integration. Bean
> annotated with @Serviceis not properly injected into a backing bean that is
> injected into a stateless Page using @SpringBean annotation.
>
> Generally:
>
> @StatelessComponent
> @MountPath("home-page")
> public class HomePage extends WebPage {
>
> @SpringBean
> private HomePageHandler handler;
> }
>
> and
>
> @Service
> public class HomePageHandler {
>
> private final CommandPublisher commandPublisher;
>
> @Autowired
> public HomePageHandler(
>
>
> I think you will need an additional default constructor for this class.
> CGLIB needs it.
> It might have lesser visibility than public too.
>
> CommandPublisher commandPublisher) {
> this.commandPublisher = commandPublisher;
> }
>
> public void executeAction(String name) {
> commandPublisher.publish(name); /// <--- NPE
> (commandPublisher is null)
> }
> }
>
> and:
>
> @Service
> public class CommandPublisher {
>
> public void publish(String text) {
> eventPublisher.publishEvent(text);
> }
>
> }
>
> Wicket 7.6.0, wicket-spring-boot 1.0.6.
>
> I have created a simple starter (
> https://github.com/tdziurko/wicket-spring-bean-issue) to reproduce the
> problem. Problem disappears when page is not stateless (more info in readme
> in the starter).
>
>
> Thank you in advance for help.
>
> --
> Regards / Pozdrawiam,
> Tomek Dziurko
> http://tomaszdziurko.com/
>



-- 
Regards / Pozdrawiam,
Tomek Dziurko
http://tomaszdziurko.com/


Bean not properly injected into another bean when using Wicket stateless page

2017-04-04 Thread Tomasz Dziurko
Hello

I have a problem with wicket-spring-boot <-> wicket integration. Bean
annotated with @Serviceis not properly injected into a backing bean that is
injected into a stateless Page using @SpringBean annotation.

Generally:

@StatelessComponent
@MountPath("home-page")
public class HomePage extends WebPage {

@SpringBean
private HomePageHandler handler;
}

and

@Service
public class HomePageHandler {

private final CommandPublisher commandPublisher;

@Autowired
public HomePageHandler(CommandPublisher commandPublisher) {
this.commandPublisher = commandPublisher;
}

public void executeAction(String name) {
commandPublisher.publish(name); /// <--- NPE
(commandPublisher is null)
}
}

and:

@Service
public class CommandPublisher {

public void publish(String text) {
eventPublisher.publishEvent(text);
}

}

Wicket 7.6.0, wicket-spring-boot 1.0.6.

I have created a simple starter (
https://github.com/tdziurko/wicket-spring-bean-issue) to reproduce the
problem. Problem disappears when page is not stateless (more info in readme
in the starter).


Thank you in advance for help.

-- 
Regards / Pozdrawiam,
Tomek Dziurko
http://tomaszdziurko.com/


Re: Change Order (Priority) of Validator Msgs?

2011-05-23 Thread Tomasz Dziurko
You should use method:

final FeedbackPanel setSortingComparator(ComparatorFeedbackMessage
sortingComparator)

and create comparator which will sort FeedbbackMessages in proper order (in
your situation probably those with feedbackMessage.component instanceof Form
coming first)

-- 
Best regards
Tomasz Dziurko
http://tomaszdziurko.pl


Re: Change Order (Priority) of Validator Msgs?

2011-05-23 Thread Tomasz Dziurko
2011/5/23 Tomasz Dziurko tdziu...@gmail.com

 final FeedbackPanel setSortingComparator(ComparatorFeedbackMessage
 sortingComparator)


 Of course this method is in the FeedbackPanel class :-)

-- 
Best regards
Tomasz Dziurko
http://tomaszdziurko.pl


Re: Wicket in Action converted to 1.4?

2011-04-13 Thread Tomasz Dziurko
Probably most information about changes between 1.3 and 1.4 are listed here:

https://cwiki.apache.org/WICKET/migrating-to-wicket-14.html

-- 
Best regards / Pozdrawiam,
Tomasz Dziurko
www.tomaszdziurko.pl
 http://www.programatico.pl/


Re: Apache Wicket Cookbook Published!

2011-04-12 Thread Tomasz Dziurko
I ordered my copy to Poland almost two weeks ago and still no printed
version :/ But PDF on my Kindle is working fine :)

-- 
Best regards / Pozdrawiam,
Tomasz Dziurko
www.tomaszdziurko.pl
 http://www.programatico.pl/


Re: New Wicket tutorial series

2011-03-16 Thread Tomasz Dziurko
Hello.

2011/3/15 Igor Racic igor.ra...@gmail.com

 I think it would be easier to follow tutorials if it were made by something
 like wink
 (especially where you have longer code with 6-7 points that are referenced)
 But, I can understand that it would be much less SEO friendly...


Thank you for feedback, I appreciate it a lot! :) But can you be more
specific about above and wink stuff? :)


 One thing that comes regularly - some getting started Authentication 
 Authorization ?


This is planned feature in my tutorial web application :)


-- 
Best regards,
Tomasz Dziurko
www.tomaszdziurko.pl
 http://www.programatico.pl/


Re: New Wicket tutorial series

2011-03-14 Thread Tomasz Dziurko

 But maybe some hints what could be improved/added/changed :) I would be
happy for any of these kind of comments.

-- 
Best regards,
Tomasz Dziurko
 http://www.programatico.pl/


New Wicket tutorial series

2011-03-12 Thread Tomasz Dziurko
Hello.

As I am using Wicket for over two years, some time ago I decided to start
sharing my knowledge and write tutorial where I am showing process of
creating Wicket application from scratch. Actually tutorial has six parts
and can be viewed here:

http://tomaszdziurko.pl/2011/03/wicket-tutorial-series-building-web-application-scratch/

As this is a my first tutorial, every comment or feedback how can I make it
better and more useful is more than welcome :)

-- 
Best regards
Tomasz Dziurko
 http://www.programatico.pl/


Re: How to give feedback in long-running operation within AjaxButton.onSubmit()?

2010-04-09 Thread Tomasz Dziurko
You should check visural-wicket project
(http://code.google.com/p/visural-wicket/) and live demo on
http://visural-wicket-examples.appspot.com/app/ . In submitters
there are some fancy looking waiting popup messages which could
help.

-- 
Best Regards / Pozdrawiam,
Tomasz Dziurko

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



Re: Speaking about Wicket

2010-04-07 Thread Tomasz Dziurko
Although I won't be able to speak in Scotland from Poland I would be
extremely interested in slides from this talk, if any exists :-)

-- 
Best regards / Pozdrawiam,
Tomasz Dziurko

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



Re: Session expired drives me mad!

2010-03-08 Thread Tomasz Dziurko
Check this one:
http://cwiki.apache.org/WICKET/spring.html , especially paragraph
Annotation-based Approach

Regards
-- 
Tomasz Dziurko

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



Re: [OT] Apache con 2010 europe, when?

2010-02-26 Thread Tomasz Dziurko
If you've never been in Poland I only could invite you to visit us.
There is even an occasion  :) GeeCon Conference
http://2010.geecon.org/main/home

-- 
Pozdrawiam / Regards
Tomasz Dziurko

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



Re: [OT] Apache con 2010 europe, when?

2010-02-26 Thread Tomasz Dziurko
2010/2/26 nino martinez wael nino.martinez.w...@gmail.com:
 Interesting, i'll put that in the lineup aswell. Do you know if there's more
 tracks this year, meaning more simultaneous talks?

Year ago there were two tracks (http://2009.geecon.org/site/schedule )
but I am not sure how would it look like in 2010, probably the same
but I don't have any source 'inside' to be sure :)

 And if theres any talks on Agile and Test Driven and maybe something about
 User Experience too? And if it's still only 2 days of conference?

Call for papers ends 28th February so agenda will be published
probably in late March. Conference lasts three days with (probably,
again) first day full of trainings and then two days with
presentations.

-- 
Pozdrawiam / Regards
Tomasz Dziurko

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



ERROR: Received Ajax response with code: 403

2010-02-03 Thread Tomasz Dziurko
I have problem with page heavily using ajax and error 403 returned by
ajax response.

There are 4 components on the page which are shown only for specific
period of time. I use AbstractAjaxTimerBehavior (duration 10ms) which
is calculating current phase and then according to this phase I make
some components visible and others invisible (user has limited time to
answer question and after it ends he's redirected to next question).

Sometimes this page stops responding to any user clicks. After running
this application in debug mode I noticed that among many ajax info
messages I get one error:

ERROR: Received Ajax response with code: 403

Is this related to Wicket or I should talk with my server provider to
check if he doesn't block ajax requests that come too often?
I am using Wicket 1.3.7

Thank you in advance for any help.

-- 
Regards
Tomasz Dziurko

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



Wicket timed events on page - how to?

2009-09-11 Thread Tomasz Dziurko
I am writing an application for testing users and two functionalities
I need to implement are:
1. show/hide some components on the page after specified time (few seconds)
2. redirect to next page after specified time

I was wondering how to do this, I did some google search and seems I
need to extend AbstractAjaxTimerBehavior. Is it correct way or maybe
another, better solution exists?

Thank you in advance for your help.

-- 
Regards
Tomek

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



Re: UTF-8

2009-08-31 Thread Tomasz Dziurko
Add this to init() method in your Application class:

getMarkupSettings().setDefaultMarkupEncoding(UTF-8);
getRequestCycleSettings().setResponseRequestEncoding(UTF-8);

This should be enough.

-- 
Regards,
Tomasz Dziurko


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


Re: TabbedPanel customization ?

2009-01-05 Thread Tomasz Dziurko
If you need some more than pure look modification you can always download
wicket source and create your own TabbedPanel classes based on original
code.

Regards
-- 
Tomasz Dziurko


Re: Wicket integration with good charts api

2008-11-05 Thread Tomasz Dziurko
Sure I am interested! :) I think simple example on wiki showing basics
of using Open Flash Charts in Wicket would be nice alternative for
those unsatisfied with JFreeChars library.

Regards
-- 
Tomasz Dziurko

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



Wicket integration with good charts api

2008-11-04 Thread Tomasz Dziurko
My client needs in his application very good looking charts (simple
bars with some gradienst and 3D effects). Unfortunately he didn't like
what JFreeChart library offers so I must find and implement another
solution.
Questions are:
1. Is there any other chart library easy to integrate with Wicket?
2.off-topicWhich chart api (could be me commercial, client is
paying) could you suggest?/off-topic

Thank you for your help

Regards
-- 
Tomasz Dziurko

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



Re: Different size of Modal Window in IE and Firefox

2008-11-02 Thread Tomasz Dziurko
Ok, problem solved. I had old cookies with changed size placed in one
browser. When I cleared cookies size of modal windows in both browsers
are equal.

Regards
-- 
Tomasz Dziurko

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



Re: example application for spring wicket hibernate

2008-11-02 Thread Tomasz Dziurko
Phonebook:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook .

If you need NetBeans project for it just tell me, I have it somewhere
on the disc

Regards
-- 
Tomasz Dziurko

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



Different size of Modal Window in IE and Firefox

2008-10-31 Thread Tomasz Dziurko
I have problem with size of ModalWindow with Page inside in Firefox
3.0.3 and IE version 7.0.5730.13. When I set

modal1.setResizable(false);
modal1.setWidthUnit(px);
modal1.setHeightUnit(px);
modal1.setMinimalHeight(200);
modal1.setMinimalWidth(300);
modal1.setInitialHeight(200);
modal1.setInitialWidth(300);

or just:

modal1.setMinimalHeight(200);
modal1.setMinimalWidth(300);
modal1.setInitialHeight(200);
modal1.setInitialWidth(300);

same Page in modalWindow opens with different sizes. In Firefox size
is correct, but in IE size is about two times smaller than in FF. Is
there any way to force IE and FF to work in the same way with
modalWindows? I planned to show questions one by one to user in one
modalWindow and I need my application to be as more web browser
independent as possible.

Thank you for your help.

Regards
-- 
Tomasz Dziurko

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



Disabling 'back'/'next' web browser button usage in application

2008-10-29 Thread Tomasz Dziurko
Hi.

I have application which consists of questions to user provided in
some order. Each question is reachable on the same address, let's say
http://myApp/Question. Application engine knows which question to show
from database record. Each question page has 'Previous Question' and
'Next Question' buttons which increase/decrease questionNumber in
database and redirects to http://myApp/Question (which loads question
looking for its number in database).

My problem is:
How disable 'back' and 'next' button in web browser so user can go
to previous/next question only by using 'Previous Question' / 'Next
Question' button? Is there a way to remove whole page from session? So
user when clicks back/next will see custom communicate your
session expired or you clicked 'back' or 'next' button on your web
browser while doing a test'. Or maybe I could achieve such
functionality in other way?

Thank you in advance for help

Regards
-- 
Tomasz Dziurko

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



Re: Disabling 'back'/'next' web browser button usage in application

2008-10-29 Thread Tomasz Dziurko
And any hint how to do this? :)

I thought about two possible ways to solve my problem:
1. on clicking Next/Prev Question button remove current page from
PageMap (although no idea how to do this yet ;) ) and then redirect
further, so when user use back button he will see session-expired-like
page
2. on clicking Next/Prev Question button invalidate Question and
answers model so (not sure, but think it works this way) when user
backs models will be loaded again.
What do you think?

Regards
-- 
Tomasz Dziurko

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