Guice and Wicket: using SessionScoped injections

2013-10-30 Thread Zeldor
I have a working Wicket [v6] application with Guice [v3] - I have used dependency injection for repository operations right now and I want to expend it into using services that are session scoped (one per user's session). I have read through official documentation, various blog posts and

PropertyModel not refreshing

2011-10-06 Thread Zeldor
Hi, I have a form with labels that use PropertyModel. They work fine when I test them locally - when I click on submit button I get proper refreshed values in labels. But when I deploy my app it does not work, I still get old values. Where can be the problem? I am using Wicket 1.4.17 and

Re: PropertyModel not refreshing

2011-10-06 Thread Zeldor
Why would there be a difference between local and deployed versions? And won't it negatively affect performance? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-refreshing-tp3877389p3877621.html Sent from the Users forum mailing list archive at

Re: PropertyModel not refreshing

2011-10-06 Thread Zeldor
Thanks, I will give it a try :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-refreshing-tp3877389p3877636.html Sent from the Users forum mailing list archive at Nabble.com. - To

Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
Hi, I have a problem with designing authentication and session properly. I asked for help some time ago, but I was not able to fix the problem. I have a standard situation - I have an app that has bunch of pages and only main page with login form should be accessible for everyone. Everything

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
But would it be possible to store User data in the session without having to fetch it from datastore on every request? My users don't interact with each other and they operate only on their own data. So it'd be most efficient to store User data in the session and interact with db only when some

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
So it's normal that I lose User data when I move from login to main page and I will have to fetch it from db quite often. When will it happen? I have users browsing around my app, doing most often nothing. Plenty of labels with gets. Will browsing like that trigger fetching user data from db? Or

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
Marco: And it works without problems? There is no issue with user trying to log from 2 browser on same time, trying to cheat the system? I am just wondering if there is any risk of that. How does your code look then in session and how do you fetch your data? Martin: I was trying to save on

Re: Users, sessions, data...

2011-06-16 Thread Zeldor
Well, my app is a game which you could call Excel, but in fantasy settings :) Modifying lots of tables and simple calculations, lots of them. Some people call that building, attacking, spellcasting... I have most of stuff atm in User entity, over 100 variables, some of them ArrayLists and

Users, sessions, data...

2011-06-15 Thread Zeldor
Hi, My last attempts to fix my session and advices here made me thinking if my approach is good. So I'm curious - how do you handle users and their data? In my case I have session, when user logs in entire entity gets loaded into session. Later I get user data from that session and when he

Re: Users, sessions, data...

2011-06-15 Thread Zeldor
But what are benefits of small session really? With entire user in session I can skip getting data from db and serve data faster... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Users-sessions-data-tp3598626p3598945.html Sent from the Users forum mailing list

Re: Users, sessions, data...

2011-06-15 Thread Zeldor
Well, I'm hosting it on GAE and with new pricing model I have to worry about instances, not memcache or things like that. And I don't have to do load balancing. To be sure that data does not get lost between instances [which could happen probably with big traffic and longer inactivity from user] I

Rounding values for display

2011-06-09 Thread Zeldor
Hi, I have labels showing data that is in Double format, but I don't need so much precision in UI. Can I easily make my page round those values [down] and display just numbers without fraction? -- View this message in context:

Major session problem [GAE]

2011-06-09 Thread Zeldor
Hi, I have really serious problems with my sessions - or rather getting and displaying data with it. It works great when tested locally, but when deployed to GAE it acts weird. In bad way. I have no idea if it's wicket or GAE issue, but maybe I can get some hints here. Problem is that: - it

Re: Rounding values for display

2011-06-09 Thread Zeldor
So I can use one converter in Application for all my Labels? That would be great :) P.S. I am really amazed how fast you can get responses here. It's hard not to love Wicket. -- View this message in context:

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
Yeah, no idea why Static is there, must be some leftover from early code. It's good to have someone else take a look at your code and point the obvious :) I will check if it solves my problems. -- View this message in context:

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
norckon: Getting whole entity is good in my case. User can modify only his data and no one else can even access or see it. It speeds up things too. Anyway, how do you invoke the rest? Without static you of course get non-static method cannot be referenced from a static context compilation

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
So... MySession.get().getUser().getLand() to properly get a value from session? Looks like it could have some performance issues, or does it just look so scary? :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Major-session-problem-GAE-tp3584894p3585657.html

