Ok

then for: <input type="button">
there should be a Button object in wicket (the OnClickLink???)

But what i want is better support for this:

<form>
<xxxx>
<input type="submit" name="submit1" value="submit1">
<input type="submit" name="submit2" value="submit2">
</form>

these kind of things you have pretty often. Like save form and continue to next page
or save form and go to previous page. ect.


there i would like to have
SubmitButton("submit1").buttonClicked(
  //impl
);

of course people can also do this:

<form>
<xxxx>
<input type="submit" name="submit" value="submit1">
<input type="submit" name="submit" value="submit2">
</form>

so the same name but differnet values..

johan



Eelco Hillenius wrote:

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")
           {
               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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=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=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to