You need to sign in to do that
Don't have an account?
Shree K
How to display fieldset in another output panel after command buttons onclick event in the current outputpanel
Hi,
i have a command button in one outputpanel,when user clicks on that button a fieldset has to be dispalyed in another outputpanel(even the outputpanel has to be displayed only after onclick of that button,
help will be appreciated,
Thanks
chhakri
i have a command button in one outputpanel,when user clicks on that button a fieldset has to be dispalyed in another outputpanel(even the outputpanel has to be displayed only after onclick of that button,
help will be appreciated,
Thanks
chhakri
NOTE: When adding code please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.
1) I am trying to create and Enable a command button called "Modify Another item" only for the 3rd and 4th picklist options
i.e("Class/Offering Modification" and "Course Modification request") from the "Request_Type__c" picklist field in the web form,
2) After selecting either of those picklist values if user clicks the command button called "Modify Another item" after rendering, a fieldset called "Modification_Type1" should be displayed and the button has to be enabled only two times.
Please see attached for the web form that i am working on, hope you would be getting a clear idea about what i am doing.
there you could the select option in the 1st field is "Class Offering Modification" ,i dont have the commandbutton yet,so when user selects that option and hits the commandbutton that i mentioned above.a filedset has to be dispalyed in the b ottom ,it could be just in pageblock or in another outputpanel.
VF Page Code:
Controller Code:
Public without sharing class TDR_Delivery1_Request_ctrl extends SitesTodHeaderController
{
/*Public Variables*/
Public Case_form_Extn__c ocaseformextn {get;set;}
Public List<Case_form_Extn__c> licaseformextn;// {get;set;}
Public Map<string,Case_form_Extn__c> caseformmap;// {get;set;}
Public Case Ocase; //{get;set;}
Public List<RecordType> OcaseRecordType;// {get;set;}
public String recordType {get;set;}
public String requesttype {get;set;}
public String reqtype {get;set;}
public List<RecordType> oCaseExtnrecordtypes {get; set;}
public List<SelectOption> orecordtypes {get; set;}
Case_form_Extn__c str;
Public Document doc {get;set;}
public List<String> docIdList = new List<string>();
public boolean addAttachment{get; set;}
public string setpopdisplay{get;set;}
public List<Document> selectedDocumentList {get;set;}
/* Error Message related variables */
public boolean pageError {get; set;}
public boolean showlist{get; set;}
public boolean RenderFunction{get; set;}
public boolean RenderFieldSetBlock{get; set;}
public String pageErrorMessage {get; set;}
public string formname{get;set;}
Public Map<string,Id> caseformextrecordtypeMap{get;set;}
public string RequestValue{get; set;}
public List<AttachmentsWrapper> UploadedDocumentList {get; set; }
public List<selectoption> requestTypeOptions {get;set;}
Public boolean ShowModificationButton {get;set;}
Public TDR_Delivery1_Request_ctrl (){
requestTypeOptions = new List<selectoption>();
requestTypeOptions.add(new selectoption('-None-','None'));
requestTypeOptions.add(new selectoption('Attestations','Attestations'));
requestTypeOptions.add(new selectoption('Bulk Course Offering Modification','Bulk_course_Offering_Modification'));
requestTypeOptions.add(new selectoption('Class Offering Modification','F_Class_Offering_Modification'));
requestTypeOptions.add(new selectoption('Course Modification Request','F_Course_Modification_Request'));
requestTypeOptions.add(new selectoption('Other','Other'));
requestTypeOptions.add(new selectoption('Package Request','Package_Request'));
showAttachmentButton=false;
ShowModificationButton= false;
}
public PageReference requestTypeOnChange(){
if(RequestValue =='Attestations' || RequestValue =='Bulk_course_Offering_Modification' || RequestValue =='Other' || RequestValue =='Package_Request' ) {
showAttachmentButton = true;
}else{
showAttachmentButton = false;
}
return null;
}
public PageReference UpOnButtonClick(){
if(RequestValue =='Class_Offering_Modification' || RequestValue =='Course_Modification_Request' ) {
ShowModificationButton = true;
}else{
ShowModificationButton = false;
}
return null;
}
// Get record types for Delivery request forms and display in 'Request type'.
Public void getfields(){
if(String.IsNotEmpty(apexpages.currentpage().getparameters().get('Param1'))){
RenderFieldSetBlock=true;
RenderFunction = false;
requesttype = apexpages.currentpage().getparameters().get('Param1');
formname=requesttype;
requesttype = EncodingUtil.urlDecode(requesttype, 'UTF-8');
ocaseformextn.TDR_Request_Type__c = requesttype ;
DlccategorySelection = '';
system.debug('414214124' + requesttype);
if(requesttype != 'None'){
requesttype=requesttype.replace(' ','_').replace('(' , '').replace(')' , '').replace(',' , '_').replace('-' , '_').replace('/' , '_').replace('.' , '');
}
if(requesttype.length() > 41){
requesttype = requesttype.substring(0,40);
system.debug('@@@@@@@@@@@@' + requesttype );
if(requesttype.endsWith('_')){
requesttype= requesttype.removeEnd('_');
}
}
}
}
// saverequest method is to save the request.
Public PageReference saveRequest(){
system.debug('----------------->');
try{
pageError = false;
pageErrorMessage = '';
// If there is no validation error save the request.
if(pageError == false){
RecordType rectype = new RecordType();
string recrdtname;
system.debug('##'+RequestValue);
if( RequestValue=='Attestations')//referring fieldsets
{
ocaseformextn.RecordTypeId = System.Label.Attestations; //custom labels which has record typeIds in its value field
}
else
if( RequestValue=='Bulk_course_Offering_Modification')
{
ocaseformextn.RecordTypeId = System.Label.Bulk_Course_Offering;
}
else
if( RequestValue=='Class_Offering_Modification')
{
ocaseformextn.RecordTypeId = System.Label.CL_Class_Offering_Modification;
}
else
if( RequestValue=='Course_Modification_Request')
{
ocaseformextn.RecordTypeId = System.Label.CL_Course_Modification_Request;
}
else
if( RequestValue=='Other')
{
ocaseformextn.RecordTypeId = System.Label.Other;
fileUpload = true;
}
else
if( RequestValue=='Package_Request')
{
ocaseformextn.RecordTypeId = System.Label.Package_Request;
}
//Insert Case
try{
Ocase = new case();
Ocase.Status = 'New';
Ocase.Subject = System.Label.TDR_Case_Subject;
Ocase.WCT_Category__c = System.Label.TDR_Case_Category;
Ocase.Origin = System.Label.TDR_Case_Origin;
Ocase.Description = apexpages.currentpage().getparameters().get('description') ;
Ocase.Contactid = loggedInContact.id;
// Insert Case Extension Form.
ocaseformextn.Case_Form_App__c = System.Label.Case_Form_App;
ocaseformextn.TDR_Employee__c = loggedInContact.id;
ocaseformextn.GEN_Case__c= Ocase.Id;
}
system.debug('=========Case Extension=======' + ocaseformextn);
Insert ocaseformextn;
uploadRelatedAttachment();
}catch(Exception e){
return null;
}
}
else{
return null;
}
}
catch(Exception ex){
system.debug('------getMessage----'+ex.getMessage()+'--------getLineNumber--------'+ex.getLineNumber());
return null;
}
}