Re: Point Form action to Page

2013-06-21 Thread Daniel Watrous
That first approach worked, but it brings me back to another issue: I end
up with a query string parameter
&searchFilter=quick

This is the same problem I was running in to here:
http://apache-wicket.1842946.n4.nabble.com/form-GET-and-POST-getting-mixed-up-td4659427.html

When I try to load the page again, it keeps replacing that query string and
so I can't get back to a broad result.

Is there some way to clear the search (by clearing the query string
parameter)?

Daniel

On Fri, Jun 21, 2013 at 3:51 PM, Paul Bors  wrote:

> class SearchPanel ... {
>   ...
>   add("id", new SomeButtonSubmitLinkOrForm {
> @Override
>   public void onSubmit() {
>  // your biz logic
>  PageParameter pageParameter = new PageParameters();
>  pageParameters.add("searchFilter", mySearchFilter);
>  setResponsePage(SearchResultsPage.class, pageParameter);
>   }
>   });
>   ...
> }
>
> http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/request/m
> apper/parameter/PageParameters.html#PageParameters%28%29
>
> On a second though it might be even simpler not to use PageParameters
> (since
> you might have too many filter form fields) but to add another constructor
> to your SearchResultsPage that takes an instance to your SearchFilter POJO
> and filters itself accordingly. I normally reuse my DAO mapped POJOs.
>
> class SearchPanel ... {
>   ...
>   add("id", new SomeButtonSubmitLinkOrForm {
> @Override
>   public void onSubmit() {
>  // your biz logic creates an instance of mySearchFilter that
> encapsulates your search parameters
>  setResponsePage(new SearchResultsPage(mySearchFilter)); // create
> this constructor and filter the page by it
>   }
>   });
>   ...
> }
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: Daniel Watrous [mailto:dwmaill...@gmail.com]
> Sent: Friday, June 21, 2013 5:40 PM
> To: users@wicket.apache.org
> Subject: Re: Point Form action to Page
>
> Within my SearchPanel onSubmit, how do I get the PageParameters to make
> that
> call to setResponsePage? I hope I'm understanding you right.
>
>
> On Fri, Jun 21, 2013 at 3:30 PM, Paul Bors  wrote:
>
> > There is a good reason why Wicket is not letting you override a form's
> > action attribute. Is at the core of its processing.
> >
> > If I understand you right you have a panel that processes a search
> > form and you would like to respond with SearchResultsPage.
> >
> > Wicket's way of doing that would be to use PageParameters. Add a
> > constructor to your SearchResultsPage that takes in an instance of
> > PageParameters and then pass your search parameters through it via
> > setResponsePage(new SearchResultsPage(mySearchPageParameters).
> >
> > If I didn't understand you right, then try to better explain your
> > use-case
> > :)
> >
> > You might also be interested in the
> > o.a.wicket.extensions.markup.html.repeater.data.table.filter package
> > :)
> >
> > ~ Thank you,
> >   Paul Bors
> >
> > -Original Message-
> > From: Daniel Watrous [mailto:dwmaill...@gmail.com]
> > Sent: Friday, June 21, 2013 5:13 PM
> > To: users@wicket.apache.org
> > Subject: Point Form action to Page
> >
> > Hi,
> >
> > I have created a Panel that contains a search form. I can't figure out
> > how to get the "action" of the Form to submit to the search results
> > page. Any ideas?
> >
> > In other words, I was hoping to do something like this:
> >
> > form.add(new SimpleAttributeModifier("action",
> > SearchResultsPage.class));
> >
> > Thanks,
> > Daniel
> >
> >
> > -
> > 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 prevent a page from being marked as dirty ?

2013-06-21 Thread grazia
The problem seems kind of resolved by using
AjaxFormComponentUpdatingBehavior.
However for the timepicker.add(new
AjaxFormComponentUpdatingBehavior("onblur") does not work if the user is
selecting time using the slider ... Darn !!


On Fri, Jun 21, 2013 at 2:43 PM, grazia [via Apache Wicket] <
ml-node+s1842946n465968...@n4.nabble.com> wrote:

> LOL !
>
> That example was my starting point ... where did I get lost ?!
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659681.html
>  To unsubscribe from How to prevent a page from being marked as dirty ?, click
> here
> .
> NAML
>




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659692.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Javascript confirm with condition before submit

2013-06-21 Thread Marios Skounakis
Here is the basic solution. I believe you can expand on this.

public class ServerSideConfirmationExamplePage extends WebPage {

Person person; // needs to be serializable

public ServerSideConfirmationExamplePage() {
this(new Person());
}

public ServerSideConfirmationExamplePage(Person p) {
person = p;
Form form = new Form("form",
new CompoundPropertyModel(person));
add(form);
form.add(new TextField("firstName", String.class)
.setRequired(true));
form.add(new TextField("lastName", String.class)
.setRequired(true));

final AbstractDefaultAjaxBehavior commitBehavior = new
AbstractDefaultAjaxBehavior() {

@Override
protected void respond(AjaxRequestTarget target) {
// user has confirmed (see below onSubmit)
try {
// here we would update the database, e.g.
// personManager.update(person);
target.appendJavaScript("alert('Person "
+ person.getFirstName() + " "
+ person.getLastName() + " saved!');");
// or perhaps, setResponsePage(...)
} catch (Exception e) {
// show exception message here
// perhaps
// form.error("Unexpected error");
// or target.appendJavascript("alert('unexpected
error');");
}
}
};
add(commitBehavior);

form.add(new AjaxButton("submit") {
@Override
public void onSubmit(AjaxRequestTarget target, Form frm) {
// validations have run and person has been updated with
the user's input
// we show the confirmation now
// and call the commitBehavior's callback script upon user
confirmation
target.appendJavaScript("if (confirm('are you sure you want
to save "
+ person.getFirstName()
+ " "
+ person.getLastName()
+ "?')) {" + commitBehavior.getCallbackScript() +
"}");
}
});
}
}


On Sat, Jun 22, 2013 at 12:55 AM, grignette  wrote:

> I like your solution with 3 issues :
>
> /Usually I override onSubmit (either on the form or the ajax button) and
> return the confirmation there. If the user confirms, I follow up with
> another ajax call which actually commits the data./
>
> If you can give me more details, i will be verry happy !
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672p4659688.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Javascript confirm with condition before submit

2013-06-21 Thread grignette
I like your solution with 3 issues :

/Usually I override onSubmit (either on the form or the ajax button) and
return the confirmation there. If the user confirms, I follow up with
another ajax call which actually commits the data./

If you can give me more details, i will be verry happy ! 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672p4659688.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Javascript confirm with condition before submit

2013-06-21 Thread Marios Skounakis
Also this approach assumes that your form is not using a
LoadableDetachableModel but it's using a serializable domain object which
can be used to store the data the user posted via the form between the
first ajax call (submit) and the second ajax call (confirmation) which
needs to save them to the db.

Perhaps if you use an AjaxFormSubmitBehavior instead of an
AbstractDefaultAjaxBehavior you can repost the form data after user
confirmation and avoid the need to store them in a serializable domain
object. I haven't tried this.


On Sat, Jun 22, 2013 at 12:46 AM, Marios Skounakis  wrote:

> I personally like server side confirmations because they can be customized
> based on the submitted data and you can use the model to customize the
> confirmation. If you do it client side you need to do it in javascript and
> using the component's values which is in my opinion ugly.
>
> Usually I override onSubmit (either on the form or the ajax button) and
> return the confirmation there. If the user confirms, I follow up with
> another ajax call which actually commits the data.
>
> This method has the following issues which you must take into
> consideration:
> 1. Because the confirmation is shown onSubmit, all validations happen
> before the confirmation. If a component is invalid, processing stops before
> the confirmation is shown. Also the form model has been updated. This may
> or may not be a problem. If you are in a regular database app, this is okay
> as long as your don't actually update the database.
> 2. Triggering a second ajax call after the user confirms is a bit tricky.
> You need to add an AbstractDefaultAjaxBehavior to the page and call it's
> getCallbackScript() if the user confirms. Then do the actual commit (e.g.
> store to the db) in it's respond() method.
> 3. Also this approach requires an extra ajax call to actually commit the
> form.
>
> I sometimes do confirmations using wicket's ModalWindow (or my own
> alternative JQuery-based implementation). This allows me to have a
> consistent presentation for all modal dialogs, be it confirmation,
> information or input dialogs. Also, using a ModalWindow allows for easier
> implementation of issue (2) above as instead of using an
> AbstractDefaultAjaxBehavior you can use the ModalWindow's CloseCallback to
> do the actual commit.
>
> There are other ways to do (2) above, such as having an extra ajax
> button/link that you trigger by javascript if the user confirms and use
> it's onSubmit method to actually commit the form.
>
> The above is a rather condensed version of what you need to do, let me
> know if you are interested and I can provide more details.
>
>
> On Sat, Jun 22, 2013 at 12:06 AM, grignette wrote:
>
>> Thanks for your answer.
>>
>> I'am sorry but I don't like the first solution. The second is better I
>> think
>> but I have 6 or 7 rules to implement like that. So it can be difficult.
>>
>> Someone have an other idea ? If no, I will try to implement the second
>> solution...
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672p4659682.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: Point Form action to Page

