Re: Page/Session persistence on AppEngine

2012-03-16 Thread Martin Grigorov
Hi,

Read https://cwiki.apache.org/confluence/display/WICKET/Page+Storage
You need custom IDataStore. By default Wicket uses DiskDataStore. With
GAE-initializer this is replaced with HttpSessionDataStore, see
org.apache.wicket.pageStore.memory.DataStoreEvictionStrategy as well.
You'll need to implement IDataStore impl based on
http://code.google.com/appengine/docs/java/datastore/

Good luck and as always - wicketstuff-gae-initializer will be glad to
accept your donations!

On Thu, Mar 15, 2012 at 7:56 PM, Chris Merrill  wrote:
> So I've got a problem with my sessions getting too big on AppEngine. I've 
> already
> done some of the more obvious optimizations, but before going further, I'd 
> like
> to get some insight into how many pages are being stored in the page map and
> how big they are.
>
> I traversed down into PageStoreManager and found where the pages are 
> serialized
> in PageStoreManager.SessionEntry.writeObject() and think that I can put some
> diagnostics in there to illuminate the situation.
>
> However, I don't know how to convince GAE and/or Wicket to store the session
> to persistent storage in the AppEngine development environment (or in 
> Wicket?).
>
> Can anyone point me in the right direction?  Perhaps somewhere I can read up
> on the right parts of the mechanism?  I'm not even sure what keywords I should
> be searching on...or if this is an AppEngine or Wicket topic...or both?
>
> TIA!
> Chris
>
>
> --
>  -
> Chris Merrill                           |  Web Performance, Inc.
> ch...@webperformance.com                |  http://webperformance.com
> 919-433-1762                            |  919-845-7601
>
> Web Performance: Website Load Testing Software & Services
>  -
>
> -
> 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: Problem with yui drag&drop on IE

2012-03-16 Thread felix79
I also tried to activate the IE debugger and get an error :
This object does not manage this property or this method (traduction from
french)

this error appears in method 
onDragOver: function(e, id)
at line
this.idx = Array.indexOf(lis, srcEl);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-yui-drag-drop-on-IE-tp4475648p4477684.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: javascript and properties

2012-03-16 Thread Andrea Del Bene

Hi,

if you are using a subclass of TextTemplate and its method 
interpolate(...), you can build an implementation of Map interface which 
searches for a given key among properties entries. For example you could 
use internally an instance of ResourceModel

I'm creating a js template for each page in my app and added some l18n
support.
Here is an example:

var someData = {
'msg'='${message:hello}';
'a'='${message:min}';
'b'='${message:max}';
}

I've considered localizing each template instead, but since the js changes
very often, I still want to have support for properties.
The problem is that for each JS template you have to create your variables
model with every single message.
I don't like having to provide a variables model to get these messages,
cause its just too time-consuming, but instead I'd like to make the
message-resolving part automatic just like wicket:message in the markup
files. That would REALLY speed up the dev time.

Any ideas to do something like this?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/javascript-and-properties-tp4476533p4476533.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: Problem with yui drag&drop on IE

2012-03-16 Thread Martin Grigorov
Hi,

I guess you talk about
https://github.com/wicketstuff/core/tree/core-1.5.x/jdk-1.5-parent/yui-parent
This project has no active developer at the moment.
Feel free to fork it, improve it and send the fixes back for the other users.

On Fri, Mar 16, 2012 at 11:22 AM, felix79  wrote:
> I also tried to activate the IE debugger and get an error :
> This object does not manage this property or this method (traduction from
> french)
>
> this error appears in method
> onDragOver: function(e, id)
> at line
> this.idx = Array.indexOf(lis, srcEl);
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Problem-with-yui-drag-drop-on-IE-tp4475648p4477684.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



AjaxFormComponentUpdatingBehavior after validation problem

2012-03-16 Thread Gytis
Hello, I have such a problem with AjaxFormComponentUpdatingBehavior. 
I have some DropDownChoice and a CheckBox on a Form. I need to make a change
to DropDown, when I click on CheckBox. But as I try to submit a Form, got
some error, and then click CheckBox DropDown doesn`t change. The code looks
like this: 

   DropDownChoice dropDownz = new
DropDownChoice("dropDownId",
Arrays.asList(SomeEnum.values()), new
EnumChoiceRenderer(this));
   getGenericModelObject().setValues(SomeEnum.FIRSTVALUE);
   CheckBox boxz = new CheckBox("BoxId");
   boxz.add(new AjaxFormComponentUpdatingBehavior("onchange")
{
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (boxz.getModelObject())
{

getGenericModelObject().setValues(SomeEnum.SECONDVALUE);
get("dropDownId").setEnabled(false);
target.addComponent(get("dropDownId"));
}
else
{
get("dropDownId").setEnabled(true);
target.addComponent(get("dropDownId"));
}
}
@Override
protected void onError(AjaxRequestTarget target, 
RuntimeException e) {
if (boxz.getModelObject())
{

getGenericModelObject().setValues(SomeEnum.SECONDVALUE);
get("dropDownId").setEnabled(false);
target.addComponent(get("dropDownId"));
}
else
{
get("dropDownId").setEnabled(true);
target.addComponent(get("dropDownId"));
}
super.onError(target, e);
}
});
 Form form = new Form("formId", getGenericModel());
 form.add(dropDownz);
 form.add(boxz);

So as I said, after form validation, if errors occur, it won`t change
dropdown to SECONDVALUE, but sets it as setEnabled(false), why this happens?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-after-validation-problem-tp4477705p4477705.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: AjaxFormComponentUpdatingBehavior after validation problem

