RE: Problem with relative URLs

2012-01-10 Thread Chris Colman
I can't seem to get a Quickstart that reproduces the problem - even
though I've duplicated virtually every intricacy of our main app.
There's obviously something subtle that's causing the problem in our
app.

Am I right in saying that RelativepathPrefixHandler should never even be
applied to BookmarkablePageLink tags (and any classes derived from
BookmarkablePageLink)?


-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Tuesday, 10 January 2012 2:44 PM
To: users@wicket.apache.org
Subject: Re: Problem with relative URLs

wicket by default always generates relative urls. this is the
safest/easiest approach for fronting the app with a proxy, which most
people do...

-igor


On Mon, Jan 9, 2012 at 6:59 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
why is RelativePathPrefixHandler invoked on that tag? sounds a little
funky...

-igor

 I'm using UrlPathPageParametersEncoder for backwards compatibility
with
 1.5 links. I'm not sure if that could be causing the funkiness of
 RelativePathPrefixHandler being invoked.

 Are BookmarkablePageLinks treated as absolute or relative URLs? They
 could probably be quite safely be treated as absolute URLs because
they
 always contain all segments from the root anyway.

 Initially I had mounted the pages without a leading slash in the
path. I
 added the leading slash but it made no difference - I guess it could
be
 implied.


 Is there any benefit in converting a URLs like:

 /content/page/n1/v1/n2/jane to

 On a page

 /content/page/n1/v1/n2/fred to

 jane

 apart from the obvious shorter URL?



 -
 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


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



Re: Problem with relative URLs

2012-01-10 Thread Martin Grigorov
Hi,

On Tue, Jan 10, 2012 at 10:05 AM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 I can't seem to get a Quickstart that reproduces the problem - even
 though I've duplicated virtually every intricacy of our main app.
 There's obviously something subtle that's causing the problem in our
 app.

 Am I right in saying that RelativepathPrefixHandler should never even be
 applied to BookmarkablePageLink tags (and any classes derived from
 BookmarkablePageLink)?

At least its source doesn't indicate that BPL should be treated specially.



-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Tuesday, 10 January 2012 2:44 PM
To: users@wicket.apache.org
Subject: Re: Problem with relative URLs

wicket by default always generates relative urls. this is the
safest/easiest approach for fronting the app with a proxy, which most
people do...

-igor


On Mon, Jan 9, 2012 at 6:59 PM, Chris Colman
chr...@stepaheadsoftware.com wrote:
why is RelativePathPrefixHandler invoked on that tag? sounds a little
funky...

-igor

 I'm using UrlPathPageParametersEncoder for backwards compatibility
 with
 1.5 links. I'm not sure if that could be causing the funkiness of
 RelativePathPrefixHandler being invoked.

 Are BookmarkablePageLinks treated as absolute or relative URLs? They
 could probably be quite safely be treated as absolute URLs because
 they
 always contain all segments from the root anyway.

 Initially I had mounted the pages without a leading slash in the
 path. I
 added the leading slash but it made no difference - I guess it could
 be
 implied.


 Is there any benefit in converting a URLs like:

 /content/page/n1/v1/n2/jane to

 On a page

 /content/page/n1/v1/n2/fred to

 jane

 apart from the obvious shorter URL?



 -
 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


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

2012-01-10 Thread Chris Colman
 Am I right in saying that RelativepathPrefixHandler should never even
be
 applied to BookmarkablePageLink tags (and any classes derived from
 BookmarkablePageLink)?

At least its source doesn't indicate that BPL should be treated
specially.

I've made some inroads: I got a quickstart to fail by changing the
namespace in the markup like in the real app.

Maybe I haven't set up the namespace correctly which worked ok in 1.4
but raises problems in 1.5 or maybe there's some wicket code that
ignores the current markup's namespace and checks for wicket.

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



RE: Problem with relative URLs

2012-01-10 Thread Chris Colman
The problem is related to non standard (i.e. wicket) namespaces.

In my quickstart if I change the namespace in all markup from wicket
to foobar then the BPL which has only the last segment differing from
the current page ends up producing an incorrect link to another page in
the same path.

i.e.

Browser is at this page:
http://127.0.0.1/content/other/o/1234/aspect/fred


