Re: Label not updating on AJaxButton submit

2012-01-16 Thread Martin Grigorov
Hi,

I think the Ajax calls are serialized.
The page instance can be used by a single request at any time.
So you submit the form and this request acquires the lock on the page.
AjaxSelfTimerUpdatingBehavior cannot use the page until the first
request unlock it.
Additionally the Ajax calls are serialized at the client side
(JavaScript). See AjaxChannel class for more information about this.

To be able to do what you want I suggest to use IResource to upload
to. This way there wont be lock on the server side and with
AjaxChannels with different names at the client side you will solve
both problems.

On Mon, Jan 16, 2012 at 2:51 AM, malebu milton.qura...@gmail.com wrote:
 I have a requirement where i have to upload a video from a page and show the
 upload progress when the upload is 100% complete need to update the progress
 label as processing video.

 I decided to go with a simple outer div and internal div while update
 the internal div percentage to show the progress. Finally i added a Label
 inside the internal div to show the status...

 /div style=border: 1px solid #5d4617; padding: 3px; background-color:
 #191B10; 
                div style=width:400px; background-color: #55; color:
 white; font-size: 8px; align=left
                    div style=width:0%; background-color: #FF9900;
 align=right wicket:id=customProgressLoading.../div
                /div
            /div/


 Finally i added AjaxSelfUpdatingTimerBehavior to the internal div to fetch
 the progress and label every 2 seconds.

 When i click on submit button.. the label is not update while the form is
 being submitted. it shows the final progress i.e. 100% and processing
 completed after file is uploaded.

 I am using AjaxButton to upload on Ajax.

 Any idea how i can achieve this?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Label-not-updating-on-AJaxButton-submit-tp4298302p4298302.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



CompoundPropertyModel and FormComponent

2012-01-16 Thread Schlärmann , Bob
Hi list,

I've created a reusable form component for editing an address, called 
AddressPanel. It inherits from FormComponent and consists of multiple text 
fields for inputting data, instances of the component get added to a Form 
instance.

How do I use this component together with a CompoundPropertyModel? I'm using 
the following code to add the component to the form:

FormHomePage form = new FormHomePage(form, new 
CompoundPropertyModelHomePage(this)); // HomePage has an instance of Person 
called person
form.add(new TextFieldString(person.firstname));
form.add(new AddressPanel(person.address));

However this gives the following exception: Last cause: No get method defined 
for class: class foo.HomePage expression: street.

street is a text field that is added to the AddressPanel. Is it possible to 
have the street field bound to person.address.street without renaming the 
text field inside AddressPanel? I don't want to rename it since this way I 
can't reuse the component for other entities that have addresses.

Best regards,

Bob


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



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



WiQuery disabling tabs

2012-01-16 Thread Marco Springer
Hi all,

*The problem: *
tabs not disabled on first render.

*The source:*
I'm adding the Tabs class from WiQuery 1.2.4 like so:

tabs = new Tabs(tabs);
tabs.setOutputMarkupId(true);

CompoundPropertyModelWafer waferModel = new
CompoundPropertyModelWafer(getDefaultModel());
tabs.add(new GeneralInfoPanel(general_info, waferModel));
tabs.add(new MaterialSpecificationPanel(material_spec, waferModel));
tabs.add(new LazyTabPanel(layers, waferModel, LayersFragment.class));
tabs.add(new LazyTabPanel(batches, waferModel, BatchFragment.class));
tabs.add(new LazyTabPanel(logbook, waferModel, LogbookFragment.class));
tabs.add(new DocumentsPanel(documents, waferModel));

*// isNewObject set to true when the Wafer object contained in the
waferModel is a new Wafer.
// When a new Wafer is show in this panel, disable the rest of the tabs for
now:*
if (isNewObject) {
 for (int i = 1; i  6; i++)
 tabs.disable(i);
}

add(tabs);


*The question:*
I thought this would be a proper way to disable those tabs, apparently it
isn't.
If I call the disable function through ajax afterwards, like
disable(target, 1), it's fine.

Anyone an idea how you would disable a single (or multiple) tabs on the
first initial render?

Kind regards,
Marco


Re: CompoundPropertyModel and FormComponent

2012-01-16 Thread Andrea Del Bene

Hi,

I think you need to build a CompoundPropertyModel inside the component 
itself. Override onInitialize method of AddressPanel and try with 
something like this:


@Override
protected void onInitialize() {
super.onInitialize();
setDefaultModel(new CompoundPropertyModel(getDefaultModel()));
}



Hi list,

I've created a reusable form component for editing an address, called 
AddressPanel. It inherits from FormComponent and consists of multiple text 
fields for inputting data, instances of the component get added to a Form 
instance.

How do I use this component together with a CompoundPropertyModel? I'm using 
the following code to add the component to the form:

