Re: Ajax Error When using File Upload

2017-01-25 Thread David Beer
Hi Martin

Thanks for confirming have managed to enable the correct security settings
all is working again.

Thanks

David

On 25 January 2017 at 21:17, Martin Grigorov  wrote:

> Hi David,
>
> I think it is Spring Security.
> Check that the value of X-Frame-Options response header is SAMEORIGIN
>
> For more info see
> https://peteris.rocks/blog/exotic-http-headers/#x-frame-options
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 25, 2017 at 9:58 PM, David Beer 
> wrote:
>
> > Hi All
> >
> > I have panel which contains a form for uploading a file
> > using BootstrapFileInput. When I upload the file all is correctly
> uploaded
> > but I receive this error in Ajax Debug console.
> >
> > *ERROR: *
> > Cannot read Ajax response for multipart form submit: SecurityError:
> > Blocked a frame with origin "
> > http://localhost:8080; from accessing a cross-origin frame.
> > *ERROR: *
> > Wicket.Ajax.Call.failure: Error while parsing response: No XML
> > response in the IFrame document
> >
> > I am bit stuck on this one, not sure if this a wicket issue or a spring
> > security issue.
> >
> > Any pointers would be helpful.
> >
> > Thanks
> >
>


Re: Ajax Error When using File Upload

2017-01-25 Thread Martin Grigorov
Hi David,

I think it is Spring Security.
Check that the value of X-Frame-Options response header is SAMEORIGIN

For more info see
https://peteris.rocks/blog/exotic-http-headers/#x-frame-options

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 25, 2017 at 9:58 PM, David Beer  wrote:

> Hi All
>
> I have panel which contains a form for uploading a file
> using BootstrapFileInput. When I upload the file all is correctly uploaded
> but I receive this error in Ajax Debug console.
>
> *ERROR: *
> Cannot read Ajax response for multipart form submit: SecurityError:
> Blocked a frame with origin "
> http://localhost:8080; from accessing a cross-origin frame.
> *ERROR: *
> Wicket.Ajax.Call.failure: Error while parsing response: No XML
> response in the IFrame document
>
> I am bit stuck on this one, not sure if this a wicket issue or a spring
> security issue.
>
> Any pointers would be helpful.
>
> Thanks
>


Ajax Error When using File Upload

2017-01-25 Thread David Beer
Hi All

I have panel which contains a form for uploading a file
using BootstrapFileInput. When I upload the file all is correctly uploaded
but I receive this error in Ajax Debug console.

*ERROR: *
Cannot read Ajax response for multipart form submit: SecurityError:
Blocked a frame with origin "
http://localhost:8080; from accessing a cross-origin frame.
*ERROR: *
Wicket.Ajax.Call.failure: Error while parsing response: No XML
response in the IFrame document

I am bit stuck on this one, not sure if this a wicket issue or a spring
security issue.

Any pointers would be helpful.

Thanks


Re: IMarkupCacheKeyProvider getCacheKey

2017-01-25 Thread Entropy
Perfect.  Thanks.


Brian Mulholland
"For every complex problem, there is an answer that is clear, simple and
wrong."
--H.L. Mencken
"Politics is the art of looking for trouble, finding it everywhere,
diagnosing it incorrectly, and applying the wrong remedies."
--Groucho Marx

On Wed, Jan 25, 2017 at 3:14 PM, Martin Grigorov-4 [via Apache Wicket] <
ml-node+s1842946n4676868...@n4.nabble.com> wrote:

> Hi,
>
> The default impl is org.apache.wicket.markup.DefaultMarkupCacheKeyProvider.
>
> So instead of implementing the interface you need to extend from this
> class
> and return null or super.getCacheKey().
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 25, 2017 at 8:01 PM, Entropy <[hidden email]
> > wrote:
>
> > I am trying to make Wicket NOT cache html templates, but only based on a
> > certain system property.  So if this property is off, no caching, I
> return
> > null from getCacheKey() and that seems to work great.  But, I am not
> sure
> > what to do when I WANT caching.
> >
> > The method takes a MarkupContainer and containerClass parameter, but I
> am
> > unsure what I am supposed to do with them. I presume I am supposed to
> > manufacture a key somehow.  But not knowing how the key is used, I am
> > unclear how to generate it.  Is there a default implementation of this I
> > could utilize?  Every example I find online is just returning null in
> order
> > to achieve no caching ALL the time.  But I only want it conditionally.
> >
> > --
> > View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/
> > IMarkupCacheKeyProvider-getCacheKey-tp4676864.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden email]
> 
> > For additional commands, e-mail: [hidden email]
> 
> >
> >
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-wicket.1842946.n4.nabble.com/IMarkupCacheKeyProvider-
> getCacheKey-tp4676864p4676868.html
> To unsubscribe from IMarkupCacheKeyProvider getCacheKey, click here
> 
> .
> NAML
> 
>


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IMarkupCacheKeyProvider-getCacheKey-tp4676864p4676870.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 request stopped because of precondition check on CheckGroup

2017-01-25 Thread SeldonCrisis
Ahhh that worked perfectly and was such a simple fix. So now I understand
that Check is to be used in a CheckGroup and CheckBox is only useful if used
alone. Thank you very much!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-CheckGroup-tp4676865p4676869.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: IMarkupCacheKeyProvider getCacheKey

2017-01-25 Thread Martin Grigorov
Hi,

The default impl is org.apache.wicket.markup.DefaultMarkupCacheKeyProvider.
So instead of implementing the interface you need to extend from this class
and return null or super.getCacheKey().

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 25, 2017 at 8:01 PM, Entropy  wrote:

> I am trying to make Wicket NOT cache html templates, but only based on a
> certain system property.  So if this property is off, no caching, I return
> null from getCacheKey() and that seems to work great.  But, I am not sure
> what to do when I WANT caching.
>
> The method takes a MarkupContainer and containerClass parameter, but I am
> unsure what I am supposed to do with them. I presume I am supposed to
> manufacture a key somehow.  But not knowing how the key is used, I am
> unclear how to generate it.  Is there a default implementation of this I
> could utilize?  Every example I find online is just returning null in order
> to achieve no caching ALL the time.  But I only want it conditionally.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/
> IMarkupCacheKeyProvider-getCacheKey-tp4676864.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 request stopped because of precondition check on CheckGroup

2017-01-25 Thread Sven Meier

Hi,

you have to use org.apache.wicket.markup.html.form.*Check* inside your 
CheckGroup, not Checkboxes.


Have fun
Sven


On 25.01.2017 20:35, SeldonCrisis wrote:

Hi,

I'm trying to implement some *Ajax* on a *CheckGroup* containing two check
boxes. The purpose of this Ajax Event is to enable/disable a form button
depending on whether or not the checkboxes in the CheckGroup are true/false
(their models).

Unfortunately, I can't get anything in the onUpdate() to run, and when I
toggle a breakpoint on onUpdate() I don't actually reach it. Instead, I get
a message in the Ajax Debug Window:
INFO: focus set on cg1-cb1
INFO: Ajax request stopped because of precondition check, url:
./submit?3-5.IBehaviorListener.0-form-fileClaimContainer-cg1
INFO: focus removed from cg1-cb1

*Here's the relevant Java: *
fileClaimContainer = new WebMarkupContainer("fileClaimContainer");
fileClaimContainer.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true).setVisible(true);

final Button fileClaimButton;
final CheckBox cb1 = new CheckBox("cg1-cb1", new Model(false));
final CheckBox cb2 = new CheckBox("cg1-cb2", new Model(false));

fileClaimButton = new Button("fileClaimButton");
fileClaimButton.setOutputMarkupId(true);
fileClaimButton.setOutputMarkupPlaceholderTag(true);