DataView the easy way?

2011-06-07 Thread Zeldor
Hi, I am trying to make my first DataView and I found an example that does what I want. It's quite confusing though - it takes like 15 pages and classes to do it and I cannot decipher it.

Links blocked when I enter page

2011-06-07 Thread Zeldor
Hi, I have rather weird problem. I have a page with navigation panel [mostly bookmarkable links]. It works fine on all but one. On that one page when I enter it, some of my navigation links get blocked - 2 out of 5. Any idea what may be causing it? They turn fine when I click on submit button on

Re: Links blocked when I enter page

2011-06-07 Thread Zeldor
Well, they don't do it in my case. Maybe because they are in panel... Anyway, I wouldn't have problem with that. It's that 2 other links are blocked, those that lead to other pages. I don't have problem like that on other pages and only thing here that is different is that additional submit

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Right :) So I want to start with something like: add(new DataViewExpedition(expedition, MySession.loggedInUser.colonisations) { }); I am confused how to implement populateItem though... -- View this message in context:

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Do I need to do anything special? Will it automatically go through all rows of my Map? When my map is HashMaplt;Integer,ArrayListgt; then Expedition will be my ArrayList or whole row, together with int id? I could probably use just a list of ArrayLists if it'd be easier... -- View this message in

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Ok, I changed it to ArrayListlt;ArrayListlt;Longgt;, but I still don't get how to use populateItem... Even testing just that add(new DataViewExpedition(expedition, MySession.loggedInUser.colonisations) { }); Results in: internal error; cannot instantiate org.

Re: Links blocked when I enter page

2011-06-07 Thread Zeldor
Nope, panel is separate. There should be no connection... I will rather paste some code, maybe it will give a hint... add(new FeedbackPanel(errorMsg)); // starting form private boolean col_approval = false; Button

Re: DataView the easy way?