p
Here's a relative link to another page in the same 'path'
div
a foobar:id=janeLink href=../../../../../jane
style=outline: 0;
jane
/a
/div
/p
p
A link to the current page
a foobar:id=fredLink href=fredfred/a
/p

The above BPL href of ../../../../../jane is wrong.

With 'wicket' set as the namespace the 'jane' BPL outputs 'jane' which
is correct.

This same code worked with the non standard namespace under 1.4.x

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



Force fallback on links possible ?

2012-01-10 Thread armandoxxx
Hey 

Can I force AjaxFallbackLinks not to use ajax when i want it so ?

The cause for my question is IE8 .. it takes shit loads of time to replace
DOM nodes on ajax and application has a lof of panels to replace ..  

Kind regards 

Armando 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281533.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: Problem with relative URLs

2012-01-10 Thread Chris Colman
I've just submitted a JIRA issue with quickstart for this issue:

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

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



Re: Force fallback on links possible ?

2012-01-10 Thread Martijn Dashorst
if(client.isIe(8)) {
add(new Link(){});
}
else {
add(new AjaxFallbackLink(){});
}

or you could call setResponsePage(getPage()) in the onclick of the
AFL, which will do a round trip.

or you could create your own AFL that checks for IE-ness, and doesn't
render the ajax actions all together.

Martijn

On Tue, Jan 10, 2012 at 10:24 AM, armandoxxx armando@dropchop.com wrote:
 Hey

 Can I force AjaxFallbackLinks not to use ajax when i want it so ?

 The cause for my question is IE8 .. it takes shit loads of time to replace
 DOM nodes on ajax and application has a lof of panels to replace ..

 Kind regards

 Armando



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281533.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: Force fallback on links possible ?

2012-01-10 Thread Martin Grigorov
Use IAjaxCallDecorator that checks the browser version and if IE8 then
returns just true ignoring the Ajax callback script generated by
Wicket.
This will fallback to non-ajax request.

On Tue, Jan 10, 2012 at 11:24 AM, armandoxxx armando@dropchop.com wrote:
 Hey

 Can I force AjaxFallbackLinks not to use ajax when i want it so ?

 The cause for my question is IE8 .. it takes shit loads of time to replace
 DOM nodes on ajax and application has a lof of panels to replace ..

 Kind regards

 Armando



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281533.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: Force fallback on links possible ?

2012-01-10 Thread armandoxxx
thank you for your reply ... 

regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281629.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: Force fallback on links possible ?

2012-01-10 Thread armandoxxx
Thank you for your reply ! 

Regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281633.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: Force fallback on links possible ?

2012-01-10 Thread armandoxxx
I tried your suggestion and it's not working ... can you check please ? 

my link


 and rendered link output 

onClick attribute was not replaced decorated

what am I doing wrong ? 

the sample i looked on how to do it ... (taken from wiki)



regards

Armando 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281686.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



Is it possible to set the session?

2012-01-10 Thread cosmindumy
Hello,
I have 2 questions:
1. I have the situation that if the user press a button an iframe is open.
The problem is that if the user has some settings in browser, the session is
lost. It creates a new session. Is it possible to set the session to iframe? 