2013-06-21 Thread Paul Bors
class SearchPanel ... {
  ...
  add("id", new SomeButtonSubmitLinkOrForm {
@Override
  public void onSubmit() {
 // your biz logic
 PageParameter pageParameter = new PageParameters();
 pageParameters.add("searchFilter", mySearchFilter);
 setResponsePage(SearchResultsPage.class, pageParameter);
  }
  });
  ...
}
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/request/m
apper/parameter/PageParameters.html#PageParameters%28%29

On a second though it might be even simpler not to use PageParameters (since
you might have too many filter form fields) but to add another constructor
to your SearchResultsPage that takes an instance to your SearchFilter POJO
and filters itself accordingly. I normally reuse my DAO mapped POJOs.

class SearchPanel ... {
  ...
  add("id", new SomeButtonSubmitLinkOrForm {
@Override
  public void onSubmit() {
 // your biz logic creates an instance of mySearchFilter that
encapsulates your search parameters
 setResponsePage(new SearchResultsPage(mySearchFilter)); // create
this constructor and filter the page by it
  }
  });
  ...
}

~ Thank you,
  Paul Bors

-Original Message-
From: Daniel Watrous [mailto:dwmaill...@gmail.com] 
Sent: Friday, June 21, 2013 5:40 PM
To: users@wicket.apache.org
Subject: Re: Point Form action to Page

Within my SearchPanel onSubmit, how do I get the PageParameters to make that
call to setResponsePage? I hope I'm understanding you right.


On Fri, Jun 21, 2013 at 3:30 PM, Paul Bors  wrote:

> There is a good reason why Wicket is not letting you override a form's 
> action attribute. Is at the core of its processing.
>
> If I understand you right you have a panel that processes a search 
> form and you would like to respond with SearchResultsPage.
>
> Wicket's way of doing that would be to use PageParameters. Add a 
> constructor to your SearchResultsPage that takes in an instance of 
> PageParameters and then pass your search parameters through it via 
> setResponsePage(new SearchResultsPage(mySearchPageParameters).
>
> If I didn't understand you right, then try to better explain your 
> use-case
> :)
>
> You might also be interested in the
> o.a.wicket.extensions.markup.html.repeater.data.table.filter package 
> :)
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: Daniel Watrous [mailto:dwmaill...@gmail.com]
> Sent: Friday, June 21, 2013 5:13 PM
> To: users@wicket.apache.org
> Subject: Point Form action to Page
>
> Hi,
>
> I have created a Panel that contains a search form. I can't figure out 
> how to get the "action" of the Form to submit to the search results 
> page. Any ideas?
>
> In other words, I was hoping to do something like this:
>
> form.add(new SimpleAttributeModifier("action", 
> SearchResultsPage.class));
>
> Thanks,
> Daniel
>
>
> -
> 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 confirm with condition before submit

2013-06-21 Thread Marios Skounakis
I personally like server side confirmations because they can be customized
based on the submitted data and you can use the model to customize the
confirmation. If you do it client side you need to do it in javascript and
using the component's values which is in my opinion ugly.

Usually I override onSubmit (either on the form or the ajax button) and
return the confirmation there. If the user confirms, I follow up with
another ajax call which actually commits the data.

This method has the following issues which you must take into consideration:
1. Because the confirmation is shown onSubmit, all validations happen
before the confirmation. If a component is invalid, processing stops before
the confirmation is shown. Also the form model has been updated. This may
or may not be a problem. If you are in a regular database app, this is okay
as long as your don't actually update the database.
2. Triggering a second ajax call after the user confirms is a bit tricky.
You need to add an AbstractDefaultAjaxBehavior to the page and call it's
getCallbackScript() if the user confirms. Then do the actual commit (e.g.
store to the db) in it's respond() method.
3. Also this approach requires an extra ajax call to actually commit the
form.

I sometimes do confirmations using wicket's ModalWindow (or my own
alternative JQuery-based implementation). This allows me to have a
consistent presentation for all modal dialogs, be it confirmation,
information or input dialogs. Also, using a ModalWindow allows for easier
implementation of issue (2) above as instead of using an
AbstractDefaultAjaxBehavior you can use the ModalWindow's CloseCallback to
do the actual commit.

There are other ways to do (2) above, such as having an extra ajax
button/link that you trigger by javascript if the user confirms and use
it's onSubmit method to actually commit the form.

The above is a rather condensed version of what you need to do, let me know
if you are interested and I can provide more details.


On Sat, Jun 22, 2013 at 12:06 AM, grignette  wrote:

> Thanks for your answer.
>
> I'am sorry but I don't like the first solution. The second is better I
> think
> but I have 6 or 7 rules to implement like that. So it can be difficult.
>
> Someone have an other idea ? If no, I will try to implement the second
> solution...
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672p4659682.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: Point Form action to Page

2013-06-21 Thread Daniel Watrous
Within my SearchPanel onSubmit, how do I get the PageParameters to make
that call to setResponsePage? I hope I'm understanding you right.


On Fri, Jun 21, 2013 at 3:30 PM, Paul Bors  wrote:

> There is a good reason why Wicket is not letting you override a form's
> action attribute. Is at the core of its processing.
>
> If I understand you right you have a panel that processes a search form and
> you would like to respond with SearchResultsPage.
>
> Wicket's way of doing that would be to use PageParameters. Add a
> constructor
> to your SearchResultsPage that takes in an instance of PageParameters and
> then pass your search parameters through it via setResponsePage(new
> SearchResultsPage(mySearchPageParameters).
>
> If I didn't understand you right, then try to better explain your use-case
> :)
>
> You might also be interested in the
> o.a.wicket.extensions.markup.html.repeater.data.table.filter package :)
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: Daniel Watrous [mailto:dwmaill...@gmail.com]
> Sent: Friday, June 21, 2013 5:13 PM
> To: users@wicket.apache.org
> Subject: Point Form action to Page
>
> Hi,
>
> I have created a Panel that contains a search form. I can't figure out how
> to get the "action" of the Form to submit to the search results page. Any
> ideas?
>
> In other words, I was hoping to do something like this:
>
> form.add(new SimpleAttributeModifier("action", SearchResultsPage.class));
>
> Thanks,
> Daniel
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


RE: Point Form action to Page

2013-06-21 Thread Paul Bors
There is a good reason why Wicket is not letting you override a form's
action attribute. Is at the core of its processing.

If I understand you right you have a panel that processes a search form and
you would like to respond with SearchResultsPage.

Wicket's way of doing that would be to use PageParameters. Add a constructor
to your SearchResultsPage that takes in an instance of PageParameters and
then pass your search parameters through it via setResponsePage(new
SearchResultsPage(mySearchPageParameters).

If I didn't understand you right, then try to better explain your use-case
:)

You might also be interested in the
o.a.wicket.extensions.markup.html.repeater.data.table.filter package :)

~ Thank you,
  Paul Bors