FormHomePage  form = new FormHomePage(form, new 
CompoundPropertyModelHomePage(this)); // HomePage has an instance of Person called person
form.add(new TextFieldString(person.firstname));
form.add(new AddressPanel(person.address));

However this gives the following exception: Last cause: No get method defined for 
class: class foo.HomePage expression: street.

street is a text field that is added to the AddressPanel. Is it possible to have the 
street field bound to person.address.street without renaming the text field inside 
AddressPanel? I don't want to rename it since this way I can't reuse the component for other 
entities that have addresses.

Best regards,

Bob


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



-
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



Update component after background thread is finished

2012-01-16 Thread humcasma
Hi,

I have a simple form. When I submit it I launch a thread that runs on the
background. When the thread is finished, I would like to update a
DropdownChoice with the result generated by the thread. I manage to update
the choice, but the changes are only visible when I refresh the page. To
avoid that, I have used a AjaxEventBehavior to update the choice whenever
the user clicks on it:

serviceNameChoice = new DropDownChoiceString(serviceNameChoice, new
ModelString(),

 
serviceNames);
serviceNameChoice.add(new AjaxEventBehavior(onclick) {
 protected void onEvent(AjaxRequestTarget target) {
target.add(serviceNameChoice);
 }
});

The result is an unusable drop-down choice, since the choice keep refreshing
when I try to select a value.

How can I do what I want, that is, update/refresh a DropdownChoice when a
background thread finishes its work?
Thanks!

Humberto

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4300126.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: CompoundPropertyModel and FormComponent

2012-01-16 Thread Schlärmann , Bob
Thanks for your reply. I've tried it but it still gave the same error. 

However I also tried the following modified version of your idea:

In AddressPanel.java:

@Override
protected void onInitialize() {
super.onInitialize();
   Object o = getDefaultModelObject();

   setDefaultModel(new CompoundPropertyModel(getDefaultModelObject()));
}

With the above code I can now load the page, also the getDefaultModelObject() 
returns the correct Address instance. Unfortunately upon submitting the form I 
get the same exception again (No get method defined for class: class 
foo.HomePage expression: street).

By the way: am I doing things the Wicket way? Is this how you would reuse 
parts of a form in Wicket? 



Best regards,

Bob
 Hi,
 
 I think you need to build a CompoundPropertyModel inside the component
 itself. Override onInitialize method of AddressPanel and try with
 something like this:
 
 @Override
  protected void onInitialize() {
  super.onInitialize();
  setDefaultModel(new CompoundPropertyModel(getDefaultModel()));
  }
 
 
  Hi list,
 
  I've created a reusable form component for editing an address, called
 AddressPanel. It inherits from FormComponent and consists of multiple text
 fields for inputting data, instances of the component get added to a Form
 instance.
 
  How do I use this component together with a CompoundPropertyModel? I'm using
 the following code to add the component to the form:
 
  FormHomePage  form = new FormHomePage(form, new
 CompoundPropertyModelHomePage(this)); // HomePage has an instance of Person
 called person
  form.add(new TextFieldString(person.firstname));
  form.add(new AddressPanel(person.address));
 
  However this gives the following exception: Last cause: No get method
 defined for class: class foo.HomePage expression: street.
 
  street is a text field that is added to the AddressPanel. Is it possible
 to have the street field bound to person.address.street without renaming the
 text field inside AddressPanel? I don't want to rename it since this way I
 can't reuse the component for other entities that have addresses.
 
  Best regards,
 
  Bob
 
 
  Think green - keep it on the screen.
 
  This e-mail and any attachment is for authorised use by the intended
 recipient(s) only. It may contain proprietary material, confidential
 information and/or be subject to legal privilege. It should not be copied,
 disclosed to, retained or used by, any other party. If you are not an intended
 recipient then please promptly delete this e-mail and any attachment and all
 copies and inform the sender. Thank you.
 
 
 
  -
  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
 


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



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



response.renderJavaScriptReference immediately after head tag

2012-01-16 Thread Rahman USTA
Hi, im using on a page that contains ;

@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);


response.renderCSSReference(css/ui-lightness/jquery-ui-1.8.17.custom.css);
response.renderJavaScriptReference(js/jquery-1.7.1.min.js);

response.renderJavaScriptReference(js/jquery-ui-1.8.17.custom.min.js);
}

The html file's head/head block has some of javascript function, above
function adds references to html after this javascript function, i want to
be added references immediately after head tag.

-- 
Rahman USTA
Computer  Control Education Technologist
0-(531)-922-28-05
www.kodcu.com


Re: CompoundPropertyModel and FormComponent

2012-01-16 Thread Andrea Del Bene
Yes, I think you are doing it the Wicket way, but your snippet and 
mine should work. Do you modify components' model somewhere else? Which 
model do you get if you call getDefaultModel() inside oninitialize?

Thanks for your reply. I've tried it but it still gave the same error.