2. I've got an error on production server and I cannot reproduce on my
development machine. The error says :
woUploadFilesContainer:calculateButton
(path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible
org.apache.wicket.WicketRuntimeException: Submit Button
stepTwoUploadFilesContainer:calculateButton
(path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible

Which can be the cause? The submit button is never hidden, but the container
that holds it. 
I suppose that this is the code where it enters from Form class from wicket
sources :
if (!component.isVisibleInHierarchy())
{
throw new
WicketRuntimeException(Submit Button  +
   
submittingComponent.getInputName() +  (path= +
   
component.getPageRelativePath() + ) is not visible);
}

Has anyone any idea? 
Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-it-possible-to-set-the-session-tp4281720p4281720.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: Force fallback on links possible ?

2012-01-10 Thread Martin Grigorov
On Tue, Jan 10, 2012 at 12:53 PM, armandoxxx armando@dropchop.com wrote:
 I tried your suggestion and it's not working ... can you check please ?

 my link


  and rendered link output

 onClick attribute was not replaced decorated

 what am I doing wrong ?

Nothing to read above...


 the sample i looked on how to do it ... (taken from wiki)



 regards

 Armando

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281686.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: Custom CSS-Class for OrderByLink (possible?)

2012-01-10 Thread Rain... Is wet!
Got what I want, but had to give up this approach :(

Instead of adding more css-classes, I just added a label to the
HeadersToolbar, to switch the ordering state via css background-image and
doing my checks for grouptotals in HeadersToolbar.onConfigure() where an
sumup-symbol is added as the new labels DataModelObject.

-
Never forget your umbrella ! In case You did, try to find a shelter ;)
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-CSS-Class-for-OrderByLink-possible-tp4268604p4281731.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: Is it possible to set the session?

2012-01-10 Thread Martin Grigorov
On Tue, Jan 10, 2012 at 1:07 PM, cosmindumy cosmind...@yahoo.com wrote:
 Hello,
 I have 2 questions:
 1. I have the situation that if the user press a button an iframe is open.
 The problem is that if the user has some settings in browser, the session is
 lost. It creates a new session. Is it possible to set the session to iframe?

See Session.bind(). Call it before as soon as the http session should
be created.


 2. I've got an error on production server and I cannot reproduce on my
 development machine. The error says :
 woUploadFilesContainer:calculateButton
 (path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible
 org.apache.wicket.WicketRuntimeException: Submit Button
 stepTwoUploadFilesContainer:calculateButton
 (path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible

 Which can be the cause? The submit button is never hidden, but the container
 that holds it.

Check that any of its parents is not hidden at some point.

 I suppose that this is the code where it enters from Form class from wicket
 sources :
 if (!component.isVisibleInHierarchy())
                                                        {
                                                                throw new
 WicketRuntimeException(Submit Button  +

 submittingComponent.getInputName() +  (path= +

 component.getPageRelativePath() + ) is not visible);
                                                        }

 Has anyone any idea?
 Thanks!

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Is-it-possible-to-set-the-session-tp4281720p4281720.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: Force fallback on links possible ?

2012-01-10 Thread armandoxxx
Repost without raw tags ... 

I tried your suggestion and it's not working ... can you check please ? 

my link



AjaxFallbackLinkDateOption
link= new AjaxFallbackLinkDateOption(link, new
ModelDateOption(dateOption)) {
@Override
public void onClick(final AjaxRequestTarget theTarget) {
/* some action */
}

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence script) 
{
return return true;;
}
};
}

};



 and rendered link output 

tag a 
id=link580 

href=analytics?5-1.ILinkListener-htmlBody-filtersWrapper-filterCollectionPanel-dateFilter-contentWrapper-dateForm-dates-3-link
 
onclick=var
wcall=wicketAjaxGet('analytics?5-1.IBehaviorListener.0-htmlBody-filtersWrapper-filterCollectionPanel-dateFilter-contentWrapper-dateForm-dates-3-link',function()
{ }.bind(this),function() { }.bind(this), function() {return
Wicket.$('link580') != null;}.bind(this));return !wcall;
my text
close tag a

onClick attribute was not replaced decorated

what am I doing wrong ? 

the sample i looked on how to do it ... (taken from wiki)

new AjaxLink(link) {
  protected onClick(AjaxRequestTarget target) { ...}
  protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
  public CharSequence decorateScript(CharSequence script) {
return alert('This is my javascript call');  + script;
  }
}
  }
}


regards

Armando 
PS: can you read this ? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281770.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: Force fallback on links possible ?

2012-01-10 Thread Martin Grigorov
On Tue, Jan 10, 2012 at 1:53 PM, armandoxxx armando@dropchop.com wrote:
 Repost without raw tags ...

 I tried your suggestion and it's not working ... can you check please ?

 my link



 AjaxFallbackLinkDateOption
 link            = new AjaxFallbackLinkDateOption(link, new
 ModelDateOption(dateOption)) {
        @Override
        public void onClick(final AjaxRequestTarget theTarget) {
                /* some action */
        }

        @Override
        protected IAjaxCallDecorator getAjaxCallDecorator() {
                return new AjaxCallDecorator() {
                        public CharSequence decorateScript(CharSequence 
 script) {
                                return return true;;
                        }
                };
        }

 };