-Original Message-
From: Daniel Watrous [mailto:dwmaill...@gmail.com] 
Sent: Friday, June 21, 2013 5:13 PM
To: users@wicket.apache.org
Subject: Point Form action to Page

Hi,

I have created a Panel that contains a search form. I can't figure out how
to get the "action" of the Form to submit to the search results page. Any
ideas?

In other words, I was hoping to do something like this:

form.add(new SimpleAttributeModifier("action", SearchResultsPage.class));

Thanks,
Daniel


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



Point Form action to Page

2013-06-21 Thread Daniel Watrous
Hi,

I have created a Panel that contains a search form. I can't figure out how
to get the "action" of the Form to submit to the search results page. Any
ideas?

In other words, I was hoping to do something like this:

form.add(new SimpleAttributeModifier("action", SearchResultsPage.class));

Thanks,
Daniel


Re: Javascript confirm with condition before submit

2013-06-21 Thread grignette
Thanks for your answer.

I'am sorry but I don't like the first solution. The second is better I think
but I have 6 or 7 rules to implement like that. So it can be difficult. 

Someone have an other idea ? If no, I will try to implement the second
solution...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672p4659682.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: How to prevent a page from being marked as dirty ?

2013-06-21 Thread grazia
LOL !

That example was my starting point ... where did I get lost ?!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659681.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: How to prevent a page from being marked as dirty ?

2013-06-21 Thread Paul Bors
Before you kill yourself, did you take a look at the examples?
http://www.wicket-library.com/wicket-examples/ajax/tree/table/editable

~ Thank you,
  Paul Bors

-Original Message-
From: grazia [mailto:grazia.russolass...@gmail.com] 
Sent: Friday, June 21, 2013 1:23 PM
To: users@wicket.apache.org
Subject: Re: How to prevent a page from being marked as dirty ?

Upon further analysis, the Page gets dirty when any of its components'
models are updated, it is doing what it is supposed to do. Can't eliminate
that
;-))

THere is something that gets out of synch with the ajax request. Below I
pasted teh code I used on a per row basis to update the tree. Anyone sees
something wrong ? I hope yes !

 saveButton.add(new AjaxFormSubmitBehavior("onclick") {

@Override
protected void onSubmit(final AjaxRequestTarget target) {
final DefaultMutableTreeNode node =
((DefaultMutableTreeNode) inputModel.getTarget());
final MyDto dto = (MyDto) node.getUserObject();
 
schedulingManager.save(dto.getTrainingClass());  
 
treeProvider.get()
.modelChanging();

node.setUserObject(new MyDto(schedulingManager.get the
record you just saved... )));

final DefaultTreeModel model =
(DefaultTreeModel) ((WicketTreeModel)
treeProvider.get()
 
.getModel()).getObject();
model.nodeChanged(node);

treeProvider.get()
.modelChanged();

target.addChildren(treeProvider.get(), node.getClass());
treeProvider.get()
.updateTree(target);

  

}





--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-
marked-as-dirty-tp4659636p4659679.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 prevent a page from being marked as dirty ?

2013-06-21 Thread grazia
Upon further analysis, the Page gets dirty when any of its components' models
are updated, it is doing what it is supposed to do. Can't eliminate that
;-))

THere is something that gets out of synch with the ajax request. Below I
pasted teh code I used on a per row basis to update the tree. Anyone sees
something wrong ? I hope yes !

 saveButton.add(new AjaxFormSubmitBehavior("onclick") {

@Override
protected void onSubmit(final AjaxRequestTarget target) {
final DefaultMutableTreeNode node =
((DefaultMutableTreeNode) inputModel.getTarget());
final MyDto dto = (MyDto) node.getUserObject();
 
schedulingManager.save(dto.getTrainingClass());  
 
treeProvider.get()
.modelChanging();

node.setUserObject(new MyDto(schedulingManager.get the
record you just saved... )));

final DefaultTreeModel model =
(DefaultTreeModel) ((WicketTreeModel)
treeProvider.get()
 
.getModel()).getObject();
model.nodeChanged(node);

treeProvider.get()
.modelChanged();

target.addChildren(treeProvider.get(), node.getClass());
treeProvider.get()
.updateTree(target);

  

}





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659679.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: DataTable and unserializable data

2013-06-21 Thread Baptiste75
A thousand thanks, Sebastian!
Your sample did it! 

Juste a last question, out of curiosity (if you have a clue):
Did this exception occur because DataTable, after retrieving the user
objects from the provider,  *stores* them somewhere in an inner component?
And so when the Page is serialized, the DataTable is too, and my objects
Contact as well?
Because then I am wondering the point for a DataTable to memorize the user
data... I would expect it to iterate on them, display, and then get rid of
them, transiently...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DataTable-and-unserializable-data-tp4659659p4659678.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Javascript confirm with condition before submit

2013-06-21 Thread Bertrand Guay-Paquet

Hi!

Are you on Wicket 6? If so, here's how I do my confirmation popup for an 
ajaxlink (should work for ajaxbutton too):


@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
String confirmJs = "if (!confirm('Please confirm')) return false;"
AjaxCallListener listener = new AjaxCallListener();
listener.onPrecondition(confirmJs);
attributes.getAjaxCallListeners().add(listener);
}

Of course, in your case, you need to write more complicated javascript 
to read form values and such. This solution all happens client-side.


You could also do it more server side by preventing default form submit 
behavior for the ajaxbutton. When the user clicks the button, you show a 
panel via ajax which asks for confirmation and that second button really 
sends the form.


Personally, I think I'd go for the first option but it depends on your 
requirements.


Bertrand



On 21/06/2013 11:36 AM, grignette wrote:

Hi !

I have an issue with a confirm Javascript message. I have a form. When the
user fills the form and  when he tries to submit (AjaxButton), I want to
provide confirm message based on the details filled by user. So the confrm
message may or maynot be present always

I tried to use method getOnClickScript of the Ajax Button. The code in the
getOnClickScript is translate in javascript by wicket on the onload of the
page. So my condition IF is always wrong, because the form is not completed
by the user yet.

I tried to add my condition just before my update, in the submit method with
this :

/target.appendJavaScript("confirm('"+getString("messageConfirm") + "')");/

The message is display just after the update... So to late !

Do you have any idea how I can display this confirm message ?

Thanks for your attention

Gaëlle





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672.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



AjaxSubmitLink Errors

2013-06-21 Thread Richard W. Adams
When AjaxSubmitLink.onError() is called, how does one determine what the 
error was? Calling getFeedbackMessage() (tried on both the link & on the 
form)  is returning null, & I can't see any other way to determine what 
the error was...

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


A Wicket in Ruby

2013-06-21 Thread Mike Pence
So I have this crazy idea to try to write some subset of Wicket using CRuby
and the variety of technologies it employs (EventMachine, etc.)

Hard to know where to start though, or how best to form a mental model of
what Wicket does vs. doing a straight class-to-class conversion. Maybe
there is a test suite in the wicket source I should consider. Of course,
there is nothing like stepping through the code to understand the lifecyle
of a wicket request (and to see how it persists session data, especially).

Am I crazy?


Re: Setting up custom 404 page causes Issues

2013-06-21 Thread Arjun Dhar
ok I managed to get some hints from my browser.
So Certain URL's rendered as http:///null would cause 404 .. but the
progressBar / Ajax related issue
was caused due to something like this:

Not really in my hands .. so am just switching back to a simple HTML 404
rather than a dynamic one.
I dont want to get into the whole business of filtering through the kind of
404 or origin of 404 nonsense.

..though if someone has any ideas , please am all ears.
thank you.



-
Software documentation is like sex: when it is good, it is very, very good; and 
when it is bad, it is still better than nothing!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-up-custom-404-page-causes-Issues-tp4659671p4659674.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: Set the Null option manually in a NullValid Dropdown

2013-06-21 Thread Paul Bors
As per the JavaDoc:

AbstractSingleSelectChoice
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.setNullValid(b
oolean nullValid)

Determines whether or not the null value should be included in the list of
choices when the field's model value is nonnull, and whether or not the
null_valid string property (e.g. "Choose One") should be displayed until a
nonnull value is selected. 

