You need to sign in to do that
Don't have an account?

i need to paas parameter(ContentCategoryId) on selection of pick list value urgent pls help
i need to paas parameter on selection of pick list
VF page <apex:pageblockSection > <apex:selectList size="1" value="{!productName}" id="ContentCategoryId"> <apex:selectOptions value="{!items}"/> <apex:actionSupport event="onchange" action="{!getperformcallout}" rerender="normalList"> <apex:param name="ContentCategoryId" assignto="{!ContentCategoryId}" value="{!ContentCategoryId}"/> </apex:actionSupport> </apex:selectList> </apex:pageblockSection> </apex:pageBlock> <apex:pageblock >
Public class videolistclass{ public String ContentCategoryId{get;set;} PUBLIC List<selectOption> Items; public String toAddresses {get; set;} public String MySessionID = UserInfo.getSessionID(); public String myurl= URL.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/c/10.0/' + UserInfo.getOrganizationId(); public string c='eU9WzoFgU4n8Apu5PYxcNGRZswRDZJWDEMdbQVU85gw='; public String Acode= Userinfo.getuserid(); public String Oid = '00D280000018TjaEAE'; Blob cryptoKey= EncodingUtil.base64Decode(c); Blob data = Blob.valueOf(MySessionID ); Blob data1 = Blob.valueOf(myurl); Blob data4 = Blob.valueOf(Acode); Blob data5 = Blob.valueOf(Oid); Blob encryptedData = Crypto.encryptWithManagedIV('AES256', cryptoKey, data); Blob encryptedData1 = Crypto.encryptWithManagedIV('AES256', cryptoKey, data1); Blob encryptedData4 = Crypto.encryptWithManagedIV('AES256', cryptoKey, data4 ); Blob encryptedData5 = Crypto.encryptWithManagedIV('AES256', cryptoKey, data5 ); public String b64Data = EncodingUtil.base64Encode(encryptedData); public String b64Data1 = EncodingUtil.base64Encode(encryptedData1); public String b64Data4 = EncodingUtil.base64Encode(encryptedData4); public String b64Data5 = EncodingUtil.base64Encode(encryptedData5); public String aucode= EncodingUtil.urlEncode(b64Data4, 'UTF-8'); public String ocode= EncodingUtil.urlEncode(b64Data5, 'UTF-8'); public String ssnid{get;set;} public boolean normalList{get;set;} public boolean selectedList{get;set;} public String Title{get;set;} public Boolean selected {get; set;} public List<videolist> ConsoleWrapperList5{get;set;} public string productName{get;set;} public videolistclass() { getperformcallout5(); normalList = true; selectedList = false; } public List<videolist> getperformcallout5(){ ConsoleWrapperList5 = new List<videolist>(); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); string url = 'https://www.demomail.net/sf/api/ContactCategoryList?AUCode='+aucode+'&SOrgID='+ocode+'&CategoryId='+ContentCategoryId; req.setEndpoint(url); System.debug('&&: '+ url ); req.setMethod('GET'); res = http.send(req); if(res.getstatusCode() == 200 && res.getbody() != null) { ConsoleWrapperList5=(List<videolist>)json.deserialize(res.getbody(),List<videolist>.class); } return consolewrapperlist5; } public List<SelectOption> getItems() { List<SelectOption> options = new List<SelectOption>(); for(videolist crRec : ConsoleWrapperList5){ options.add(new SelectOption(crRec.ContentCategoryId, crRec.CategoryName)); } return options; } public List<consolewrap> ConsoleWrapperList{get;set;} public List<consolewrap> getperformcallout(){ ConsoleWrapperList = new List<consolewrap>(); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); string url = 'https://www.demomail.net/sf/api/SendVideoContact?AUCode='+aucode+'&SOrgID='+ocode+'&CategoryId='+ContentCategoryId+'&LanguageId='+0; req.setEndpoint(url); req.setMethod('GET'); res = http.send(req); if(res.getstatusCode() == 200 && res.getbody() != null){ ConsoleWrapperList=(List<consolewrap>)json.deserialize(res.getbody(),List<consolewrap>.class); System.debug('value: '+ ConsoleWrapperList ); } return consolewrapperlist; } }
What is the issue here? If possible please paste the full VF Page.
Because sometimes, if you use immediate=true for the commend button, it may not set the param values.
Regards,
Mahesh
Two API Url
one for picklist (ContentCategoryId and category)
second for display (Title ) in page block table on selection of picklist value
I mean need to paas ContentCategoryId in second api URL
What value you are assign it to "ContentCategoryId".
Please print the value in VF page:
{!ContentCategoryId} and see what value you are getting into VF page.
Regards,
Mahesh
It seems you are not using productName any where in your class, so just update your VF page with my above code. So what will happen is, onchange event selected value of picklist is assigned directly to ContentCategoryId variable.
If you are expecting to get the selected value from the Select list then follow what deepak said.
<apex:selectList size="1" value="{!ContentCategoryId}" id="ContentCategoryId">
Change it like this and it will work, but if you are expecting something else then let us know.
Regards,
Mahesh
Help for this Page
Return type of an Apex action method must be a PageReference. Found: core.apexpages.el.adapters.ApexListELAdapter
public void getperformcallout() so that it will comeback to the same page and reRender some of the components.
Regards,
Mahesh