2011-06-07 Thread Zeldor
I almost have it... I have my ArrayList of lists, so I guess my code should look smth like that: ArrayListlt;ArrayListlt;Longgt; colonisations = MySession.loggedInUser.colonisations; add(new DataView(expeditionsView, new ListDataProvider(colonisations)) {

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Thanks a lot, it works :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DataView-the-easy-way-tp3578760p3579384.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe,

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
, Oct 23, 2010 at 7:08 AM, Ernesto Reinaldo Barreiro-4 [via Apache Wicket] ml-node+3008166-1025517113-152...@n4.nabble.comml-node%2b3008166-1025517113-152...@n4.nabble.com wrote: Can you try PropertyModel(this, house_cost[4])? Ernesto On Fri, Oct 22, 2010 at 10:39 PM, Zeldor [hidden email

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
. What is this in your example? Is house_cost a member variable of your this? Sven On 10/23/2010 11:35 AM, Zeldor wrote: Nope, still same error: org.apache.wicket.RequestCycle logRuntimeException: no get method defined for class: class com.myproject.economy.Building$1 expression

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
off using a ListView for your situation if you're trying to show all the items in the list. On Sat, Oct 23, 2010 at 10:59 AM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=3008486i=0 wrote: Ha! Good suggestion, I should have looked at this earlier. I guess I need

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
be surprised what you can do with a table. On Sat, Oct 23, 2010 at 11:09 AM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=3008524i=0 wrote: It's a table with lots of data to display, with a mixture of plain text, data from session and from arrays, so it'd be rather hard

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
, sorting, etc., then you might want to upgrade to a DefaultDataTable (or its ajax-based subclass). On Sat, Oct 23, 2010 at 11:51 AM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=3008574i=1 wrote: Any good examples? :) It'd be certainly better to have some repeaters instead

ArrayList, Label and Model

2010-10-22 Thread Zeldor
Hi, I am trying to make an ArrayList, populate it and then display them [and do other stuff later, but I did not get so far]. It does not work though, so what I am missing? My code looks like that: ... ArrayListDouble house_cost = new ArrayListDouble(5); ... [adding some data

Re: ArrayList, Label and Model

2010-10-22 Thread Zeldor
, schrieb Zeldor: Hi, I am trying to make an ArrayList, populate it and then display them [and do other stuff later, but I did not get so far]. It does not work though, so what I am missing? My code looks like that: ... ArrayListDouble house_cost = new ArrayListDouble(5

MinimumValidator and Long problem

2010-10-12 Thread Zeldor
I have TextField that should take Long value, but on submit it does not really work... org.apache.wicket.RequestCycle logRuntimeException: Exception 'java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long' occurred during validation

Re: MinimumValidator and Long problem

2010-10-12 Thread Zeldor
actually know what type of field it is operating on (like PropertyModel does), you need to call setType(Long.class) on your text field. On Tue, Oct 12, 2010 at 1:23 PM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=2992772i=0 wrote: I have TextField that should take Long

Re: MinimumValidator and Long problem

2010-10-12 Thread Zeldor
I have nothing else really, just same more of same stuff, only a Form with Labels, TextFields and submit method. Anyway, deprecated NumberValidator.minimum(0) method works without any problems, are there any disadvantages of using that? On Wed, Oct 13, 2010 at 12:43 AM,

Re: RadioChoice - what's wrong?

2010-10-10 Thread Zeldor
So maybe someone could just show me working RadioChoice code with OnSubmit part? Just how to properly display it and grab data from it :) That should solve the problem, as I would compare and see what I'm doing wrong. -- View this message in context:

Re: RadioChoice - what's wrong?

2010-10-10 Thread Zeldor
-152...@n4.nabble.comml-node%2b2970427-965616561-152...@n4.nabble.com wrote: Hello Zeldor, I've red your code and it seems that you define variable rc two times: the first time as form private field and the second time just below between braces. When onSubmit method calls rc.getModelObject

Re: RadioChoice - what's wrong?

2010-10-08 Thread Zeldor
186 is System.out.println(_numbers); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-what-s-wrong-tp2967576p2967903.html Sent from the Users forum mailing list archive at Nabble.com. -

Re: RadioChoice - what's wrong?

2010-10-08 Thread Zeldor
wrote: in that case either your System or your System.out is null :) -igor On Thu, Oct 7, 2010 at 11:35 PM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=2967914i=0 wrote: 186 is System.out.println(_numbers); -- View this message in context: http://apache-wicket

Re: RadioChoice - what's wrong?

2010-10-08 Thread Zeldor
=nodenode=2968370i=0 On Thu, Oct 7, 2010 at 11:35 PM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=2968370i=1 wrote: 186 is System.out.println(_numbers); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-what-s-wrong

RadioChoice - what's wrong?

2010-10-07 Thread Zeldor
Hi, I am trying to get through with the very basics of Wicket - radiochoice. But somehow I got stuck and all solutions I tried made my problems even worse... So, what am I doing wrong? I have this code: static final ListString NUMBERS = Arrays.asList(new String[] { 1, 2, 3 }); private

Re: RadioChoice - what's wrong?

2010-10-07 Thread Zeldor
-152...@n4.nabble.com wrote: cant help you without seeing more code and stack -igor On Thu, Oct 7, 2010 at 2:28 PM, Zeldor [hidden email]http://user/SendEmail.jtp?type=nodenode=2967607i=0 wrote: Hi, I am trying to get through with the very basics of Wicket - radiochoice

Best practice for DropDownChoice?

2010-10-01 Thread Zeldor
Hi, I was looking at many threads here about that matter and even more google links, after not really being able to properly use examples from Wicket in Action and few others. So I wonder - what's the best and most common way to implement DropDownChoice and map the value at the same time [well,

checkGroup - 2 out of 5?

2010-09-05 Thread Zeldor
Hi, I want to limit users to check exactly 2 options out of X. How can I do that? I'd also like it to switch last chosen one to new one, if user has already picked 2 [so it'd deselect last one and choose another, instead of not doing anything at all]. -- View this message in context:

Re: checkGroup - 2 out of 5?

2010-09-05 Thread Zeldor
Oh, I hoped that it can be avoided. So anyone has AJAX example at hand? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/checkGroup-2-out-of-5-tp2527723p2527763.html Sent from the Wicket - User mailing list archive at Nabble.com.