If set to false, then "Choose One" will be displayed when the value is null.
After a value is selected, and that change is propagated to the underlying
model, the user will no longer see the "Choose One" option, and there will
be no way to reselect null as the value.

If set to true, the null string property (the empty string, by default) will
always be displayed as an option, whether or not a nonnull value has ever
been selected. Note that this setting has no effect on validation; in order
to guarantee that a value will be specified on form validation,
setRequired(boolean).

This is because even if setNullValid() is called with false, the user can
fail to provide a value simply by never activating (i.e. clicking on) the
component.

If I'm not mistaken your code should looks something like this:

// Instruct Wicket to always display the null value in your select
dropDownChoice.setNullValid(true);
// We want the user to select null so this is no longer a required field
dropDownChoice.setRequired(false);

If you want to change the label this null is mapped to from "Choose One" to
something else:
dropDownChoice = new DropDownChoice(LabeledFormField.FIELD_ID, model,
choices) {
@Override
protected String getNullValidKey() {
return "Your.Own.Language.Pack.Key";
}
};

~ Thank you,
  Paul Bors

-Original Message-
From: eugenebalt [mailto:eugeneb...@yahoo.com] 
Sent: Friday, June 21, 2013 11:09 AM
To: users@wicket.apache.org
Subject: Set the Null option manually in a NullValid Dropdown

We have a dropdown which supports the NullValid property.

If we need to set its selection to Null manually, setModel(null) does not
seem to work. Should we set it to the first element of the backing model
(which is an KeyValueBean list)?



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Set-the-Null-option-manually-in-a
-NullValid-Dropdown-tp4659670.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



Javascript confirm with condition before submit

2013-06-21 Thread grignette
Hi !

I have an issue with a confirm Javascript message. I have a form. When the
user fills the form and  when he tries to submit (AjaxButton), I want to
provide confirm message based on the details filled by user. So the confrm
message may or maynot be present always

I tried to use method getOnClickScript of the Ajax Button. The code in the
getOnClickScript is translate in javascript by wicket on the onload of the
page. So my condition IF is always wrong, because the form is not completed
by the user yet.

I tried to add my condition just before my update, in the submit method with
this :

/target.appendJavaScript("confirm('"+getString("messageConfirm") + "')");/

The message is display just after the update... So to late !

Do you have any idea how I can display this confirm message ?

Thanks for your attention 

Gaëlle





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672.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



Setting up custom 404 page causes Issues

2013-06-21 Thread Arjun Dhar
Im facing a strange problem

I have a, Ajax  based Progress bar. Everything worked great.
Then in web.xml using ERROR on the Wicket Filter I
configured it to a mounted page 
(org.apache.wicket.request.target.coding.QueryStringUrlCodingStrategy). 

404 got prettier, but the progress bar stopped working. I found out that in
trying to render the 404 page it was causing issues.

My concern is whats the possible cause of the 404. Im unable to trap it from
the browser. WICKET-AJAX-DEBUG shows the prohress bar infinitely polling the
server but i dont see any 404 responses there. Maybe im missing it but so
far not seen any.

Anyway if anyone has any clue or ideas , let me know

thanks



-
Software documentation is like sex: when it is good, it is very, very good; and 
when it is bad, it is still better than nothing!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-up-custom-404-page-causes-Issues-tp4659671.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



Set the Null option manually in a NullValid Dropdown

2013-06-21 Thread eugenebalt
We have a dropdown which supports the NullValid property.

If we need to set its selection to Null manually, setModel(null) does not
seem to work. Should we set it to the first element of the backing model
(which is an KeyValueBean list)?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Set-the-Null-option-manually-in-a-NullValid-Dropdown-tp4659670.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: DataTable and unserializable data

2013-06-21 Thread Bas Gooren

Hi,

In your example, the loadableDetachableModel (LDM) doesn't help.
It references the final object passed in to the model() method, which 
means the contact object is serialized.


The point of using LDMs is that they only store a reference (e.g. an ID) 
of an object, and can re-create or lookup the actual object based on 
that reference.


E.g.:

ContactModel extends LDM {
 private long contactId;

 ContactModel(Contact contact) {
  setObject(contact);
 }

 setObject(Contact contact) {
  super.setObject(contact);

  this.contactId = contact != null ? contact.getId() : null;
 }

 load() {
  return this.contactId != null ? new ContactDao().find(contactId) : null;
 }
}

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 21-6-2013 12:16, schreef Baptiste75:

Is it possible to use an implementation of DataTable (like
AjaxFallbackDefaultDataTable) with unserializable data?
My page throws the usual NotSerializableException, in spite of using
LoadableDetachableModel everywhere I can.
I am tearing my hair out to understand where the problem comes from. Can
someone please help?
Thanks.