However I also tried the following modified version of your idea:

In AddressPanel.java:

@Override
protected void onInitialize() {
super.onInitialize();
Object o = getDefaultModelObject();

setDefaultModel(new CompoundPropertyModel(getDefaultModelObject()));
}

With the above code I can now load the page, also the getDefaultModelObject() returns the 
correct Address instance. Unfortunately upon submitting the form I get the same exception 
again (No get method defined for class: class foo.HomePage expression: 
street).

By the way: am I doing things the Wicket way? Is this how you would reuse 
parts of a form in Wicket?



Best regards,

Bob




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



Re: how to get https port number in Wicket 1.5

2012-01-16 Thread armhold
Hmm, I spoke too soon. 

It seems that the reason I was running into the *method* mismatch (not
*protocol* mismatch) with the StatelessForm is due to having installed an
HttpsMapper in my WicketApplication. If you try to post a form over https
from an http page, the HttpsMapper apparently discards the https POST, and
instead directs the browser to reload the page over http (expected behavior
I guess, since it's not @RequireHttps). This ends up defeating the form
submission.

The page Martin pointed me to does indeed work around this issue, but with
one small problem- the LoginHandlerPage needs to process the POST params
manually from the HttpServletRequest, as they are not present in the
PageParameters (at least not with 1.5). It's simple enough to pull them out
of the request though.

Let me know if you think this is correct behavior, or if it sounds like a
bug. If the latter, I'm happy to create a JIRA+Quickstart for it.

Thanks everyone.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-get-https-port-number-in-Wicket-1-5-tp4295139p4301011.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: Update component after background thread is finished

2012-01-16 Thread Igor Vaynberg
start a timer behavior that polls and waits for the thread to finish,
and only when its finished it updates the select.

-igor

On Mon, Jan 16, 2012 at 8:47 AM, humcasma humca...@gmail.com wrote:
 Hi,

 I have a simple form. When I submit it I launch a thread that runs on the
 background. When the thread is finished, I would like to update a
 DropdownChoice with the result generated by the thread. I manage to update
 the choice, but the changes are only visible when I refresh the page. To
 avoid that, I have used a AjaxEventBehavior to update the choice whenever
 the user clicks on it:

 serviceNameChoice = new DropDownChoiceString(serviceNameChoice, new
 ModelString(),

 serviceNames);
 serviceNameChoice.add(new AjaxEventBehavior(onclick) {
     protected void onEvent(AjaxRequestTarget target) {
        target.add(serviceNameChoice);
     }
 });

 The result is an unusable drop-down choice, since the choice keep refreshing
 when I try to select a value.

 How can I do what I want, that is, update/refresh a DropdownChoice when a
 background thread finishes its work?
 Thanks!

 Humberto

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4300126.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: how to get https port number in Wicket 1.5

2012-01-16 Thread Martin Grigorov
Looking at the impls of
org.apache.wicket.request.mapper.parameter.IPageParametersEncoder#decodePageParameters
we can see that only QueryParameters are read.
I personally don't know what is the reason for that.

File a ticket and if no one says that this is the intended behavior
then we will fix it.
Or if you want you can do it yourself and attach the patch. Use
org.apache.wicket.request.Request#getRequestParameters to get all
parameters and put them in the PageParameters

On Mon, Jan 16, 2012 at 7:44 PM, armhold armh...@gmail.com wrote:
 Hmm, I spoke too soon.

 It seems that the reason I was running into the *method* mismatch (not
 *protocol* mismatch) with the StatelessForm is due to having installed an
 HttpsMapper in my WicketApplication. If you try to post a form over https
 from an http page, the HttpsMapper apparently discards the https POST, and
 instead directs the browser to reload the page over http (expected behavior
 I guess, since it's not @RequireHttps). This ends up defeating the form
 submission.

 The page Martin pointed me to does indeed work around this issue, but with
 one small problem- the LoginHandlerPage needs to process the POST params
 manually from the HttpServletRequest, as they are not present in the
 PageParameters (at least not with 1.5). It's simple enough to pull them out
 of the request though.

 Let me know if you think this is correct behavior, or if it sounds like a
 bug. If the latter, I'm happy to create a JIRA+Quickstart for it.

 Thanks everyone.


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/how-to-get-https-port-number-in-Wicket-1-5-tp4295139p4301011.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: Javascript resources and jsessionid

2012-01-16 Thread Chris Colman
JIRI issue 4334 has fixed this now which is great.

The next issue is that while Wicket is able to avoid establishing a
session for requests for package resources it would be good if their URL
made it easy for other filters (eg., Open Persistence Provider in View)
to also ignore them to allow them to avoid establishing a session also.

If IStaticCacheableResource resources had a distinctive mount path we
could easily configure filters to ignore them.

For example if all IStaticCacheableResourceS were mounted under:

/wicket/resource/static

we could easily configure third party filters to ignore them.

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



Re: Javascript resources and jsessionid

2012-01-16 Thread Martin Grigorov
See org.apache.wicket.request.mapper.BasicResourceReferenceMapper#mapHandler

All IStaticCacheableResource are passed to
org.apache.wicket.request.resource.caching.IResourceCachingStrategy#decorateUrl.
There you can tag them as you wish.

On Mon, Jan 16, 2012 at 9:09 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 JIRI issue 4334 has fixed this now which is great.

 The next issue is that while Wicket is able to avoid establishing a
 session for requests for package resources it would be good if their URL
 made it easy for other filters (eg., Open Persistence Provider in View)
 to also ignore them to allow them to avoid establishing a session also.

 If IStaticCacheableResource resources had a distinctive mount path we
 could easily configure filters to ignore them.

 For example if all IStaticCacheableResourceS were mounted under:

 /wicket/resource/static

 we could easily configure third party filters to ignore them.

 -
 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: Javascript resources and jsessionid

2012-01-16 Thread Martin Grigorov
Another approach is to mount explicitly all your resources which you
think need the session.
This way you can exclude /wicket/resource/... in your filter.

On Mon, Jan 16, 2012 at 9:18 PM, Martin Grigorov mgrigo...@apache.org wrote:
 See org.apache.wicket.request.mapper.BasicResourceReferenceMapper#mapHandler

 All IStaticCacheableResource are passed to
 org.apache.wicket.request.resource.caching.IResourceCachingStrategy#decorateUrl.
 There you can tag them as you wish.

 On Mon, Jan 16, 2012 at 9:09 PM, Chris Colman
 chr...@stepaheadsoftware.com wrote:
 JIRI issue 4334 has fixed this now which is great.

 The next issue is that while Wicket is able to avoid establishing a
 session for requests for package resources it would be good if their URL
 made it easy for other filters (eg., Open Persistence Provider in View)
 to also ignore them to allow them to avoid establishing a session also.

 If IStaticCacheableResource resources had a distinctive mount path we
 could easily configure filters to ignore them.

 For example if all IStaticCacheableResourceS were mounted under:

 /wicket/resource/static

 we could easily configure third party filters to ignore them.

 -
 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



-- 
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: Javascript resources and jsessionid

2012-01-16 Thread Chris Colman
I'm trying to think of any resources we have mounted that *do* need a
session. I'm pretty sure they're all static package resources.

Does Wicket itself mount non static references that would be mounted at
/wicket/resource ?

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Tuesday, 17 January 2012 7:20 AM
To: users@wicket.apache.org
Subject: Re: Javascript resources and jsessionid

Another approach is to mount explicitly all your resources which you
think need the session.
This way you can exclude /wicket/resource/... in your filter.

On Mon, Jan 16, 2012 at 9:18 PM, Martin Grigorov mgrigo...@apache.org
wrote:
 See
org.apache.wicket.request.mapper.BasicResourceReferenceMapper#mapHandle
r

 All IStaticCacheableResource are passed to

org.apache.wicket.request.resource.caching.IResourceCachingStrategy#dec
orat
eUrl.
 There you can tag them as you wish.

 On Mon, Jan 16, 2012 at 9:09 PM, Chris Colman
 chr...@stepaheadsoftware.com wrote:
 JIRI issue 4334 has fixed this now which is great.

 The next issue is that while Wicket is able to avoid establishing a
 session for requests for package resources it would be good if their
URL
 made it easy for other filters (eg., Open Persistence Provider in
View)
 to also ignore them to allow them to avoid establishing a session
also.

 If IStaticCacheableResource resources had a distinctive mount path
we
 could easily configure filters to ignore them.

 For example if all IStaticCacheableResourceS were mounted under:

 /wicket/resource/static

 we could easily configure third party filters to ignore them.


-
 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



--
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


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



Re: Javascript resources and jsessionid

2012-01-16 Thread Martin Grigorov
On Mon, Jan 16, 2012 at 9:25 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 I'm trying to think of any resources we have mounted that *do* need a
 session. I'm pretty sure they're all static package resources.

 Does Wicket itself mount non static references that would be mounted at
 /wicket/resource ?

Wicket doesn't mount anything by itself. Your code initiates such mounting.


-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Tuesday, 17 January 2012 7:20 AM
To: users@wicket.apache.org
Subject: Re: Javascript resources and jsessionid

Another approach is to mount explicitly all your resources which you
think need the session.
This way you can exclude /wicket/resource/... in your filter.

On Mon, Jan 16, 2012 at 9:18 PM, Martin Grigorov mgrigo...@apache.org
wrote:
 See
org.apache.wicket.request.mapper.BasicResourceReferenceMapper#mapHandle
 r

 All IStaticCacheableResource are passed to

org.apache.wicket.request.resource.caching.IResourceCachingStrategy#dec
 orat
eUrl.
 There you can tag them as you wish.

 On Mon, Jan 16, 2012 at 9:09 PM, Chris Colman
 chr...@stepaheadsoftware.com wrote:
 JIRI issue 4334 has fixed this now which is great.

 The next issue is that while Wicket is able to avoid establishing a
 session for requests for package resources it would be good if their
 URL
 made it easy for other filters (eg., Open Persistence Provider in
 View)
 to also ignore them to allow them to avoid establishing a session
 also.

 If IStaticCacheableResource resources had a distinctive mount path
 we
 could easily configure filters to ignore them.

 For example if all IStaticCacheableResourceS were mounted under:

 /wicket/resource/static

 we could easily configure third party filters to ignore them.


 -
 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



--
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


 -
 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: Update component after background thread is finished

2012-01-16 Thread humcasma

Igor Vaynberg-2 wrote
 
 start a timer behavior that polls and waits for the thread to finish,
 and only when its finished it updates the select.
 

Thanks Igor. Yes, that is a solution that I have also considered and forgot
to talk about. Indeed, I already have a timer behavior that I use to update
a textarea with the status of the thread. But I would like to avoid having
to timer behaviors. Could I have just one timer behavior that updates both
the textarea and the dropdownchoice? Or any other solution?

Humberto

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4301366.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: Update component after background thread is finished

2012-01-16 Thread Martin Grigorov
On Mon, Jan 16, 2012 at 9:38 PM, humcasma humca...@gmail.com wrote:

 Igor Vaynberg-2 wrote

 start a timer behavior that polls and waits for the thread to finish,
 and only when its finished it updates the select.


 Thanks Igor. Yes, that is a solution that I have also considered and forgot
 to talk about. Indeed, I already have a timer behavior that I use to update
 a textarea with the status of the thread. But I would like to avoid having
 to timer behaviors. Could I have just one timer behavior that updates both
 the textarea and the dropdownchoice?

Yes. Just add both to the target when the data is available

 Or any other solution?

 Humberto

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Update-component-after-background-thread-is-finished-tp4300126p4301366.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: Javascript resources and jsessionid

2012-01-16 Thread Chris Colman
 I'm trying to think of any resources we have mounted that *do* need a
 session. I'm pretty sure they're all static package resources.

 Does Wicket itself mount non static references that would be mounted
at
 /wicket/resource ?

Wicket doesn't mount anything by itself. Your code initiates such
mounting.

I realize the mounts Wicket makes are side effects of a developer adding
things like Ajax links etc., What I'm wondering is if any of these side
effects could mount a non static resource at /wicket/resource or would
that only occur if the developer explicitly mounted non static
resources.



-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Tuesday, 17 January 2012 7:20 AM
To: users@wicket.apache.org
Subject: Re: Javascript resources and jsessionid

Another approach is to mount explicitly all your resources which you
think need the session.
This way you can exclude /wicket/resource/... in your filter.

On Mon, Jan 16, 2012 at 9:18 PM, Martin Grigorov
mgrigo...@apache.org
wrote:
 See
org.apache.wicket.request.mapper.BasicResourceReferenceMapper#mapHand
le
 r

 All IStaticCacheableResource are passed to

org.apache.wicket.request.resource.caching.IResourceCachingStrategy#d
ec
 orat
eUrl.
 There you can tag them as you wish.

 On Mon, Jan 16, 2012 at 9:09 PM, Chris Colman
 chr...@stepaheadsoftware.com wrote:
 JIRI issue 4334 has fixed this now which is great.

 The next issue is that while Wicket is able to avoid establishing
a
 session for requests for package resources it would be good if
their
 URL
 made it easy for other filters (eg., Open Persistence Provider in
 View)
 to also ignore them to allow them to avoid establishing a session
 also.

 If IStaticCacheableResource resources had a distinctive mount path
 we
 could easily configure filters to ignore them.

 For example if all IStaticCacheableResourceS were mounted under:

 /wicket/resource/static

 we could easily configure third party filters to ignore them.


 -
 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



--
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


 -
 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


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



Controlling URL of static cacheable resources

2012-01-16 Thread Chris Colman
I'm trying to make static resources have a distinguishable part of their
URL near the beginning of the URL to enable easy configuration of third
party filters that need to ignore requests for static resources and just
proceed along the filter chain.
 
I've looked up the operation of
org.apache.wicket.request.resource.caching.IResourceCachingStrategy#deco
rateUrl but it appears that it only has the ability to make changes near
the end of the resource URL after all the major segments of the URL have
already been set ie., after this part
 
/wicket/resource/org.apache.wicket rest of pathname.ClassName
 
What I am trying to do is get all static resources to end up with a
distinguishable URL that starts off something like:
 
/wicket/resource/static/pathname.ClassName
 
so I can configure a filter to ignore /wicket/resource/static/*
 
In BasicResourceReferenceHandler.mapHandler() perhaps after adding the
resource identifier segment:
 
segments.add(getContext().getResourceIdentifier());
 
it could append an extra segment for static resources:
 
final IResource resource = reference.getResource();
 
// if static resource
if (resource instanceof IStaticCacheableResource)
{
segments.add(static);
}
 
And so end up with /wicket/resource/static/org.apache.wicket ...
 
 
 
I also observed that Wicketstuff resources don't use the /wicket
namespace prefix. They just start out at 
 
/resources/org.name.project.MyClass.script.js
 
So they'd need a separate ignore entry in the filter.
 
 
Yours sincerely,
 
Chris Colman
 
Pagebloom Team Leader,
Step Ahead Software

 
pagebloom - your business  your website growing together
 
Sydney: (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 
Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au 
Website:
http://www.pagebloom.com blocked::http://www.pagebloom.com/ 
http://develop.stepaheadsoftware.com
blocked::http://develop.stepaheadsoftware.com/ 
 
 


Re: how to get https port number in Wicket 1.5

2012-01-16 Thread armhold
Thanks Martin!

https://issues.apache.org/jira/browse/WICKET-4338


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-get-https-port-number-in-Wicket-1-5-tp4295139p4301617.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: Controlling URL of static cacheable resources

2012-01-16 Thread Chris Colman
Forget that last bit about wicketstuff not using the 'wicket' namespace
for its resources. I was confused by some old files in the browser cache
from Dec 2011.
 


From: Chris Colman [mailto:chr...@stepaheadsoftware.com] 
Sent: Tuesday, 17 January 2012 8:49 AM
To: users@wicket.apache.org
Subject: Controlling URL of static cacheable resources
 
I'm trying to make static resources have a distinguishable part of their
URL near the beginning of the URL to enable easy configuration of third
party filters that need to ignore requests for static resources and just
proceed along the filter chain.
 
I've looked up the operation of
org.apache.wicket.request.resource.caching.IResourceCachingStrategy#deco
rateUrl but it appears that it only has the ability to make changes near
the end of the resource URL after all the major segments of the URL have
already been set ie., after this part
 
/wicket/resource/org.apache.wicket rest of pathname.ClassName
 
What I am trying to do is get all static resources to end up with a
distinguishable URL that starts off something like:
 
/wicket/resource/static/pathname.ClassName
 
so I can configure a filter to ignore /wicket/resource/static/*
 
In BasicResourceReferenceHandler.mapHandler() perhaps after adding the
resource identifier segment:
 
segments.add(getContext().getResourceIdentifier());
 
it could append an extra segment for static resources:
 
final IResource resource = reference.getResource();
 
// if static resource
if (resource instanceof IStaticCacheableResource)
{
segments.add(static);
}
 
And so end up with /wicket/resource/static/org.apache.wicket ...
 
 
 
I also observed that Wicketstuff resources don't use the /wicket
namespace prefix. They just start out at 
 
/resources/org.name.project.MyClass.script.js
 
So they'd need a separate ignore entry in the filter.
 
 
Yours sincerely,
 
Chris Colman
 
Pagebloom Team Leader,
Step Ahead Software


pagebloom - your business  your website growing together
 
Sydney:   (+61 2) 9656 1278 Canberra: (+61 2) 6100 2120 
Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au 
Website:
http://www.pagebloom.com blocked::http://www.pagebloom.com/ 
http://develop.stepaheadsoftware.com
blocked::http://develop.stepaheadsoftware.com/ 
 
 


Re: Controlling URL of static cacheable resources

2012-01-16 Thread Martin Grigorov
On Mon, Jan 16, 2012 at 11:08 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 Forget that last bit about wicketstuff not using the 'wicket' namespace
 for its resources. I was confused by some old files in the browser cache
 from Dec 2011.

/resources/ in 1.4 is the same as /wicket/resource/ in 1.5
Which project exactly in wicketstuff do you mean ?


 

 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 17 January 2012 8:49 AM
 To: users@wicket.apache.org
 Subject: Controlling URL of static cacheable resources

 I'm trying to make static resources have a distinguishable part of their
 URL near the beginning of the URL to enable easy configuration of third
 party filters that need to ignore requests for static resources and just
 proceed along the filter chain.

 I've looked up the operation of
 org.apache.wicket.request.resource.caching.IResourceCachingStrategy#deco
 rateUrl but it appears that it only has the ability to make changes near
 the end of the resource URL after all the major segments of the URL have
 already been set ie., after this part

 /wicket/resource/org.apache.wicket rest of pathname.ClassName

 What I am trying to do is get all static resources to end up with a
 distinguishable URL that starts off something like:

 /wicket/resource/static/pathname.ClassName

 so I can configure a filter to ignore /wicket/resource/static/*

 In BasicResourceReferenceHandler.mapHandler() perhaps after adding the
 resource identifier segment:

 segments.add(getContext().getResourceIdentifier());

 it could append an extra segment for static resources:

 final IResource resource = reference.getResource();

 // if static resource
 if (resource instanceof IStaticCacheableResource)
 {
 segments.add(static);
 }

 And so end up with /wicket/resource/static/org.apache.wicket ...



 I also observed that Wicketstuff resources don't use the /wicket
 namespace prefix. They just start out at

 /resources/org.name.project.MyClass.script.js

 So they'd need a separate ignore entry in the filter.


 Yours sincerely,

 Chris Colman

 Pagebloom Team Leader,
 Step Ahead Software


 pagebloom - your business  your website growing together

 Sydney:           (+61 2) 9656 1278     Canberra: (+61 2) 6100 2120
 Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au
 Website:
 http://www.pagebloom.com blocked::http://www.pagebloom.com/
 http://develop.stepaheadsoftware.com
 blocked::http://develop.stepaheadsoftware.com/





-- 
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: Controlling URL of static cacheable resources

2012-01-16 Thread Chris Colman
chr...@stepaheadsoftware.com wrote:
 Forget that last bit about wicketstuff not using the 'wicket' namespace
 for its resources. I was confused by some old files in the browser cache
 from Dec 2011.

/resources/ in 1.4 is the same as /wicket/resource/ in 1.5
Which project exactly in wicketstuff do you mean ?

We were still using 1.4 back in December so that makes sense. Sorry for the 
confusion.



 

 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 17 January 2012 8:49 AM
 To: users@wicket.apache.org
 Subject: Controlling URL of static cacheable resources

 I'm trying to make static resources have a distinguishable part of their
 URL near the beginning of the URL to enable easy configuration of third
 party filters that need to ignore requests for static resources and just
 proceed along the filter chain.

 I've looked up the operation of
 org.apache.wicket.request.resource.caching.IResourceCachingStrategy#deco
 rateUrl but it appears that it only has the ability to make changes near
 the end of the resource URL after all the major segments of the URL have
 already been set ie., after this part

 /wicket/resource/org.apache.wicket rest of pathname.ClassName

 What I am trying to do is get all static resources to end up with a
 distinguishable URL that starts off something like:

 /wicket/resource/static/pathname.ClassName

 so I can configure a filter to ignore /wicket/resource/static/*

 In BasicResourceReferenceHandler.mapHandler() perhaps after adding the
 resource identifier segment:

 segments.add(getContext().getResourceIdentifier());

 it could append an extra segment for static resources:

 final IResource resource = reference.getResource();

 // if static resource
 if (resource instanceof IStaticCacheableResource)
 {
 segments.add(static);
 }

 And so end up with /wicket/resource/static/org.apache.wicket ...



 I also observed that Wicketstuff resources don't use the /wicket
 namespace prefix. They just start out at

 /resources/org.name.project.MyClass.script.js

 So they'd need a separate ignore entry in the filter.


 Yours sincerely,

 Chris Colman

 Pagebloom Team Leader,
 Step Ahead Software


 pagebloom - your business  your website growing together

 Sydney:           (+61 2) 9656 1278     Canberra: (+61 2) 6100 2120
 Email: chr...@stepahead.com.au mailto://chr...@stepahead.com.au
 Website:
 http://www.pagebloom.com blocked::http://www.pagebloom.com/
 http://develop.stepaheadsoftware.com
 blocked::http://develop.stepaheadsoftware.com/





--
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


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



Shibboleth Integration

2012-01-16 Thread Jered Myers
I am attempting to integrate with Shibboleth using Tomcat 6 and Wicket 
1.4.18.  I don't want to get into too much detail on Shibboleth in this 
list, but I was wonder in anybody had already done this and is able to 
get the eppn attribute back after successfully logging in.  I need to 
know the user that is logging in for my Wicket application and all of 
the login is completed on the Shibboleth identity providers login page.


--
Jered Myers


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



RE: CompoundPropertyModel and FormComponent

2012-01-16 Thread Schlärmann , Bob
 Yes, I think you are doing it the Wicket way, but your snippet and
 mine should work. Do you modify components' model somewhere else? 
No, I don't think so. The page to which the component is added is constructed 
as follows:

CompoundPropertyModelHomePage model = new 
CompoundPropertyModelHomePage(this);
FormHomePage form = new FormHomePage(form, model);
form.add(new TextFieldString(person.firstname));
form.add(new AdresPanel(person.adres));

No other code modifies the model.

  Which model do you get if you call getDefaultModel() inside oninitialize?
The result of getDefaultModel() is an instance of 
CompoundPropertyModel$AttachedCompoundPropertyModel, with owner set to the 
AdresPanel and with target set to a CompoundPropertyModel which in turn has 
target HomePage.

I noticed that upon initializing the model is set correctly. However when 
inspecting the model in onBeforeRender() during the submit request the target 
of the model of the AddressPanel.street model is set to HomePage.

  Thanks for your reply. I've tried it but it still gave the same error.
 
  However I also tried the following modified version of your idea:
 
  In AddressPanel.java:
 
  @Override
  protected void onInitialize() {
  super.onInitialize();
  Object o = getDefaultModelObject();
 
  setDefaultModel(new CompoundPropertyModel(getDefaultModelObject()));
  }
 
  With the above code I can now load the page, also the
 getDefaultModelObject() returns the correct Address instance. Unfortunately
 upon submitting the form I get the same exception again (No get method
 defined for class: class foo.HomePage expression: street).
 
  By the way: am I doing things the Wicket way? Is this how you would reuse
 parts of a form in Wicket?
 
 
 
  Best regards,
 
  Bob
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



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



Re: Label not updating on AJaxButton submit

2012-01-16 Thread malebu
Martin,

Would you be kind enough to give an example?

I tried the following:

ajaxSimpleUploadForm.add(new AjaxButton(uploadVideoSubmit) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form? form)
{

AbstractResourceStreamWriter writer = new
AbstractResourceStreamWriter() {
@Override
public void write(Response output) {
for(FileUpload upload : uploads) {
System.out.println(new Date() + : + Start
Reading);
try {
long size = upload.getSize();
BufferedReader fileReader = new
BufferedReader(new InputStreamReader(upload.getInputStream()));
ByteArrayOutputStream os = new
ByteArrayOutputStream();
int i;
int counter = 0;
while((i = fileReader.read()) != -1) {
counter ++;
os.write(i);
if(counter == 100) {
long osSize = os.size();
int p = Float.valueOf((100 * osSize)
/ size).intValue();
counter = 0;

if(p  percent) {
percent = p;
 p = 0;
}
}
}
os.flush();
os.close();
System.out.println(new Date() + : + File
read successfully);

} catch(IOException ie) {
VideoUploadPanel.this.error(There was a
problem uploading the file);
}
}
}
};
getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(writer);

...
}

The progress bar still does't get updated. Here is the response.. Note the
delay of 8 seconds marked in bold? Thats when the file is getting uploaded.

Tue Jan 17 02:21:38 EST 2012:  Loading value..
Tue Jan 17 02:21:39 EST 2012:  Updating Component
Tue Jan 17 02:21:39 EST 2012:  Loading value..
Tue Jan 17 02:21:40 EST 2012:  Updating Component
Tue Jan 17 *02:21:40 EST 2012*:  Loading value..

Tue Jan 17 02:21:43 EST 2012:  Start Reading
Tue Jan 17 02:21:48 EST 2012:  File read successfully

Tue Jan 17 *02:21:48 EST 2012*:  Updating Component
Tue Jan 17 02:21:48 EST 2012:  Loading value..
Tue Jan 17 02:21:50 EST 2012:  Updating Component
Tue Jan 17 02:21:50 EST 2012:  Loading value..
Tue Jan 17 02:21:51 EST 2012:  Updating Component
Tue Jan 17 02:21:51 EST 2012:  Loading value..
Tue Jan 17 02:21:52 EST 2012:  Updating Component


Any help / example would really be a life saver. I couldnt find much example
online on IResource and AjaxChannel

-Milton


Martin Grigorov-4 wrote
 
 Hi,
 
 I think the Ajax calls are serialized.
 The page instance can be used by a single request at any time.
 So you submit the form and this request acquires the lock on the page.
 AjaxSelfTimerUpdatingBehavior cannot use the page until the first
 request unlock it.
 Additionally the Ajax calls are serialized at the client side
 (JavaScript). See AjaxChannel class for more information about this.
 
 To be able to do what you want I suggest to use IResource to upload
 to. This way there wont be lock on the server side and with
 AjaxChannels with different names at the client side you will solve
 both problems.
 
 On Mon, Jan 16, 2012 at 2:51 AM, malebu lt;milton.quranda@gt; wrote:
 I have a requirement where i have to upload a video from a page and show
 the
 upload progress when the upload is 100% complete need to update the
 progress
 label as processing video.

 I decided to go with a simple outer div and internal div while update
 the internal div percentage to show the progress. Finally i added a
 Label
 inside the internal div to show the status...

 /div style=border: 1px solid #5d4617; padding: 3px; background-color:
 #191B10; 
                div style=width:400px; background-color: #55; color:
 white; font-size: 8px; align=left
                    div style=width:0%; background-color: #FF9900;
 align=right wicket:id=customProgressLoading.../div
                /div
            /div/


 Finally i added AjaxSelfUpdatingTimerBehavior to the internal div to
 fetch
 the progress and label every 2 seconds.

 When i click on submit button.. the label is not update while the form is
 being submitted. it shows the final progress i.e. 100% and processing
 completed after file is uploaded.

 I am using AjaxButton