Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Martijn Dashorst
This is more confusing when one has more forms on one page.
Martijn
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked when 
the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each button 
added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Johan Compagner
yes this is also a thing that i don't like very much currently.
With links you can add a link and then implement linkClicked()
It would be nice that buttons also work this way..
johan
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked when 
the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each button 
added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Eelco Hillenius
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to signal 
whether a submit or cancel was pressed, typically comes from the 
non-component based approach, where all form submits would enter the 
same action. If you think about what you want to do here... it has 
nothing to do with really submitting the form, as you just want to 
navigate somewhere else.

I admit, it is partially my fault as checking on the cancel button was 
in CDAPP (which you copied?), but it is one of the things I had to 
learn. Compare it to how you would do it in e.g. Swing. A cancel button 
would then also just have a navigation action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input type=button id=wicket-cancelButton value=cancel/
   input type=submit value=save/
Eelco
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked 
when the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each button 
added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Eelco Hillenius
Johan Compagner wrote:
yes this is also a thing that i don't like very much currently.
With links you can add a link and then implement linkClicked()
It would be nice that buttons also work this way..
Or just use the OnClickLink instead of Link. Works the same, with the 
difference that OnClickLink can be put on any HTML component (like 
buttons, but also td tags etc.)

johan
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked 
when the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each button 
added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Martijn Dashorst
I find the name OnClickLink not very comforting for a Form component. 
I'd expect a button component which does this for me. Perhaps a new 
extension for the html.form package?

It is now not clear how to do this. The Form documentation could also 
use some information on handling submits other than 'the onSubmit is 
handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to signal 
whether a submit or cancel was pressed, typically comes from the 
non-component based approach, where all form submits would enter the 
same action. If you think about what you want to do here... it has 
nothing to do with really submitting the form, as you just want to 
navigate somewhere else.

I admit, it is partially my fault as checking on the cancel button was 
in CDAPP (which you copied?), but it is one of the things I had to 
learn. Compare it to how you would do it in e.g. Swing. A cancel 
button would then also just have a navigation action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input type=button id=wicket-cancelButton 
value=cancel/
   input type=submit value=save/

Eelco
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked 
when the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each 
button added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real 
users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Eelco Hillenius
I think the problem is that you are still thinking web too much. The 
behaviour you need actually has nothing to do with your form, does it? 
If you have a panel with a few input fields in Swing, and a button (kind 
of submit) that work on that fields, and another button that navigates 
somewhere else, you want to see that button completely decoupled from 
the form as well.

I think this works really great right now in Wicket. If you want to do 
anything with the form, you use formSubmit and a submit button. If not, 
you use other components, like links.

Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form component. 
I'd expect a button component which does this for me. Perhaps a new 
extension for the html.form package?

It is now not clear how to do this. The Form documentation could also 
use some information on handling submits other than 'the onSubmit is 
handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to signal 
whether a submit or cancel was pressed, typically comes from the 
non-component based approach, where all form submits would enter the 
same action. If you think about what you want to do here... it has 
nothing to do with really submitting the form, as you just want to 
navigate somewhere else.

I admit, it is partially my fault as checking on the cancel button 
was in CDAPP (which you copied?), but it is one of the things I had 
to learn. Compare it to how you would do it in e.g. Swing. A cancel 
button would then also just have a navigation action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input type=button id=wicket-cancelButton 
value=cancel/
   input type=submit value=save/

Eelco
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked 
when the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each 
button added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real 
users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real 
users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Eelco Hillenius
Martijn Dashorst wrote:
You say two things:
- use buttons and their on click event in Swing
- don't have buttons in Wicket.
I think, and I'm probably not the only one, that when I need a button 
on a form, I have the same representation in Wicket, i.e. a Button 
component with an OnClick event. Nothing fancy, just that. Swing also 
has a Button component. The VCL has a Button component, Windows has a 
Button component, Html has a Button component. Why should Wicket then 
do something different like'OnClickLink'?

Buttons are what the things that make Forms tick. I.E. there needs to 
be a Button component.

Links in Html/Wicket are what buttons are in Swing. Link and OnClickLink 
have the same behaviour, except that Link can only be used with href... 
tags, while OnClickLinks can be used with most Html tags, like e.g. a 
button. A button in Html is just a placeholder component that does 
nothing on itself.