I want to precise that I use a LoadableDetachableModel in the method model()
of my DataProvider:
@Override
public IModel model(final Contact object) {
return new LoadableDetachableModel() {
@Override
protected Contact load() {
return object;
}
};
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DataTable-and-unserializable-data-tp4659659.html
Sent from the Users forum mailing list archive at Nabble.com.

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





Re: How to prevent a page from being marked as dirty ?

2013-06-21 Thread grazia
No, freezing the page id does not remove the problem. 

I need to find a way either to stop the page reload or I have to do without
the ajax part ... the two seem in conflict ...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659668.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to prevent a page from being marked as dirty ?

2013-06-21 Thread grazia
I should have explained before. 

The context is: I have a WebPage that contains a Form with a TreeTable.
Each row of the TreeTable has a cell with a TimePicker ( extends TextField
implements IWiQueryPlugin), and a submit button at the end of the row with
an AjaxFormSubmitBehavior to save the user choices and refresh the row that
has been changed.
Now, when the user selects a time in the TimePicker cell, and its model get
set, the Page gets marked as dirty and reloaded. If the page is reloaded
before the Ajax response is sent, then the Ajax response will not be able to
refresh the row that was edited. 

I am trying to setFreezePageId, where and how is the best way to use it ?
Maybe in the onBeforeRender of the Page ? Any other idea ?






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659667.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 form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
Martin,

Thank you for your replies. You are right that using
MultipartServletWebRequestImpl you can set the max size and handle the
error.

Cheers
Marios


On Fri, Jun 21, 2013 at 2:09 PM, Martin Grigorov wrote:

> On Fri, Jun 21, 2013 at 12:29 PM, Marios Skounakis 
> wrote:
>
> > Looking at tomcat sources it seems tomcat does not throw an exception bug
> > simply logs a debug message!
> >
> > Regarding wicket now, setting Form#setMaxSize seems to have no effect
> > unless there is a file upload involved. My case has just lots of
> textareas
> > with lots of text content... Can you please confirm this?
> >
>
> Hm, yes and no.
> By default ServletWebRequest is used in WebApplication#newWebRequest().
> When there is FileUpload (multi part data) Wicket automatically switches to
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl (see
>
> org.apache.wicket.protocol.http.servlet.ServletWebRequest#newMultipartWebRequest).
> This request impl
> uses
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl.CountingInputStream
> to count *all* bytes. So it should work. Just setup MSWRI to be the default
> instead of SWR.
>
>
> >
> > So it seems there is no way to detect if the user has exceeded the max
> post
> > size. If they do, you get empty post data...
> >
> > I have considered a workaround: use a hidden field with a preset value,
> on
> > postback check that the post parameters include this preset value, throw
> > exception otherwise. What do you think?
> >
> >
> >
> > On Fri, Jun 21, 2013 at 12:48 PM, Martin Grigorov  > >wrote:
> >
> > > On Fri, Jun 21, 2013 at 11:44 AM, Marios Skounakis 
> > > wrote:
> > >
> > > > Actually I want to read the whole input, and increasing tomcat
> > > maxPostSize
> > > > is the solution.
> > > >
> > > > But I was puzzled by the fact that I got no exception and instead I
> got
> > > > this weird behavior. Is there something that wicket does that keeps
> > > tomcat
> > > > from throwing the exception?
> > > >
> > >
> > > No. As you see Wicket just tries to read the parameters map and it is
> > > empty.
> > > I guess there is Tomcat property that switches its behavior when
> reading
> > > huge POST data.
> > >
> > >
> > > >
> > > >
> > > >
> > > >
> > > > On Fri, Jun 21, 2013 at 12:32 PM, Martin Grigorov <
> > mgrigo...@apache.org
> > > > >wrote:
> > > >
> > > > > You can use Wicket API to set the maxSize -
> > > > > org.apache.wicket.markup.html.form.Form#setMaxSize
> > > > > This way Tomcat will read the whole input and Wicket will report
> the
> > > > error.
> > > > >
> > > > > But maybe reading the whole input is what you try to avoid.
> > > > >
> > > > >
> > > > > On Fri, Jun 21, 2013 at 11:24 AM, Marios Skounakis <
> msc...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Some more info after further investigation:
> > > > > >
> > > > > > The problem is definitely related to tomcat maxPostSize
> parameter.
> > I
> > > > have
> > > > > > set this to a very small value (100) and the problem is occurring
> > > even
> > > > in
> > > > > > very small regular (non ajax) form posts.
> > > > > >
> > > > > > Debugging this I found that
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters
> > > > > >
> > > > > > calls
> > > > > > Map params =
> > > getContainerRequest().getParameterMap();
> > > > > > and gets a blank params map.
> > > > > >
> > > > > > This explains the fact that the form is normally processed and
> > > rendered
> > > > > > with null component values.
> > > > > >
> > > > > > I am not sure how I can investigate this further.
> > > getContainerRequest()
> > > > > is
> > > > > > a tomcat RequestFacade object so this is where I stopped tracing
> > the
> > > > > > execution. Perhaps it's a tomcat bug. I'll go ahead and try with
> > > > > different
> > > > > > tomcat versions.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov <
> > > > mgrigo...@apache.org
> > > > > > >wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis <
> > > msc...@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hi all,
> > > > > > > >
> > > > > > > > I have the following problem:
> > > > > > > > - User submits form with lots of textareas via ajax
> > > > > > > > - User gets a blank page
> > > > > > > >
> > > > > > > > I think (but I'm not quite sure yet) this happens when the
> > > > textareas
> > > > > > > > contain so much text that either maxPostSize or
> > connectionTimeout
> > > > > > (submit
> > > > > > > > tries to store to db as well) are exceeded.
> > > > > > > >
> > > > > > > > The weird thing is that there is no exception. The form comes
> > > back
> > > > > > after
> > > > > > > > the ajax request with blank components.
> > > > > > > >
> > > > > > >
> > > > > > > So is it a blank page or just form elements wi

Re: Broken Link in Tomcat because of Page Mount

2013-06-21 Thread Martin Grigorov
Hi,

Please file a ticket.
I don't have time to debug it now and we may forget it without a ticket.
Thanks!


On Fri, Jun 21, 2013 at 1:11 PM, Martin Wischnewski <
martin.wischnew...@web.de> wrote:

> Following situation:
>
> -I have a Wicket Application(6.8.0) which runs under the context "webapp"
> on
> a Tomcat 7.0.41
> -I mount a Page with two parameters (this is important) in the
> WicketApplication.
> mountPage("/mount/${parameter1}/${parameter2}", MountedPage.class);
> -The mounted Page(MountedPage.class) has only a simple Link
> -There are two links on the HomePage to the mounted Page.
>  They are declared as follows:
>
> add(new Link("link") {
> @Override
> public void onClick() {
> setResponsePage(MountedPage.class,
> linkParameters);
> }
> });
>
> add(new Link("brokenLink") {
> @Override
> public void onClick() {
> setResponsePage(new
> MountedPage(linkParameters));
> }
> });
>
> I deploy this Application as a war file on a Tomcat under the context
> "webapp".
> When I call the first Link on the HomePage and then the Link on the mounted
> Page, everything works fine.
>
> But if I call the second Link and then the Link on the mounted Page, the
> link is broken.
> The context is missing in the generated link
> http://localhost:8080/wicket/bookmarkable/com.mycompany.LinkedPage
>
> Does anyone have an idea, why the second link does not work on Tomcat?
>
> I add a Quickstart and the war file as attachment.
>
> Ps: Both links works fine in Jetty.
> Pss:If I remove the mount command, both links will work in  Tomcat too.
>
> quickstart.zip
> 
> webapp.war
> 
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Broken-Link-in-Tomcat-because-of-Page-Mount-tp4659663.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
>
>


Broken Link in Tomcat because of Page Mount

2013-06-21 Thread Martin Wischnewski
Following situation:

-I have a Wicket Application(6.8.0) which runs under the context "webapp" on
a Tomcat 7.0.41
-I mount a Page with two parameters (this is important) in the
WicketApplication.
mountPage("/mount/${parameter1}/${parameter2}", MountedPage.class);
-The mounted Page(MountedPage.class) has only a simple Link
-There are two links on the HomePage to the mounted Page.
 They are declared as follows:
 
add(new Link("link") {
@Override
public void onClick() {
setResponsePage(MountedPage.class, 
linkParameters);
}
});

add(new Link("brokenLink") {
@Override
public void onClick() {
setResponsePage(new 
MountedPage(linkParameters));
}
});

I deploy this Application as a war file on a Tomcat under the context
"webapp".
When I call the first Link on the HomePage and then the Link on the mounted
Page, everything works fine.

But if I call the second Link and then the Link on the mounted Page, the
link is broken.
The context is missing in the generated link
http://localhost:8080/wicket/bookmarkable/com.mycompany.LinkedPage

Does anyone have an idea, why the second link does not work on Tomcat?

I add a Quickstart and the war file as attachment.

Ps: Both links works fine in Jetty. 
Pss:If I remove the mount command, both links will work in  Tomcat too.

quickstart.zip
  
webapp.war
  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Broken-Link-in-Tomcat-because-of-Page-Mount-tp4659663.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: DataTable and unserializable data

2013-06-21 Thread Martin Grigorov
Hi,

When NotSerializableException is thrown its message pinpoints the
problematic field.
Show us the exception message.

On Fri, Jun 21, 2013 at 12:16 PM, Baptiste75  wrote:

> Is it possible to use an implementation of DataTable (like
> AjaxFallbackDefaultDataTable) with unserializable data?
> My page throws the usual NotSerializableException, in spite of using
> LoadableDetachableModel everywhere I can.
> I am tearing my hair out to understand where the problem comes from. Can
> someone please help?
> Thanks.
>
> I want to precise that I use a LoadableDetachableModel in the method
> model()
> of my DataProvider:
> @Override
> public IModel model(final Contact object) {
> return new LoadableDetachableModel() {
> @Override
> protected Contact load() {
> return object;
> }
> };
> }
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DataTable-and-unserializable-data-tp4659659.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 form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Martin Grigorov
On Fri, Jun 21, 2013 at 12:29 PM, Marios Skounakis  wrote:

> Looking at tomcat sources it seems tomcat does not throw an exception bug
> simply logs a debug message!
>
> Regarding wicket now, setting Form#setMaxSize seems to have no effect
> unless there is a file upload involved. My case has just lots of textareas
> with lots of text content... Can you please confirm this?
>

Hm, yes and no.
By default ServletWebRequest is used in WebApplication#newWebRequest().
When there is FileUpload (multi part data) Wicket automatically switches to
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl (see
org.apache.wicket.protocol.http.servlet.ServletWebRequest#newMultipartWebRequest).
This request impl
uses 
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl.CountingInputStream
to count *all* bytes. So it should work. Just setup MSWRI to be the default
instead of SWR.


>
> So it seems there is no way to detect if the user has exceeded the max post
> size. If they do, you get empty post data...
>
> I have considered a workaround: use a hidden field with a preset value, on
> postback check that the post parameters include this preset value, throw
> exception otherwise. What do you think?
>
>
>
> On Fri, Jun 21, 2013 at 12:48 PM, Martin Grigorov  >wrote:
>
> > On Fri, Jun 21, 2013 at 11:44 AM, Marios Skounakis 
> > wrote:
> >
> > > Actually I want to read the whole input, and increasing tomcat
> > maxPostSize
> > > is the solution.
> > >
> > > But I was puzzled by the fact that I got no exception and instead I got
> > > this weird behavior. Is there something that wicket does that keeps
> > tomcat
> > > from throwing the exception?
> > >
> >
> > No. As you see Wicket just tries to read the parameters map and it is
> > empty.
> > I guess there is Tomcat property that switches its behavior when reading
> > huge POST data.
> >
> >
> > >
> > >
> > >
> > >
> > > On Fri, Jun 21, 2013 at 12:32 PM, Martin Grigorov <
> mgrigo...@apache.org
> > > >wrote:
> > >
> > > > You can use Wicket API to set the maxSize -
> > > > org.apache.wicket.markup.html.form.Form#setMaxSize
> > > > This way Tomcat will read the whole input and Wicket will report the
> > > error.
> > > >
> > > > But maybe reading the whole input is what you try to avoid.
> > > >
> > > >
> > > > On Fri, Jun 21, 2013 at 11:24 AM, Marios Skounakis  >
> > > > wrote:
> > > >
> > > > > Some more info after further investigation:
> > > > >
> > > > > The problem is definitely related to tomcat maxPostSize parameter.
> I
> > > have
> > > > > set this to a very small value (100) and the problem is occurring
> > even
> > > in
> > > > > very small regular (non ajax) form posts.
> > > > >
> > > > > Debugging this I found that
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters
> > > > >
> > > > > calls
> > > > > Map params =
> > getContainerRequest().getParameterMap();
> > > > > and gets a blank params map.
> > > > >
> > > > > This explains the fact that the form is normally processed and
> > rendered
> > > > > with null component values.
> > > > >
> > > > > I am not sure how I can investigate this further.
> > getContainerRequest()
> > > > is
> > > > > a tomcat RequestFacade object so this is where I stopped tracing
> the
> > > > > execution. Perhaps it's a tomcat bug. I'll go ahead and try with
> > > > different
> > > > > tomcat versions.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov <
> > > mgrigo...@apache.org
> > > > > >wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > >
> > > > > > On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis <
> > msc...@gmail.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Hi all,
> > > > > > >
> > > > > > > I have the following problem:
> > > > > > > - User submits form with lots of textareas via ajax
> > > > > > > - User gets a blank page
> > > > > > >
> > > > > > > I think (but I'm not quite sure yet) this happens when the
> > > textareas
> > > > > > > contain so much text that either maxPostSize or
> connectionTimeout
> > > > > (submit
> > > > > > > tries to store to db as well) are exceeded.
> > > > > > >
> > > > > > > The weird thing is that there is no exception. The form comes
> > back
> > > > > after
> > > > > > > the ajax request with blank components.
> > > > > > >
> > > > > >
> > > > > > So is it a blank page or just form elements without values ?
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > Has anyone else seen this behavior? Why is there no exception?
> > > > > > >
> > > > > >
> > > > > > If the problem is maxSize then there must be an exception. This
> > will
> > > > lead
> > > > > > to onFailure() call executed in Ajax request.
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > Thanks
> > > > > > > Marios
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>


Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
Looking at tomcat sources it seems tomcat does not throw an exception bug
simply logs a debug message!

Regarding wicket now, setting Form#setMaxSize seems to have no effect
unless there is a file upload involved. My case has just lots of textareas
with lots of text content... Can you please confirm this?

So it seems there is no way to detect if the user has exceeded the max post
size. If they do, you get empty post data...

I have considered a workaround: use a hidden field with a preset value, on
postback check that the post parameters include this preset value, throw
exception otherwise. What do you think?



On Fri, Jun 21, 2013 at 12:48 PM, Martin Grigorov wrote:

> On Fri, Jun 21, 2013 at 11:44 AM, Marios Skounakis 
> wrote:
>
> > Actually I want to read the whole input, and increasing tomcat
> maxPostSize
> > is the solution.
> >
> > But I was puzzled by the fact that I got no exception and instead I got
> > this weird behavior. Is there something that wicket does that keeps
> tomcat
> > from throwing the exception?
> >
>
> No. As you see Wicket just tries to read the parameters map and it is
> empty.
> I guess there is Tomcat property that switches its behavior when reading
> huge POST data.
>
>
> >
> >
> >
> >
> > On Fri, Jun 21, 2013 at 12:32 PM, Martin Grigorov  > >wrote:
> >
> > > You can use Wicket API to set the maxSize -
> > > org.apache.wicket.markup.html.form.Form#setMaxSize
> > > This way Tomcat will read the whole input and Wicket will report the
> > error.
> > >
> > > But maybe reading the whole input is what you try to avoid.
> > >
> > >
> > > On Fri, Jun 21, 2013 at 11:24 AM, Marios Skounakis 
> > > wrote:
> > >
> > > > Some more info after further investigation:
> > > >
> > > > The problem is definitely related to tomcat maxPostSize parameter. I
> > have
> > > > set this to a very small value (100) and the problem is occurring
> even
> > in
> > > > very small regular (non ajax) form posts.
> > > >
> > > > Debugging this I found that
> > > >
> > > >
> > >
> >
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters
> > > >
> > > > calls
> > > > Map params =
> getContainerRequest().getParameterMap();
> > > > and gets a blank params map.
> > > >
> > > > This explains the fact that the form is normally processed and
> rendered
> > > > with null component values.
> > > >
> > > > I am not sure how I can investigate this further.
> getContainerRequest()
> > > is
> > > > a tomcat RequestFacade object so this is where I stopped tracing the
> > > > execution. Perhaps it's a tomcat bug. I'll go ahead and try with
> > > different
> > > > tomcat versions.
> > > >
> > > >
> > > >
> > > >
> > > > On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov <
> > mgrigo...@apache.org
> > > > >wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > >
> > > > > On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis <
> msc...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > I have the following problem:
> > > > > > - User submits form with lots of textareas via ajax
> > > > > > - User gets a blank page
> > > > > >
> > > > > > I think (but I'm not quite sure yet) this happens when the
> > textareas
> > > > > > contain so much text that either maxPostSize or connectionTimeout
> > > > (submit
> > > > > > tries to store to db as well) are exceeded.
> > > > > >
> > > > > > The weird thing is that there is no exception. The form comes
> back
> > > > after
> > > > > > the ajax request with blank components.
> > > > > >
> > > > >
> > > > > So is it a blank page or just form elements without values ?
> > > > >
> > > > >
> > > > > >
> > > > > > Has anyone else seen this behavior? Why is there no exception?
> > > > > >
> > > > >
> > > > > If the problem is maxSize then there must be an exception. This
> will
> > > lead
> > > > > to onFailure() call executed in Ajax request.
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks
> > > > > > Marios
> > > > > >
> > > > >
> > > >
> > >
> >
>


DataTable and unserializable data

2013-06-21 Thread Baptiste75
Is it possible to use an implementation of DataTable (like
AjaxFallbackDefaultDataTable) with unserializable data?
My page throws the usual NotSerializableException, in spite of using
LoadableDetachableModel everywhere I can.
I am tearing my hair out to understand where the problem comes from. Can
someone please help?
Thanks.

I want to precise that I use a LoadableDetachableModel in the method model()
of my DataProvider:
@Override
public IModel model(final Contact object) {
return new LoadableDetachableModel() {
@Override
protected Contact load() {
return object;
}
};
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DataTable-and-unserializable-data-tp4659659.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 form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Martin Grigorov
On Fri, Jun 21, 2013 at 11:44 AM, Marios Skounakis  wrote:

> Actually I want to read the whole input, and increasing tomcat maxPostSize
> is the solution.
>
> But I was puzzled by the fact that I got no exception and instead I got
> this weird behavior. Is there something that wicket does that keeps tomcat
> from throwing the exception?
>

No. As you see Wicket just tries to read the parameters map and it is empty.
I guess there is Tomcat property that switches its behavior when reading
huge POST data.


>
>
>
>
> On Fri, Jun 21, 2013 at 12:32 PM, Martin Grigorov  >wrote:
>
> > You can use Wicket API to set the maxSize -
> > org.apache.wicket.markup.html.form.Form#setMaxSize
> > This way Tomcat will read the whole input and Wicket will report the
> error.
> >
> > But maybe reading the whole input is what you try to avoid.
> >
> >
> > On Fri, Jun 21, 2013 at 11:24 AM, Marios Skounakis 
> > wrote:
> >
> > > Some more info after further investigation:
> > >
> > > The problem is definitely related to tomcat maxPostSize parameter. I
> have
> > > set this to a very small value (100) and the problem is occurring even
> in
> > > very small regular (non ajax) form posts.
> > >
> > > Debugging this I found that
> > >
> > >
> >
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters
> > >
> > > calls
> > > Map params = getContainerRequest().getParameterMap();
> > > and gets a blank params map.
> > >
> > > This explains the fact that the form is normally processed and rendered
> > > with null component values.
> > >
> > > I am not sure how I can investigate this further. getContainerRequest()
> > is
> > > a tomcat RequestFacade object so this is where I stopped tracing the
> > > execution. Perhaps it's a tomcat bug. I'll go ahead and try with
> > different
> > > tomcat versions.
> > >
> > >
> > >
> > >
> > > On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov <
> mgrigo...@apache.org
> > > >wrote:
> > >
> > > > Hi,
> > > >
> > > >
> > > > On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis  >
> > > > wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > I have the following problem:
> > > > > - User submits form with lots of textareas via ajax
> > > > > - User gets a blank page
> > > > >
> > > > > I think (but I'm not quite sure yet) this happens when the
> textareas
> > > > > contain so much text that either maxPostSize or connectionTimeout
> > > (submit
> > > > > tries to store to db as well) are exceeded.
> > > > >
> > > > > The weird thing is that there is no exception. The form comes back
> > > after
> > > > > the ajax request with blank components.
> > > > >
> > > >
> > > > So is it a blank page or just form elements without values ?
> > > >
> > > >
> > > > >
> > > > > Has anyone else seen this behavior? Why is there no exception?
> > > > >
> > > >
> > > > If the problem is maxSize then there must be an exception. This will
> > lead
> > > > to onFailure() call executed in Ajax request.
> > > >
> > > >
> > > > >
> > > > > Thanks
> > > > > Marios
> > > > >
> > > >
> > >
> >
>


Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
Actually I want to read the whole input, and increasing tomcat maxPostSize
is the solution.

But I was puzzled by the fact that I got no exception and instead I got
this weird behavior. Is there something that wicket does that keeps tomcat
from throwing the exception?




On Fri, Jun 21, 2013 at 12:32 PM, Martin Grigorov wrote:

> You can use Wicket API to set the maxSize -
> org.apache.wicket.markup.html.form.Form#setMaxSize
> This way Tomcat will read the whole input and Wicket will report the error.
>
> But maybe reading the whole input is what you try to avoid.
>
>
> On Fri, Jun 21, 2013 at 11:24 AM, Marios Skounakis 
> wrote:
>
> > Some more info after further investigation:
> >
> > The problem is definitely related to tomcat maxPostSize parameter. I have
> > set this to a very small value (100) and the problem is occurring even in
> > very small regular (non ajax) form posts.
> >
> > Debugging this I found that
> >
> >
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters
> >
> > calls
> > Map params = getContainerRequest().getParameterMap();
> > and gets a blank params map.
> >
> > This explains the fact that the form is normally processed and rendered
> > with null component values.
> >
> > I am not sure how I can investigate this further. getContainerRequest()
> is
> > a tomcat RequestFacade object so this is where I stopped tracing the
> > execution. Perhaps it's a tomcat bug. I'll go ahead and try with
> different
> > tomcat versions.
> >
> >
> >
> >
> > On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov  > >wrote:
> >
> > > Hi,
> > >
> > >
> > > On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis 
> > > wrote:
> > >
> > > > Hi all,
> > > >
> > > > I have the following problem:
> > > > - User submits form with lots of textareas via ajax
> > > > - User gets a blank page
> > > >
> > > > I think (but I'm not quite sure yet) this happens when the textareas
> > > > contain so much text that either maxPostSize or connectionTimeout
> > (submit
> > > > tries to store to db as well) are exceeded.
> > > >
> > > > The weird thing is that there is no exception. The form comes back
> > after
> > > > the ajax request with blank components.
> > > >
> > >
> > > So is it a blank page or just form elements without values ?
> > >
> > >
> > > >
> > > > Has anyone else seen this behavior? Why is there no exception?
> > > >
> > >
> > > If the problem is maxSize then there must be an exception. This will
> lead
> > > to onFailure() call executed in Ajax request.
> > >
> > >
> > > >
> > > > Thanks
> > > > Marios
> > > >
> > >
> >
>


Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Martin Grigorov
You can use Wicket API to set the maxSize -
org.apache.wicket.markup.html.form.Form#setMaxSize
This way Tomcat will read the whole input and Wicket will report the error.

But maybe reading the whole input is what you try to avoid.


On Fri, Jun 21, 2013 at 11:24 AM, Marios Skounakis  wrote:

> Some more info after further investigation:
>
> The problem is definitely related to tomcat maxPostSize parameter. I have
> set this to a very small value (100) and the problem is occurring even in
> very small regular (non ajax) form posts.
>
> Debugging this I found that
>
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters
>
> calls
> Map params = getContainerRequest().getParameterMap();
> and gets a blank params map.
>
> This explains the fact that the form is normally processed and rendered
> with null component values.
>
> I am not sure how I can investigate this further. getContainerRequest() is
> a tomcat RequestFacade object so this is where I stopped tracing the
> execution. Perhaps it's a tomcat bug. I'll go ahead and try with different
> tomcat versions.
>
>
>
>
> On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov  >wrote:
>
> > Hi,
> >
> >
> > On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis 
> > wrote:
> >
> > > Hi all,
> > >
> > > I have the following problem:
> > > - User submits form with lots of textareas via ajax
> > > - User gets a blank page
> > >
> > > I think (but I'm not quite sure yet) this happens when the textareas
> > > contain so much text that either maxPostSize or connectionTimeout
> (submit
> > > tries to store to db as well) are exceeded.
> > >
> > > The weird thing is that there is no exception. The form comes back
> after
> > > the ajax request with blank components.
> > >
> >
> > So is it a blank page or just form elements without values ?
> >
> >
> > >
> > > Has anyone else seen this behavior? Why is there no exception?
> > >
> >
> > If the problem is maxSize then there must be an exception. This will lead
> > to onFailure() call executed in Ajax request.
> >
> >
> > >
> > > Thanks
> > > Marios
> > >
> >
>


Re: Ajax form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Marios Skounakis
Some more info after further investigation:

The problem is definitely related to tomcat maxPostSize parameter. I have
set this to a very small value (100) and the problem is occurring even in
very small regular (non ajax) form posts.

Debugging this I found that
org.apache.wicket.protocol.http.servlet.ServletWebRequest.generatePostParameters

calls
Map params = getContainerRequest().getParameterMap();
and gets a blank params map.

This explains the fact that the form is normally processed and rendered
with null component values.

I am not sure how I can investigate this further. getContainerRequest() is
a tomcat RequestFacade object so this is where I stopped tracing the
execution. Perhaps it's a tomcat bug. I'll go ahead and try with different
tomcat versions.




On Fri, Jun 21, 2013 at 10:40 AM, Martin Grigorov wrote:

> Hi,
>
>
> On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis 
> wrote:
>
> > Hi all,
> >
> > I have the following problem:
> > - User submits form with lots of textareas via ajax
> > - User gets a blank page
> >
> > I think (but I'm not quite sure yet) this happens when the textareas
> > contain so much text that either maxPostSize or connectionTimeout (submit
> > tries to store to db as well) are exceeded.
> >
> > The weird thing is that there is no exception. The form comes back after
> > the ajax request with blank components.
> >
>
> So is it a blank page or just form elements without values ?
>
>
> >
> > Has anyone else seen this behavior? Why is there no exception?
> >
>
> If the problem is maxSize then there must be an exception. This will lead
> to onFailure() call executed in Ajax request.
>
>
> >
> > Thanks
> > Marios
> >
>


Re: Alternatives for Page.componentChanged(Component, MarkupContainer) - Wicket 6.5.0

2013-06-21 Thread Rakesh A
Hi,

Page.componentRemoved(Component) && Page.componentAdded(Component) are final
methods, I can not override them in my Page implementation.

Regards,
Rakesh.A



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Alternatives-for-Page-componentChanged-Component-MarkupContainer-Wicket-6-5-0-tp4659644p4659655.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: Alternatives for Page.componentChanged(Component, MarkupContainer) - Wicket 6.5.0

2013-06-21 Thread Martin Grigorov
On Fri, Jun 21, 2013 at 9:57 AM, Rakesh A wrote:

> Hi,
>
> May be I should've added more details to my question.
> Code recently upgraded from v1.4.21 to v6.5.0. Old implementation code we
> are using this method to do some initialization whenever a component gets
> added/removed.
>

You can use org.apache.wicket.Page#componentRemoved()
and org.apache.wicket.Page#componentAdded() instead.


>
> As this method is not being called anymore, the initialization code is not
> getting executed anymore [with v6.5.0].
>
> I am looking for alternatives for this method in new v6.5.0 api.
>
> Regards,
> Rakesh.A
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Alternatives-for-Page-componentChanged-Component-MarkupContainer-Wicket-6-5-0-tp4659644p4659653.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: Alternatives for Page.componentChanged(Component, MarkupContainer) - Wicket 6.5.0

2013-06-21 Thread Rakesh A
Hi,

May be I should've added more details to my question.
Code recently upgraded from v1.4.21 to v6.5.0. Old implementation code we
are using this method to do some initialization whenever a component gets
added/removed.

As this method is not being called anymore, the initialization code is not
getting executed anymore [with v6.5.0].

I am looking for alternatives for this method in new v6.5.0 api.

Regards,
Rakesh.A



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Alternatives-for-Page-componentChanged-Component-MarkupContainer-Wicket-6-5-0-tp4659644p4659653.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: CryptoMapper not encoding query string - Wicket 6.5.0

2013-06-21 Thread Martin Grigorov
Wicket 1.5.x+ doesn't produce urls with wicket:interface in the query
string.
Something is wrong.


On Fri, Jun 21, 2013 at 9:52 AM, Rakesh A wrote:

> Hi,
>
> Code is recently upgraded from Wicket v1.4.21 to v6.5.0
>
> Regards,
> Rakesh.A
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-not-encoding-query-string-Wicket-6-5-0-tp4659643p4659651.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: CryptoMapper not encoding query string - Wicket 6.5.0

2013-06-21 Thread Rakesh A
Hi,

Code is recently upgraded from Wicket v1.4.21 to v6.5.0

Regards,
Rakesh.A



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-not-encoding-query-string-Wicket-6-5-0-tp4659643p4659651.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: CryptoMapper not encoding query string - Wicket 6.5.0

2013-06-21 Thread Rakesh A
Hi,

I added the below two lines in my WebApplication#init() method.

  getSecuritySettings().setCryptFactory(new
KeyInSessionSunJceCryptFactory());
  setRootRequestMapper(new PnCryptoMapper(getRootRequestMapper(),
this));

When I debug, for me "url.getSegments().isEmpty()" is 'true' [my url doesn't
have segments] and encryptUrl() method returns without encrypting the URL.

Regards,
Rakesh.A



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-not-encoding-query-string-Wicket-6-5-0-tp4659643p4659650.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to prevent a page from being marked as dirty ?

2013-06-21 Thread Martin Grigorov
Hi,

This is internals detail.
Why do you need to deal with it ?


On Thu, Jun 20, 2013 at 10:06 PM, grazia wrote:

> Is there an example of how to prevent that a page is marked as dirty ?
>  how to use WebPage.dirty(isInitialization) ..
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636.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: Alternatives for Page.componentChanged(Component, MarkupContainer) - Wicket 6.5.0

2013-06-21 Thread Martin Grigorov
Hi,

>From your other question today I have the feeling that you still use Wicket
1.4.

In which case this method is called in 1.4 and not called in 6.x ?


On Fri, Jun 21, 2013 at 8:09 AM, iamrakesh wrote:

> Hi,
>
> In Wicket 1.4.x org.apache.wicket.Page.componentChanged(Component,
> MarkupContainer) is called every time a component gets changed, it seems it
> is not being called anymore in wicket 6.5.0.
>
> Is there any alternative for this method?
> Is there any way to listen for event when a component is
> add/changed/removed/repalced to/from a page?
>
> Regards,
> Rakesh.A
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Alternatives-for-Page-componentChanged-Component-MarkupContainer-Wicket-6-5-0-tp4659644.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 form submit and Tomcat maxPostSize/connectionTimeout

2013-06-21 Thread Martin Grigorov
Hi,


On Thu, Jun 20, 2013 at 10:11 PM, Marios Skounakis  wrote:

> Hi all,
>
> I have the following problem:
> - User submits form with lots of textareas via ajax
> - User gets a blank page
>
> I think (but I'm not quite sure yet) this happens when the textareas
> contain so much text that either maxPostSize or connectionTimeout (submit
> tries to store to db as well) are exceeded.
>
> The weird thing is that there is no exception. The form comes back after
> the ajax request with blank components.
>

So is it a blank page or just form elements without values ?


>
> Has anyone else seen this behavior? Why is there no exception?
>

If the problem is maxSize then there must be an exception. This will lead
to onFailure() call executed in Ajax request.


>
> Thanks
> Marios
>


Re: CryptoMapper not encoding query string - Wicket 6.5.0

2013-06-21 Thread Martin Grigorov
On Fri, Jun 21, 2013 at 6:27 AM, iamrakesh wrote:

> Hi,
>
> I am using Wicket 6.5.0 and I am trying to use CryptoMapper in my
> application and URLs in my application look something like the one given
> below
>
>
> http://localhost:8080/myTest/?wicket:interface=:2:contentPanel:layout:entryPanel:layoutButtonPanel:actionButtonTitleHolder:actionButton::ILinkListener
> ::
>

This Url is produced by Wicket 1.4 or older


>
> These URLs are not encoded and when I check the CryptoMapper implementation
> it checks for segment count and encodes only segments. I remember in 1.5.x
> version it also used to check if query string is empty along with segments
> empty to decide not to encode, some thing like below
>
> if ((url.getSegments().isEmpty() && url.getQueryParameters().isEmpty())) {
> return url; }
>
> but in the v6.5.0 it is like
>
> if (url.getSegments().isEmpty()) { return url; }
>
> was there any reason to change the implementation?
> If I've to encode my URLs like the sample given above, how can I do it?
>
> Regards,
> Rakesh.A
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-not-encoding-query-string-Wicket-6-5-0-tp4659643.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: CryptoMapper not encoding query string - Wicket 6.5.0

2013-06-21 Thread Sven Meier

Take a look at CryptoMapperTest#additionalParameters():
Urls to listeners should be encoded as everything else.

How do you setup your CryptoMapper?

Sven

On 06/21/2013 06:27 AM, iamrakesh wrote:

Hi,

I am using Wicket 6.5.0 and I am trying to use CryptoMapper in my
application and URLs in my application look something like the one given
below

http://localhost:8080/myTest/?wicket:interface=:2:contentPanel:layout:entryPanel:layoutButtonPanel:actionButtonTitleHolder:actionButton::ILinkListener::

These URLs are not encoded and when I check the CryptoMapper implementation
it checks for segment count and encodes only segments. I remember in 1.5.x
version it also used to check if query string is empty along with segments
empty to decide not to encode, some thing like below

if ((url.getSegments().isEmpty() && url.getQueryParameters().isEmpty())) {
return url; }

but in the v6.5.0 it is like

if (url.getSegments().isEmpty()) { return url; }

was there any reason to change the implementation?
If I've to encode my URLs like the sample given above, how can I do it?

Regards,
Rakesh.A



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CryptoMapper-not-encoding-query-string-Wicket-6-5-0-tp4659643.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