Hi Chandru, This page should describe what you want to do : http://wiki.apache.org/myfaces/ClearInputComponents
Regards, Fintan -----Original Message----- From: Chandra Sekhar [mailto:[EMAIL PROTECTED] Sent: 25 July 2006 16:19 To: MyFaces Discussion Subject: Re: how do you folks handle a "Cancel" button? Hi, When the User presses the Cancel Button the Page should not refresh, for that I used type = "button" in the <h:commandButton> and for me the purpose is all of my form should get cleared without refreshing and that is onClick of the Cancel Button, but from one of the discussions i heard that is not standard to use the type = "button" . rather I have to use immedieate = true in the CommandButton .But when I mention this the form is getting refreshed. Can you provide me a solution for this. Regards, Chandru. ----- Original Message ----- From: "Cosma Colanicchia" <[EMAIL PROTECTED]> To: "MyFaces Discussion" <[email protected]> Sent: Tuesday, July 25, 2006 8:13 PM Subject: Re: how do you folks handle a "Cancel" button? > What page should not get refreshed? Can you try to explain exactly in > what context that cancel button is to be places, and what you want to > happen when the user press it? > > Cosma > > 2006/7/25, Chandra Sekhar <[EMAIL PROTECTED]>: >> Hi , >> Thanks for your good reasoning.But, when I click the Cancel the >> page should not get refreshed as per our standards.So can I take the >> immedieate attribute to work granted for without refreshing my page >> as it is a command >> Button. >> >> Rgds, >> Chandru. >> ----- Original Message ----- >> From: "Dhananjay Prasanna" <[EMAIL PROTECTED]> >> To: "MyFaces Discussion" <[email protected]> >> Sent: Tuesday, July 25, 2006 11:05 AM >> Subject: RE: how do you folks handle a "Cancel" button? >> >> >> > >> > You cant navigate to another page without a proper submit (for >> > example, to cancel and return to a calling page). This is why >> > immediate is preferred to skip updating the backing bean, but to >> > invoke a bound action anyway. >> > >> > The type="button" option is meant for "plain" buttons to invoke >> > client-side javascript. It is therefore bad practise to use it as a >> > Cancel button, not to mention semantically misleading. >> > >> > It should be remembered, of course, that once properly considered, >> > use whatever works for you in your scenario. >> > >> > Dhanji. >> > >> > >> > -----Original Message----- >> > From: Chandra Sekhar [mailto:[EMAIL PROTECTED] >> > Sent: Tuesday, 25 July 2006 2:43 PM >> > To: MyFaces Discussion >> > Subject: Re: how do you folks handle a "Cancel" button? >> > >> > Hi, >> > When type = "button" is given <h:commandButton> will act as html >> > button , and a necessary javaScript function wcan be called on an >> > event. So there >> > is >> > no point of going upto the bean. It can be handled at the JSP Side >> > alone. >> > >> > If there are any other specific reasons for immedieate = "true" >> > >> > please mention it. >> > >> > Rgds, >> > Chandru. >> > >> > ----- Original Message ----- >> > From: "Dhananjay Prasanna" <[EMAIL PROTECTED]> >> > To: "MyFaces Discussion" <[email protected]> >> > Sent: Tuesday, July 25, 2006 10:03 AM >> > Subject: RE: how do you folks handle a "Cancel" button? >> > >> > >> >> >> >> I believe the preferred way is to set the attribute, >> >> immediate="true" >> > on >> >> the button, so that the POST contents are not merged into the >> >> backing bean. >> >> >> >> -----Original Message----- >> >> From: Chandra Sekhar [mailto:[EMAIL PROTECTED] >> >> Sent: Tuesday, 25 July 2006 2:32 PM >> >> To: MyFaces Discussion >> >> Subject: Re: how do you folks handle a "Cancel" button? >> >> >> >> Instead you can do it as type = "button" in the <h:commandButton> >> >> , then it will function as a normal Button. >> >> >> >> Chandru. >> >> >> >> ----- Original Message ----- >> >> From: "Julian Ray" <[EMAIL PROTECTED]> >> >> To: "'MyFaces Discussion'" <[email protected]> >> >> Sent: Tuesday, July 25, 2006 2:12 AM >> >> Subject: RE: how do you folks handle a "Cancel" button? >> >> >> >> >> >>> Add immediate="true" to the command button. This will by pass any >> >> updates. >> >>> >> >>> >> >>> -----Original Message----- >> >>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> >>> Sent: Monday, July 24, 2006 4:37 PM >> >>> To: MyFaces Discussion >> >>> Subject: how do you folks handle a "Cancel" button? >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> hello to everyone, >> >>> >> >>> I have a form that displays detail data from a backing bean. >> >>> >> >>> The same bean supplies properties for an update page. >> >>> >> >>> The update page has a Cancel button and when selected should >> >>> return >> >> the >> >>> user >> >>> to the detail page with no changes saved. >> >>> >> >>> Simple enough use, but when the Cancel button is selected, the >> > backing >> >> >> >>> bean >> >>> is updated and the detail page shows modified data. >> >>> >> >>> How do you folks handle similar situations? >> >>> >> >>> Thanks in advance for your help. >> >>> Tom >> >>> >> >>> >> >>> >> >>> >> >>> This message is intended for the recipient only and is not meant >> >>> to >> > be >> >>> forwarded or distributed in any other format. This communication >> >>> is >> >> for >> >>> informational purposes only. It is not intended as an offer or >> >>> solicitation for the purchase or sale of any financial >> >>> instrument, or security, or >> >> as >> >>> an >> >>> official confirmation of any transaction. Putnam does not accept >> >> purchase >> >>> or redemptions of securities, instructions, or authorizations >> >>> that >> > are >> >> >> >>> sent >> >>> via e-mail. All market prices, data and other information are not >> >>> warranted as to completeness or accuracy and are subject to >> >>> change >> >> without >> >>> notice. Any comments or statements made herein do not >> >>> necessarily >> >> reflect >> >>> those of Putnam, LLC (DBA Putnam Investments) and its >> >>> subsidiaries >> > and >> >>> affiliates. If you are not the intended recipient of this >> >>> e-mail, >> >> please >> >>> delete the e-mail. >> >> >> >> >> >> This correspondence is for the named persons only. >> >> It may contain confidential or privileged information or both. No >> >> confidentiality or privilege is waived or lost by any mis >> > transmission. >> >> If you receive this correspondence in error please delete it from >> >> your >> > >> >> system immediately and notify the sender. >> >> You must not disclose, copy or relay on any part of this >> > correspondence, >> >> if you are not the intended recipient. >> >> Any opinions expressed in this message are those of the individual >> > sender >> >> except where the sender expressly, >> >> and with the authority, states them to be the opinions of the >> > Department >> >> of Emergency Services, Queensland. >> > >> > >> > This correspondence is for the named persons only. >> > It may contain confidential or privileged information or both. No >> > confidentiality or privilege is waived or lost by any mis >> > transmission. If you receive this correspondence in error please >> > delete it from your system immediately and notify the sender. >> > You must not disclose, copy or relay on any part of this >> > correspondence, >> > if you are not the intended recipient. >> > Any opinions expressed in this message are those of the individual >> > sender >> > except where the sender expressly, >> > and with the authority, states them to be the opinions of the >> > Department >> > of Emergency Services, Queensland. >> >> * ** *** ** * ** *** ** * ** *** ** * This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any views or opinions presented are solely those of the author, and do not necessarily represent those of ESB. If you have received this email in error please notify the sender. Although ESB scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. * ** *** ** * ** *** ** * ** *** ** *