2012-03-16 Thread Michal Wegrzyn
Hi,

Did you try using AjaxCheckBox instead of CheckBox with ajax behavior?

Best regards,
Michal Wegrzyn

> -Original Message-
> From: Gytis [mailto:lietuvis...@mail.ru]
> Sent: Friday, March 16, 2012 10:32
> To: users@wicket.apache.org
> Subject: AjaxFormComponentUpdatingBehavior after validation problem
> 
> Hello, I have such a problem with AjaxFormComponentUpdatingBehavior.
> I have some DropDownChoice and a CheckBox on a Form. I need to make a
> change to DropDown, when I click on CheckBox. But as I try to submit a
> Form, got some error, and then click CheckBox DropDown doesn`t change.
> The code looks like this:
> 
>DropDownChoice dropDownz = new
> DropDownChoice("dropDownId",
>   Arrays.asList(SomeEnum.values()), new
> EnumChoiceRenderer(this));
>getGenericModelObject().setValues(SomeEnum.FIRSTVALUE);
>CheckBox boxz = new CheckBox("BoxId");
>boxz.add(new AjaxFormComponentUpdatingBehavior("onchange")
>   {
>   @Override
>   protected void onUpdate(AjaxRequestTarget target) {
>   if (boxz.getModelObject())
>   {
> 
>   getGenericModelObject().setValues(SomeEnum.SECONDVALUE);
>   get("dropDownId").setEnabled(false);
>   target.addComponent(get("dropDownId"));
>   }
>   else
>   {
>   get("dropDownId").setEnabled(true);
>   target.addComponent(get("dropDownId"));
>   }
>   }
>   @Override
>   protected void onError(AjaxRequestTarget target,
> RuntimeException e) {
>   if (boxz.getModelObject())
>   {
> 
>   getGenericModelObject().setValues(SomeEnum.SECONDVALUE);
>   get("dropDownId").setEnabled(false);
>   target.addComponent(get("dropDownId"));
>   }
>   else
>   {
>   get("dropDownId").setEnabled(true);
>   target.addComponent(get("dropDownId"));
>   }
>   super.onError(target, e);
>   }
>   });
>  Form form = new Form("formId", getGenericModel());
>  form.add(dropDownz);
>  form.add(boxz);
> 
> So as I said, after form validation, if errors occur, it won`t change
> dropdown to SECONDVALUE, but sets it as setEnabled(false), why this
> happens?
> 
> --
> View this message in context: http://apache-
> wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-after-
> validation-problem-tp4477705p4477705.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



CustomRequestCycle and post parameters

2012-03-16 Thread Sven Hohage
I try to read some form-encoded post parameters in my CustomRequestCycle.
Unfortunately the value is always null.
Does someone know why this happens and how to solve my problem?
Kind regards.

Excerpt:

public CustomRequestCycle(final WebApplication application, final
WebRequest request, final Response response) {
super(application, request, response);
Map params = request.getHttpServletRequest().getParameterMap();
String user = (String) params.get("user");
.

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



Re: CustomRequestCycle and post parameters

2012-03-16 Thread Martin Grigorov
Hi,

Which version of Wicket ?

try with getRequest().getPostParameters()

On Fri, Mar 16, 2012 at 12:28 PM, Sven Hohage
 wrote:
> I try to read some form-encoded post parameters in my CustomRequestCycle.
> Unfortunately the value is always null.
> Does someone know why this happens and how to solve my problem?
> Kind regards.
>
> Excerpt:
>
> public CustomRequestCycle(final WebApplication application, final
> WebRequest request, final Response response) {
>                super(application, request, response);
>                Map params = request.getHttpServletRequest().getParameterMap();
>                String user = (String) params.get("user");
> .
>
> -
> 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: AjaxFormComponentUpdatingBehavior after validation problem

2012-03-16 Thread Gytis
Hi, Michal, I`ve tried AjaxCheckBox component, but problem is the same.
I even made Sytem.out.println() of what object is set in DropDown, it shows
that Object is SECONDVALUE, but still shows me FIRSTVALUE. Both dropDownz
and CheckBox OutputMarkupId set to true.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-after-validation-problem-tp4477705p4478018.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: CustomRequestCycle and post parameters

2012-03-16 Thread Sven Hohage
I've changed to 1.5 to implement your advice.

My actual try is (inside application->init()):

getRequestCycleListeners().add(new AbstractRequestCycleListener() {

@Override
public void onBeginRequest(RequestCycle rc) {
StringValue uservalue =
rc.get().getRequest().getPostParameters().getParameterValue("user");
StringValue tokenvalue =
rc.get().getRequest().getPostParameters().getParameterValue("token");
if (tokenvalue != null && uservalue != null) {

SecurityHandler.tokenLogin(uservalue.toString(), tokenvalue.toString());
}
}


Unfortunately I always got null.

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



RE: AjaxFormComponentUpdatingBehavior after validation problem

2012-03-16 Thread Michal Wegrzyn
You can try using AjaxFormSubmitBehavior instead of 
AjaxFormComponentUpdatingBehavior.

Compare 

org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior.onEvent(AjaxRequestTarget
 target)

and

org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxRequestTarget 
target)

Best regards,
Michal Wegrzyn

> -Original Message-
> From: Gytis [mailto:lietuvis...@mail.ru]
> Sent: Friday, March 16, 2012 13:13
> To: users@wicket.apache.org
> Subject: RE: AjaxFormComponentUpdatingBehavior after validation problem
> 
> Hi, Michal, I`ve tried AjaxCheckBox component, but problem is the same.
> I even made Sytem.out.println() of what object is set in DropDown, it
> shows that Object is SECONDVALUE, but still shows me FIRSTVALUE. Both
> dropDownz and CheckBox OutputMarkupId set to true.
> 
> --
> View this message in context: http://apache-
> wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-after-
> validation-problem-tp4477705p4478018.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: CustomRequestCycle and post parameters

2012-03-16 Thread Martin Grigorov
Why in #onBeginRequest() ?
This way your code will be called for every request. I guess this
logic should be invoked only after submittion of a Form with POST
method. Or if you use some kind of http client to make the requests to
your page.

On Fri, Mar 16, 2012 at 3:10 PM, Sven Hohage  wrote:
> I've changed to 1.5 to implement your advice.
>
> My actual try is (inside application->init()):
>
> getRequestCycleListeners().add(new AbstractRequestCycleListener() {
>
>                        @Override
>                        public void onBeginRequest(RequestCycle rc) {
>                                StringValue uservalue =
> rc.get().getRequest().getPostParameters().getParameterValue("user");
>                                StringValue tokenvalue =
> rc.get().getRequest().getPostParameters().getParameterValue("token");
>                                if (tokenvalue != null && uservalue != null) {
>                                        
> SecurityHandler.tokenLogin(uservalue.toString(), tokenvalue.toString());
>                                }
>                        }
>
>
> Unfortunately I always got null.
>
> -
> 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



Cannot find AnnotApplicationContextMock in wicket 1.5

2012-03-16 Thread Decebal Suiu
Hi 

I migrate my application from wicket 1.4 to wicket 1.5.4 but I cannot find
AnnotApplicationContextMock class.

Thanks,
Decebal

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cannot-find-AnnotApplicationContextMock-in-wicket-1-5-tp4478148p4478148.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: Cannot find AnnotApplicationContextMock in wicket 1.5

2012-03-16 Thread Martin Grigorov
Hi,

I think this has been removed for 1.4.0 but I may be wrong.
See org.apache.wicket.spring.test.ApplicationContextMock

On Fri, Mar 16, 2012 at 3:19 PM, Decebal Suiu  wrote:
> Hi
>
> I migrate my application from wicket 1.4 to wicket 1.5.4 but I cannot find
> AnnotApplicationContextMock class.
>
> Thanks,
> Decebal
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Cannot-find-AnnotApplicationContextMock-in-wicket-1-5-tp4478148p4478148.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: How to build a hudson/jenkins like live log viewer?

2012-03-16 Thread kiwi.ryu
Hi, am working on kind of similar use case to build a log viewer. New to
wicket..can you share how would you invoke this code from your wicket class
based on user selection of a file? appreciate ur inputs. thank you.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-build-a-hudson-jenkins-like-live-log-viewer-tp4090224p4479107.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 build a hudson/jenkins like live log viewer?

2012-03-16 Thread Josh Kamau
James ;

Load the file , set it as value for a label component, then add
ajaxtimerbehaviour (or something like that) to keep refreshing the label..

Josh.

On Fri, Mar 16, 2012 at 10:26 PM, kiwi.ryu  wrote:

> Hi, am working on kind of similar use case to build a log viewer. New to
> wicket..can you share how would you invoke this code from your wicket class
> based on user selection of a file? appreciate ur inputs. thank you.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-build-a-hudson-jenkins-like-live-log-viewer-tp4090224p4479107.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
>
>


support for L10N in templates

2012-03-16 Thread infiniter
There is already localization and styles support for resource references, but
I haven't seen that type of support for in text templates. Any ideas on how
it can be implemented??

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/support-for-L10N-in-templates-tp4479741p4479741.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