This looks OK. I think it should work.




  and rendered link output

 tag a
        id=link580

 href=analytics?5-1.ILinkListener-htmlBody-filtersWrapper-filterCollectionPanel-dateFilter-contentWrapper-dateForm-dates-3-link
        onclick=var
 wcall=wicketAjaxGet('analytics?5-1.IBehaviorListener.0-htmlBody-filtersWrapper-filterCollectionPanel-dateFilter-contentWrapper-dateForm-dates-3-link',function()
 { }.bind(this),function() { }.bind(this), function() {return
 Wicket.$('link580') != null;}.bind(this));return !wcall;
        my text
 close tag a

 onClick attribute was not replaced decorated

 what am I doing wrong ?

 the sample i looked on how to do it ... (taken from wiki)

 new AjaxLink(link) {
  protected onClick(AjaxRequestTarget target) { ...}
  protected IAjaxCallDecorator getAjaxCallDecorator() {
    return new AjaxCallDecorator() {
      public CharSequence decorateScript(CharSequence script) {
        return alert('This is my javascript call');  + script;
      }
    }
  }
 }


 regards

 Armando
 PS: can you read this ?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281770.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: Force fallback on links possible ?

2012-01-10 Thread armandoxxx
fixed it ... 

had wrong method signature ... 
should have been:
public CharSequence decorateScript(final Component theComponent, final
CharSequence theScript) 


regards

Armando



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281856.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: Force fallback on links possible ?

2012-01-10 Thread Martin Grigorov
Fix the wiki page too ;-)
It's community based!

On Tue, Jan 10, 2012 at 2:44 PM, armandoxxx armando@dropchop.com wrote:
 fixed it ...

 had wrong method signature ...
 should have been:
 public CharSequence decorateScript(final Component theComponent, final
 CharSequence theScript)


 regards

 Armando



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Force-fallback-on-links-possible-tp4281533p4281856.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



PropertyModel with x.y as property name (from a properties file)

2012-01-10 Thread Decebal Suiu
Hello

I have a form with new CompoundPropertyModelValueMap(properties) as model
where properties are loaded from a properties file (legacy). My problem is
that in properties file I have keys like x.y
and I cannot use form.add(new TextFieldString(body.background-color));

How do I solve this problem?

Thanks,
Decebal

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PropertyModel-with-x-y-as-property-name-from-a-properties-file-tp4282146p4282146.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: Is it possible to set the session?

2012-01-10 Thread cosmindumy

See Session.bind(). Call it before as soon as the http session should
be created.

Can you explain a little more what did you mean? 
I tried mySession.bind in method newSession() from MyWebApplication. I don't
know if that's what you mean. 
I'm interested to know if it's possible to pass my application session to
the iframe. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-it-possible-to-set-the-session-tp4281720p4282241.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: Is it possible to set the session?

2012-01-10 Thread Martin Grigorov
iframe shares the same http session with any other url in the app

o.a.w.Session#bind() will create a new http session if it is not
already created.
So create it as soon as you need it and from there on all requests
will share the same http session

On Tue, Jan 10, 2012 at 5:22 PM, cosmindumy cosmind...@yahoo.com wrote:

 See Session.bind(). Call it before as soon as the http session should
 be created.

 Can you explain a little more what did you mean?
 I tried mySession.bind in method newSession() from MyWebApplication. I don't
 know if that's what you mean.
 I'm interested to know if it's possible to pass my application session to
 the iframe.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Is-it-possible-to-set-the-session-tp4281720p4282241.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: Is it possible to set the session?

2012-01-10 Thread cosmindumy

Martin Grigorov-4 wrote
 
 iframe shares the same http session with any other url in the app
 
 That's right.It works fine on normal cases. But if I set  Block sites
 from setting any data and Block third-party cookies from being set when
 it opens the iframe it creates a new session, finding the old one null. So
 I loose all the informations put on session. 
 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Is-it-possible-to-set-the-session-tp4281720p4282292.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: AJAX upload in modal window hangs when file size is too large @L

2012-01-10 Thread Alec Swan
Commenting out the first line in the code below fixes the problem but
I don't understand why the fix works.