Maybe it is a good idea to somehow merge these two components to avoid 
fuzziness. Additionaly, we could - maybe - introduce a specific Button 
component, which would be exactely the same as the OnClickButton, with 
an additional check on the 'button' tag.

Or... we could (like you propose?) extend form with not only a 
formSubmitted, but also with e.g. a formCancelled method, and a cancel 
button component that works with these. Personally, I am not 
enthousiastic about this, as it keeps people thinking in a non component 
based way.

Eelco
Martijn
Eelco Hillenius wrote:
I think the problem is that you are still thinking web too much. The 
behaviour you need actually has nothing to do with your form, does 
it? If you have a panel with a few input fields in Swing, and a 
button (kind of submit) that work on that fields, and another button 
that navigates somewhere else, you want to see that button completely 
decoupled from the form as well.

I think this works really great right now in Wicket. If you want to 
do anything with the form, you use formSubmit and a submit button. If 
not, you use other components, like links.

Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form 
component. I'd expect a button component which does this for me. 
Perhaps a new extension for the html.form package?

It is now not clear how to do this. The Form documentation could 
also use some information on handling submits other than 'the 
onSubmit is handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to 
signal whether a submit or cancel was pressed, typically comes from 
the non-component based approach, where all form submits would 
enter the same action. If you think about what you want to do 
here... it has nothing to do with really submitting the form, as 
you just want to navigate somewhere else.

I admit, it is partially my fault as checking on the cancel button 
was in CDAPP (which you copied?), but it is one of the things I had 
to learn. Compare it to how you would do it in e.g. Swing. A cancel 
button would then also just have a navigation action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input type=button id=wicket-cancelButton 
value=cancel/
   input type=submit value=save/

Eelco
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked 
when the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each 
button added?

Martijn

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real 
users.
Discover which products truly live up to the hype. Start reading 
now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real 
users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real 
users.
Discover 

Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Martijn Dashorst
A button in Html *DOES* have it's own behavior. It can submit a form, it 
has an onClick, and it renders itself as a button. It is quite different 
from a link. A link surrounds markup. A button does not. A link has a 
specific purpose: navigation. A button is normally used for performing 
actions.

And I have never proposed to add new functionality to Form. I want a 
Button component in the forms package, or a special button package. 
Buttons and Links have nothing in common, except the fact perhaps they 
both have an onClick event.

Adding an 'onCancel' event to a form seems like a nice feature to me. I 
can see this makes development a lot faster. It doesn't conflict with 
the component based nature of Wicket, and adds some (perhaps a lot) 
convenience to form handling. Why do you see this as a 'non-component 
based' way? When is it component based? If this is non-component based, 
then the 'onSubmit' should be removed as well, because one can use a 
submit Button with an onClick event for this purpose.

Martijn
Eelco Hillenius wrote:
Martijn Dashorst wrote:
You say two things:
- use buttons and their on click event in Swing
- don't have buttons in Wicket.
I think, and I'm probably not the only one, that when I need a button 
on a form, I have the same representation in Wicket, i.e. a Button 
component with an OnClick event. Nothing fancy, just that. Swing also 
has a Button component. The VCL has a Button component, Windows has a 
Button component, Html has a Button component. Why should Wicket then 
do something different like'OnClickLink'?

Buttons are what the things that make Forms tick. I.E. there needs to 
be a Button component.

Links in Html/Wicket are what buttons are in Swing. Link and 
OnClickLink have the same behaviour, except that Link can only be used 
with href... tags, while OnClickLinks can be used with most Html 
tags, like e.g. a button. A button in Html is just a placeholder 
component that does nothing on itself.

Maybe it is a good idea to somehow merge these two components to avoid 
fuzziness. Additionaly, we could - maybe - introduce a specific Button 
component, which would be exactely the same as the OnClickButton, with 
an additional check on the 'button' tag.

Or... we could (like you propose?) extend form with not only a 
formSubmitted, but also with e.g. a formCancelled method, and a cancel 
button component that works with these. Personally, I am not 
enthousiastic about this, as it keeps people thinking in a non 
component based way.

Eelco
Martijn
Eelco Hillenius wrote:
I think the problem is that you are still thinking web too much. The 
behaviour you need actually has nothing to do with your form, does 
it? If you have a panel with a few input fields in Swing, and a 
button (kind of submit) that work on that fields, and another button 
that navigates somewhere else, you want to see that button 
completely decoupled from the form as well.