CheckGroup cg1 = new CheckGroup("cg1", new Model());
cg1.setOutputMarkupId(true);
cg1.setOutputMarkupPlaceholderTag(true);
cg1.add(cb1, cb2);
cg1.add(new AjaxFormChoiceComponentUpdatingBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (!cb1.getModelObject() || !cb2.getModelObject())
fileClaimButton.setEnabled(false);
else
fileClaimButton.setEnabled(true);   
target.add(fileClaimButton);
}   
});

fileClaimContainer.add(fileClaimButton);
fileClaimContainer.add(cg1);

*And heres the HTML: *




Label 1



Label 2



Warning
  







I found that many questions similar to this have been asked here before, and
I've looked through those past forum posts for a solution, but I'm quite new
to Wicket and I'm having trouble applying those solutions to my problem. I
would really appreciate any help I could get here. Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-CheckGroup-tp4676865.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 request stopped because of precondition check on CheckGroup

2017-01-25 Thread SeldonCrisis
I suspect it has something to do with the Model object of the CheckGroup cg1?
I know it is supposed to be of type Collection. Maybe that's what's causing
the precondition check to fail?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-CheckGroup-tp4676865p4676866.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



Ajax request stopped because of precondition check on CheckGroup

2017-01-25 Thread SeldonCrisis
Hi,

I'm trying to implement some *Ajax* on a *CheckGroup* containing two check
boxes. The purpose of this Ajax Event is to enable/disable a form button
depending on whether or not the checkboxes in the CheckGroup are true/false
(their models). 

Unfortunately, I can't get anything in the onUpdate() to run, and when I
toggle a breakpoint on onUpdate() I don't actually reach it. Instead, I get
a message in the Ajax Debug Window:
INFO: focus set on cg1-cb1
INFO: Ajax request stopped because of precondition check, url:
./submit?3-5.IBehaviorListener.0-form-fileClaimContainer-cg1
INFO: focus removed from cg1-cb1

*Here's the relevant Java: *
fileClaimContainer = new WebMarkupContainer("fileClaimContainer");
fileClaimContainer.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true).setVisible(true);

final Button fileClaimButton;
final CheckBox cb1 = new CheckBox("cg1-cb1", new Model(false));
final CheckBox cb2 = new CheckBox("cg1-cb2", new Model(false));

fileClaimButton = new Button("fileClaimButton");
fileClaimButton.setOutputMarkupId(true);
fileClaimButton.setOutputMarkupPlaceholderTag(true);

CheckGroup cg1 = new CheckGroup("cg1", new Model());
cg1.setOutputMarkupId(true);
cg1.setOutputMarkupPlaceholderTag(true);
cg1.add(cb1, cb2);
cg1.add(new AjaxFormChoiceComponentUpdatingBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
if (!cb1.getModelObject() || !cb2.getModelObject())
fileClaimButton.setEnabled(false);
else
fileClaimButton.setEnabled(true);   
target.add(fileClaimButton);
}   
});

fileClaimContainer.add(fileClaimButton);
fileClaimContainer.add(cg1);

*And heres the HTML: *
 

 

Label 1



Label 2



Warning
 






I found that many questions similar to this have been asked here before, and
I've looked through those past forum posts for a solution, but I'm quite new
to Wicket and I'm having trouble applying those solutions to my problem. I
would really appreciate any help I could get here. Thanks! 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-request-stopped-because-of-precondition-check-on-CheckGroup-tp4676865.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



IMarkupCacheKeyProvider getCacheKey

2017-01-25 Thread Entropy
I am trying to make Wicket NOT cache html templates, but only based on a
certain system property.  So if this property is off, no caching, I return
null from getCacheKey() and that seems to work great.  But, I am not sure
what to do when I WANT caching.  

The method takes a MarkupContainer and containerClass parameter, but I am
unsure what I am supposed to do with them. I presume I am supposed to
manufacture a key somehow.  But not knowing how the key is used, I am
unclear how to generate it.  Is there a default implementation of this I
could utilize?  Every example I find online is just returning null in order
to achieve no caching ALL the time.  But I only want it conditionally.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IMarkupCacheKeyProvider-getCacheKey-tp4676864.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