Note that get(infoFeedback) returns feedback panel of the modal
window page - and not of the upload form. The filter of the feedback
panel uses 
http://www.jeremythomerson.com/blog/2011/01/catching-all-feedback-messages-that-arent-rendered-by-other-feedback-panels/
approach to filter out messages of child feedback panels that have
already been rendered.

Button uploadButton = new AjaxButton(uploadButton)
{
@Override
protected void onSubmit(AjaxRequestTarget target, Form? form) {
//target.addComponent(get(infoFeedback)); // this
causes AJAX upload to hang duing upload of file exceeding max upload
size
uploadForm.onSubmit();
}
};

Thoughts?

Thanks,

Alec

On Sun, Jan 8, 2012 at 12:29 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 I have an upload form which uploads files using AJAX.

 When the file size is less than maxUploadSize the form work correctly
 on the page and modal window.

 When file size is greater than maxUploadSize then form works correctly
 and displays an error on the page, but hangs in modal window after
 INFO: Invoking pre-call handler(s)... and before INFO: Response
 parsed. Now invoking steps

 What could be the reason for AJAX upload request to hang in modal
 window when the file uploaded is too large?

 Thanks,

 Alec

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



Re: PropertyModel with x.y as property name (from a properties file)

2012-01-10 Thread Sven Meier

Write you own model:

public class PropertiesModel extends AbstractReadOnlyModelString {

  private Properties properties;

  private String key;

  // constructor ...

  public String getObject() {
return properties.get(key);
  }
}

You can implement IComponentInheritedModel if you want to have the same 
magic supported by CompoundPropertyModel, e.g.:


Form form = new Form(form, new MyPropertiesModel(properties));
form.add(new TextFieldString(body.background-color));

Hope this helps
Sven

Am 10.01.2012 15:44, schrieb Decebal Suiu:

Hello

I have a form with new CompoundPropertyModelValueMap(properties) as model
where properties are loaded from a properties file (legacy). My problem is
that in properties file I have keys like x.y
and I cannot use form.add(new TextFieldString(body.background-color));

How do I solve this problem?

Thanks,
Decebal

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PropertyModel-with-x-y-as-property-name-from-a-properties-file-tp4282146p4282146.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: AJAX upload in modal window hangs when file size is too large @L

2012-01-10 Thread Doug Leeper
I am assuming what you mean by hanging is that the call on the client browser
doesn't complete or is interrupted for some reason.  The hanging is not
occurring on the server side...correct?

Are there any javascript errors?  I ask b/c you indicated:

INFO: Invoking pre-call handler(s)... and before INFO: Response  parsed.
Now invoking steps 

Could be that the info window is not there in the DOM any more?

Not that these are answers but steps I would like to solving this problem.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AJAX-upload-in-modal-window-hangs-when-file-size-is-too-large-L-tp4276504p4282736.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: AJAX upload in modal window hangs when file size is too large @L

2012-01-10 Thread Alec Swan
Correct, the client does not complete even though my server code
execution finishes.

There are no Javascript errors. It is possible that the info window is
not a part of the DOM but I don't know how to verify that.

The problem is caused by adding a component from the parent page to
ART during AJAX upload. And it's only broken in a modal window during
very large uploads!

I enabled Wicket debug logging and noticed different messages logged
during upload from modal window and regular page. Here is the first
line that is different:
Modal: org.apache.wicket.MarkupContainer - Add _header_ to [Page class
= MyPage, id = 3, version = 0, ajax = 2]
Page: org.apache.wicket.MarkupContainer - Add _header_ to [Page class
= MyPage, id = 4, version = 0]

Does ajax = 2 have any significance here?

Thanks,

Alec

On Tue, Jan 10, 2012 at 10:49 AM, Doug Leeper douglee...@yahoo.com wrote:
 I am assuming what you mean by hanging is that the call on the client browser
 doesn't complete or is interrupted for some reason.  The hanging is not
 occurring on the server side...correct?

 Are there any javascript errors?  I ask b/c you indicated:

 INFO: Invoking pre-call handler(s)... and before INFO: Response  parsed.
 Now invoking steps

 Could be that the info window is not there in the DOM any more?

 Not that these are answers but steps I would like to solving this problem.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AJAX-upload-in-modal-window-hangs-when-file-size-is-too-large-L-tp4276504p4282736.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



redirecting, cookies, render mode and testing