I think this works really great right now in Wicket. If you want to 
do anything with the form, you use formSubmit and a submit button. 
If not, you use other components, like links.

Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form 
component. I'd expect a button component which does this for me. 
Perhaps a new extension for the html.form package?

It is now not clear how to do this. The Form documentation could 
also use some information on handling submits other than 'the 
onSubmit is handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to 
signal whether a submit or cancel was pressed, typically comes 
from the non-component based approach, where all form submits 
would enter the same action. If you think about what you want to 
do here... it has nothing to do with really submitting the form, 
as you just want to navigate somewhere else.

I admit, it is partially my fault as checking on the cancel button 
was in CDAPP (which you copied?), but it is one of the things I 
had to learn. Compare it to how you would do it in e.g. Swing. A 
cancel button would then also just have a navigation action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input type=button id=wicket-cancelButton 
value=cancel/
   input type=submit value=save/

Eelco
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was 
clicked when the onSubmit occurs?

Currently the only way I know is to go into the request parameters:
   getRequestCycle().getRequest().getParameter(save) != null
Perhaps instead of an onSubmit on the form, an onClick on each 
button added?

Martijn

---
SF email is 

Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Eelco Hillenius
From w3c (http://www.w3.org/TR/REC-html40/interact/forms.html#push-button):
push buttons: Push buttons have no default behavior. Each push button 
may have client-side scripts scripts.html associated with the 
element's event scripts.html#events attributes. When an event occurs 
(e.g., the user presses the button, releases it, etc.), the associated 
script is triggered.

That's the button I mean. I don't mean 'input type=submit', or input 
type=cancel. Submit clearly has a meaning with the form, and is to be 
used when you want to trigger the formSubmit handler on the server side. 
Cancel is client side only.

Eelco
Martijn Dashorst wrote:
A button in Html *DOES* have it's own behavior. It can submit a form, 
it has an onClick, and it renders itself as a button. It is quite 
different from a link. A link surrounds markup. A button does not. A 
link has a specific purpose: navigation. A button is normally used for 
performing actions.

And I have never proposed to add new functionality to Form. I want a 
Button component in the forms package, or a special button package. 
Buttons and Links have nothing in common, except the fact perhaps they 
both have an onClick event.

Adding an 'onCancel' event to a form seems like a nice feature to me. 
I can see this makes development a lot faster. It doesn't conflict 
with the component based nature of Wicket, and adds some (perhaps a 
lot) convenience to form handling. Why do you see this as a 
'non-component based' way? When is it component based? If this is 
non-component based, then the 'onSubmit' should be removed as well, 
because one can use a submit Button with an onClick event for this 
purpose.

Martijn
Eelco Hillenius wrote:
Martijn Dashorst wrote:
You say two things:
- use buttons and their on click event in Swing
- don't have buttons in Wicket.
I think, and I'm probably not the only one, that when I need a 
button on a form, I have the same representation in Wicket, i.e. a 
Button component with an OnClick event. Nothing fancy, just that. 
Swing also has a Button component. The VCL has a Button component, 
Windows has a Button component, Html has a Button component. Why 
should Wicket then do something different like'OnClickLink'?

Buttons are what the things that make Forms tick. I.E. there needs 
to be a Button component.


Links in Html/Wicket are what buttons are in Swing. Link and 
OnClickLink have the same behaviour, except that Link can only be 
used with href... tags, while OnClickLinks can be used with most 
Html tags, like e.g. a button. A button in Html is just a placeholder 
component that does nothing on itself.

Maybe it is a good idea to somehow merge these two components to 
avoid fuzziness. Additionaly, we could - maybe - introduce a specific 
Button component, which would be exactely the same as the 
OnClickButton, with an additional check on the 'button' tag.

Or... we could (like you propose?) extend form with not only a 
formSubmitted, but also with e.g. a formCancelled method, and a 
cancel button component that works with these. Personally, I am not 
enthousiastic about this, as it keeps people thinking in a non 
component based way.

Eelco
Martijn
Eelco Hillenius wrote:
I think the problem is that you are still thinking web too much. 
The behaviour you need actually has nothing to do with your form, 
does it? If you have a panel with a few input fields in Swing, and 
a button (kind of submit) that work on that fields, and another 
button that navigates somewhere else, you want to see that button 
completely decoupled from the form as well.

I think this works really great right now in Wicket. If you want to 
do anything with the form, you use formSubmit and a submit button. 
If not, you use other components, like links.

Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form 
component. I'd expect a button component which does this for me. 
Perhaps a new extension for the html.form package?

It is now not clear how to do this. The Form documentation could 
also use some information on handling submits other than 'the 
onSubmit is handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to 
signal whether a submit or cancel was pressed, typically comes 
from the non-component based approach, where all form submits 
would enter the same action. If you think about what you want to 
do here... it has nothing to do with really submitting the form, 
as you just want to navigate somewhere else.

I admit, it is partially my fault as checking on the cancel 
button was in CDAPP (which you copied?), but it is one of the 
things I had to learn. Compare it to how you would do it in e.g. 
Swing. A cancel button would then also just have a navigation 
action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
  

Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Jonathan Locke
martjin, would you be willing to write up an RFE that explains exactly 
how you think form buttons and form ok/cancel/etc should work?

then anyone who has comments on that can attach them to the RFE.  make 
sense?

anyway, i at least partially agree with martijn and i definitely think 
we should look into this more.  even if it's just because there will be 
a million people asking this question if we don't.

   jon
Martijn Dashorst wrote:
A button in Html *DOES* have it's own behavior. It can submit a form, 
it has an onClick, and it renders itself as a button. It is quite 
different from a link. A link surrounds markup. A button does not. A 
link has a specific purpose: navigation. A button is normally used for 
performing actions.

And I have never proposed to add new functionality to Form. I want a 
Button component in the forms package, or a special button package. 
Buttons and Links have nothing in common, except the fact perhaps they 
both have an onClick event.

Adding an 'onCancel' event to a form seems like a nice feature to me. 
I can see this makes development a lot faster. It doesn't conflict 
with the component based nature of Wicket, and adds some (perhaps a 
lot) convenience to form handling. Why do you see this as a 
'non-component based' way? When is it component based? If this is 
non-component based, then the 'onSubmit' should be removed as well, 
because one can use a submit Button with an onClick event for this 
purpose.

Martijn
Eelco Hillenius wrote:
Martijn Dashorst wrote:
You say two things:
- use buttons and their on click event in Swing
- don't have buttons in Wicket.
I think, and I'm probably not the only one, that when I need a 
button on a form, I have the same representation in Wicket, i.e. a 
Button component with an OnClick event. Nothing fancy, just that. 
Swing also has a Button component. The VCL has a Button component, 
Windows has a Button component, Html has a Button component. Why 
should Wicket then do something different like'OnClickLink'?

Buttons are what the things that make Forms tick. I.E. there needs 
to be a Button component.


Links in Html/Wicket are what buttons are in Swing. Link and 
OnClickLink have the same behaviour, except that Link can only be 
used with href... tags, while OnClickLinks can be used with most 
Html tags, like e.g. a button. A button in Html is just a placeholder 
component that does nothing on itself.

Maybe it is a good idea to somehow merge these two components to 
avoid fuzziness. Additionaly, we could - maybe - introduce a specific 
Button component, which would be exactely the same as the 
OnClickButton, with an additional check on the 'button' tag.

Or... we could (like you propose?) extend form with not only a 
formSubmitted, but also with e.g. a formCancelled method, and a 
cancel button component that works with these. Personally, I am not 
enthousiastic about this, as it keeps people thinking in a non 
component based way.

Eelco
Martijn
Eelco Hillenius wrote:
I think the problem is that you are still thinking web too much. 
The behaviour you need actually has nothing to do with your form, 
does it? If you have a panel with a few input fields in Swing, and 
a button (kind of submit) that work on that fields, and another 
button that navigates somewhere else, you want to see that button 
completely decoupled from the form as well.

I think this works really great right now in Wicket. If you want to 
do anything with the form, you use formSubmit and a submit button. 
If not, you use other components, like links.

Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form 
component. I'd expect a button component which does this for me. 
Perhaps a new extension for the html.form package?

It is now not clear how to do this. The Form documentation could 
also use some information on handling submits other than 'the 
onSubmit is handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to 
signal whether a submit or cancel was pressed, typically comes 
from the non-component based approach, where all form submits 
would enter the same action. If you think about what you want to 
do here... it has nothing to do with really submitting the form, 
as you just want to navigate somewhere else.

I admit, it is partially my fault as checking on the cancel 
button was in CDAPP (which you copied?), but it is one of the 
things I had to learn. Compare it to how you would do it in e.g. 
Swing. A cancel button would then also just have a navigation 
action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input type=button id=wicket-cancelButton 
value=cancel/
   

Re: [Wicket-user] Using form.onSubmit()

2005-02-09 Thread Martijn Dashorst
Working on it.
Martijn
Jonathan Locke wrote:
martjin, would you be willing to write up an RFE that explains exactly 
how you think form buttons and form ok/cancel/etc should work?

then anyone who has comments on that can attach them to the RFE.  make 
sense?

anyway, i at least partially agree with martijn and i definitely think 
we should look into this more.  even if it's just because there will 
be a million people asking this question if we don't.

   jon
Martijn Dashorst wrote:
A button in Html *DOES* have it's own behavior. It can submit a form, 
it has an onClick, and it renders itself as a button. It is quite 
different from a link. A link surrounds markup. A button does not. A 
link has a specific purpose: navigation. A button is normally used 
for performing actions.

And I have never proposed to add new functionality to Form. I want a 
Button component in the forms package, or a special button package. 
Buttons and Links have nothing in common, except the fact perhaps 
they both have an onClick event.

Adding an 'onCancel' event to a form seems like a nice feature to me. 
I can see this makes development a lot faster. It doesn't conflict 
with the component based nature of Wicket, and adds some (perhaps a 
lot) convenience to form handling. Why do you see this as a 
'non-component based' way? When is it component based? If this is 
non-component based, then the 'onSubmit' should be removed as well, 
because one can use a submit Button with an onClick event for this 
purpose.

Martijn
Eelco Hillenius wrote:
Martijn Dashorst wrote:
You say two things:
- use buttons and their on click event in Swing
- don't have buttons in Wicket.
I think, and I'm probably not the only one, that when I need a 
button on a form, I have the same representation in Wicket, i.e. a 
Button component with an OnClick event. Nothing fancy, just that. 
Swing also has a Button component. The VCL has a Button component, 
Windows has a Button component, Html has a Button component. Why 
should Wicket then do something different like'OnClickLink'?

Buttons are what the things that make Forms tick. I.E. there needs 
to be a Button component.


Links in Html/Wicket are what buttons are in Swing. Link and 
OnClickLink have the same behaviour, except that Link can only be 
used with href... tags, while OnClickLinks can be used with most 
Html tags, like e.g. a button. A button in Html is just a 
placeholder component that does nothing on itself.

Maybe it is a good idea to somehow merge these two components to 
avoid fuzziness. Additionaly, we could - maybe - introduce a 
specific Button component, which would be exactely the same as the 
OnClickButton, with an additional check on the 'button' tag.

Or... we could (like you propose?) extend form with not only a 
formSubmitted, but also with e.g. a formCancelled method, and a 
cancel button component that works with these. Personally, I am not 
enthousiastic about this, as it keeps people thinking in a non 
component based way.

Eelco
Martijn
Eelco Hillenius wrote:
I think the problem is that you are still thinking web too much. 
The behaviour you need actually has nothing to do with your form, 
does it? If you have a panel with a few input fields in Swing, and 
a button (kind of submit) that work on that fields, and another 
button that navigates somewhere else, you want to see that button 
completely decoupled from the form as well.

I think this works really great right now in Wicket. If you want 
to do anything with the form, you use formSubmit and a submit 
button. If not, you use other components, like links.

Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form 
component. I'd expect a button component which does this for me. 
Perhaps a new extension for the html.form package?

It is now not clear how to do this. The Form documentation could 
also use some information on handling submits other than 'the 
onSubmit is handled in subclasses.'.

Martijn
Eelco Hillenius wrote:
Actually, things like: 
getRequestCycle().getRequest().getParameter(save) != null to 
signal whether a submit or cancel was pressed, typically comes 
from the non-component based approach, where all form submits 
would enter the same action. If you think about what you want to 
do here... it has nothing to do with really submitting the form, 
as you just want to navigate somewhere else.

I admit, it is partially my fault as checking on the cancel 
button was in CDAPP (which you copied?), but it is one of the 
things I had to learn. Compare it to how you would do it in e.g. 
Swing. A cancel button would then also just have a navigation 
action.

Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in 
CDAPP.

Java:
   add(new OnClickLink(cancelButton)
   {
   public void linkClicked() {
   getRequestCycle().setPage(getSearchPage());
   }
   });
Html:
   input