You need to sign in to do that
Don't have an account?
CvrK
How to Enable/Disable a commandbutton and display an outputPanel based on selecting a picklist value?
Hi ,
How to Enable or Disable a commandbutton based on selecting a picklist value,
I have requirement to enable/disable a command button based on a picklist value then i have an Outputpanel(a fieldset inside) that has to be displayed when the button is clicked..the button has to be enabled only twice.
I am breaking my head since the three days, sample code will be very highly appreciated.
I am posting the question here after a lot of Online references, but i hav not find any online reference or code that is close to my requirement.
Thanks in Advance
Ck
How to Enable or Disable a commandbutton based on selecting a picklist value,
I have requirement to enable/disable a command button based on a picklist value then i have an Outputpanel(a fieldset inside) that has to be displayed when the button is clicked..the button has to be enabled only twice.
I am breaking my head since the three days, sample code will be very highly appreciated.
I am posting the question here after a lot of Online references, but i hav not find any online reference or code that is close to my requirement.
Thanks in Advance
Ck
Please try this below sample code: I hope it will help you.
If the answer helped you ,mark it as solved.
Regards,
Jyothsna D
Thanks for your time,i would like to let you know what exactly i am doing before you look at the code,hoping it makes easier for you to help me,
Please see image for the form that i am trying to build,
I am building webforms,intially just a picklist field called Request_Type__c (which has 6 values/options),so when a user select a picklist value among those ,its assigned fieldset will be displayed and upon clicking submit button record will be created, i am successfull till here,
Now my problem is.....when a user selects a picklist value I.e "Course Modification Rrequest" as Request_Type__c a fieldset will be displayed which has 5 fields ,now a button or any type of option has to be available/enabled to the user along wi the fields,so when user clicks on it, two fields among them
Modification_Type__c(Picklist) and Description__c(Text) along with the same commandbutton or any option has to be displayed in the bottom again(could be an outputpane or pageblock),this same process has to be repeated one more time, that mean user should be able to select 3 picklist options from the Modification_Type field,along with the Description__C for each picklist value.
If you look at the image, all i need is a button/option for that particula requet type and when the user clicks the button Modification_Type__c field and Description__c field should be displayed in the bottom along with the same option/button
The above method is not at all working,when i add the condition,please let me know if you need to know anything further.
Thanks in Advance.
off the top of my head, maybe try this:
adding the "reRender" attribute to the commandbutton means it won't reload the whole page - which I think might be spoiling the scope of your ModifyClassFsetId variable... it will just rerender the output panel, maintaining the effort of your controller.
No luck yet,....I have written a sample code below which is close to my requirement,Could you please provide a Class/method and edit the vf code accordingly, if you have time for this...
1) As i said earlier, a command button has to be displayed upon selecting 2nd and 3rd selectoptions from below
2)Upon click of button ,below outputpanel1/pageblock1, which has Field1__c,Field2__C or the the fieldset(either of them) should be displayed along with the same button,
and this process has to be repeated once again and display Outputpanel2/pagegeblock2 which has Field3__c,Field4__C.
Note: i have included both fieldset and fields in the pageblocks either of them is fine,