2012-01-10 Thread kamiseq
hej,
maybe Im still confusing basics concepts but this is quite new stuff.

recently I had few problems with redirecting after setting cookies (my
application was setup to use render-to-buffer default strategy).
simple setResponsePage is not good enough as cookies are lost then I
was advised to use ReplaceHandlerException and rewrite response
actions (like setting cookies) from response to original response.
private void rewriteResponseActions()
{
final RequestCycle cycle = RequestCycle.get();
Response response = cycle.getResponse();
Response originalResponse = cycle.getOriginalResponse();
//it only makes sense for IMetaDataBufferingWebResponse
//in tests originalResponse is same as response
if (originalResponse != response  response instanceof
IMetaDataBufferingWebResponse)
{
IMetaDataBufferingWebResponse bufferingWebResponse =
(IMetaDataBufferingWebResponse) response;
bufferingWebResponse.writeMetaData((WebResponse) originalResponse);
}
}
this works fine, redirect is not scheduled and is immediately performed.

there is one but however!
setting my application to use one-pass-render strategy breaks url
rendering. the app is redirected correctly but url is as it was before
redirecting.
I was investigating that and it seems it is because in
WebPageRenderer#respond(RequestCycle requestCycle) currentUrl (the one
from before redirection) is used instead of targetUrl (the one where
we want redirect to)

if (isOnePassRender()  isAjax == false  getRedirectPolicy() !=
RedirectPolicy.ALWAYS_REDIRECT)
then
BufferedWebResponse response = renderPage(currentUrl, requestCycle);
// but new requestHandler (the one from replace handler exception) is
used

now probably I should pass ALWAYS_REDIRECT instead of AUTO_REDIRECT to
just created ReplaceHandlerException and it would fix all my problems
but I didnt.
I decided that I will go back to setResponsePage and reuse
rewiriteResponseActions just before redirection. And it all works fine
(yeah I really dont need immediate redirection), cookies are
persisted. So why this is not part of default behaviour?

the other thing is that wicket tester uses totally different logic and
it always passes my redirect tests no matter which redirection method
I choose (setResponsePage or throw ReplaceHandlerException) as
cycle.getResponse() and cycle.getOriginalResponse() returns the same
object and cookies are already there.

If this is WAD then OK but maybe it could be described better somewhere.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__

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



Re: AJAX upload in modal window hangs when file size is too large @L

2012-01-10 Thread Alec Swan
I just compared HTTP traces between AJAX-uploading a small file and
large file and noticed that in both cases the same POST call is made
from the client. However, with small file upload POST result returns
quickly with status 200 and with large file the POST call never
returns.

When I pause my debugging session I can see that the code is blocking
in WebResponse#write(AppendingStringBuffer asb).

Why would the AJAX-upload POST hang?

Thanks,

Alec

On Tue, Jan 10, 2012 at 11:55 AM, Alec Swan alecs...@gmail.com wrote:
 Correct, the client does not complete even though my server code
 execution finishes.

 There are no Javascript errors. It is possible that the info window is
 not a part of the DOM but I don't know how to verify that.

 The problem is caused by adding a component from the parent page to
 ART during AJAX upload. And it's only broken in a modal window during
 very large uploads!

 I enabled Wicket debug logging and noticed different messages logged
 during upload from modal window and regular page. Here is the first
 line that is different:
 Modal: org.apache.wicket.MarkupContainer - Add _header_ to [Page class
 = MyPage, id = 3, version = 0, ajax = 2]
 Page: org.apache.wicket.MarkupContainer - Add _header_ to [Page class
 = MyPage, id = 4, version = 0]

 Does ajax = 2 have any significance here?

 Thanks,

 Alec

 On Tue, Jan 10, 2012 at 10:49 AM, Doug Leeper douglee...@yahoo.com wrote:
 I am assuming what you mean by hanging is that the call on the client browser
 doesn't complete or is interrupted for some reason.  The hanging is not
 occurring on the server side...correct?

 Are there any javascript errors?  I ask b/c you indicated:

 INFO: Invoking pre-call handler(s)... and before INFO: Response  parsed.
 Now invoking steps

 Could be that the info window is not there in the DOM any more?

 Not that these are answers but steps I would like to solving this problem.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AJAX-upload-in-modal-window-hangs-when-file-size-is-too-large-L-tp4276504p4282736.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: signOut and port

2012-01-10 Thread brettTi
Yea, I was already doing all that.  The issue was the :8443 in the url, which
is accurate but bothersome since we are trying to hide that with iptables.

Fixed it by throwing a RedirectToUrlException with the port number left out
of the url.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/signOut-and-port-tp4254767p4284021.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: PropertyModel with x.y as property name (from a properties file)

2012-01-10 Thread James Carman
or don't use cpm
On Jan 10, 2012 11:10 AM, Sven Meier s...@meiers.net wrote:

 Write you own model:

 public class PropertiesModel extends AbstractReadOnlyModelString {

  private Properties properties;

  private String key;

  // constructor ...

  public String getObject() {
return properties.get(key);
  }
 }

 You can implement IComponentInheritedModel if you want to have the same
 magic supported by CompoundPropertyModel, e.g.:

 Form form = new Form(form, new MyPropertiesModel(properties))**;
 form.add(new TextFieldString(body.**background-color));

 Hope this helps
 Sven

 Am 10.01.2012 15:44, schrieb Decebal Suiu:

 Hello

 I have a form with new CompoundPropertyModel**ValueMap(properties) as
 model
 where properties are loaded from a properties file (legacy). My problem is
 that in properties file I have keys like x.y
 and I cannot use form.add(new TextFieldString(body.**
 background-color));

 How do I solve this problem?

 Thanks,
 Decebal

 --
 View this message in context: http://apache-wicket.1842946.**
 n4.nabble.com/PropertyModel-**with-x-y-as-property-name-**
 from-a-properties-file-**tp4282146p4282146.htmlhttp://apache-wicket.1842946.n4.nabble.com/PropertyModel-with-x-y-as-property-name-from-a-properties-file-tp4282146p4282146.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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




Model problem with my own component

2012-01-10 Thread Wayne W
Hello,

I cannot get my component model to update correctly when being set. I
have list of products and when I click on the name via ajax I update a
Product panel to display the info. In that panel I have my component
that displays the image of the product. sudo code:

ProductPanel(id, IModelProduct model) {
  super(id, new CompoundPropertyModel(model));

  add(new Label(name);
  add(new ProductImage(image, getDefaultModel());
}

ProductImage extends Image {
  ProductImage(id, IModelProduct model) {
super( id, model);

   Product p = getDefaultModelObject();
   // p always null

}


AjaxLink() {
  onclick(target) {
productPanel.setDefaultModel(getModel());
target.add(productPanel);
}}


When I click on the link the name is updated and displayed correctly.
However in the ProductImage component the product is always null. I
thought when setting the default model all the children are visited
and model updated.? I;ve tried debugging but get cannot figure it out.

Any ideas?

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



Re: Model problem with my own component

2012-01-10 Thread Sven Meier

Hi,

 add(new ProductImage(image, getDefaultModel());

this line is causing the null product.

 I thought when setting the default model all the children are visited 
and model updated.?


No, not at all. Either you have to do that by yourself or you have to 
give ProductImage a more intelligent model:


 add(new ProductImage(image, new AbstractReadOnlyModelProduct() {
  public Product getObject() {
  return getDefaultModel().getObject();
  }
 });

Hope this helps
Sven

Am 11.01.2012 08:01, schrieb Wayne W:

Hello,

I cannot get my component model to update correctly when being set. I
have list of products and when I click on the name via ajax I update a
Product panel to display the info. In that panel I have my component
that displays the image of the product. sudo code:

ProductPanel(id, IModelProduct  model) {
   super(id, new CompoundPropertyModel(model));

   add(new Label(name);
   add(new ProductImage(image, getDefaultModel());
}

ProductImage extends Image {
   ProductImage(id, IModelProduct  model) {
 super( id, model);

Product p = getDefaultModelObject();
// p always null

}


AjaxLink() {
   onclick(target) {
 productPanel.setDefaultModel(getModel());
 target.add(productPanel);
}}


When I click on the link the name is updated and displayed correctly.
However in the ProductImage component the product is always null. I
thought when setting the default model all the children are visited
and model updated.? I;ve tried debugging but get cannot figure it out.

Any ideas?

-
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