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

Hi..iam geting the values in Developer console ,but unable to bind to the visualforce page
Hi..Onclicking of the data, iam getting the values of the particular selected data, but while rendering, it is not getting render do any one provide the solution for this.. thanks
Visualforce page:
Apex class:
how to display the data Onselecting the data..

Please provide your suggestions to render it dependig upon the selection .,
thanks
Deepika
Visualforce page:
<apex:page controller="testclass7" > <apex:form > <apex:actionFunction name="passValueToController" action="{!testvalues}" reRender="frm"> <apex:param name="selectedValue" value="selectedValue" assignTo="{!selectedValue}"></apex:param> </apex:actionFunction> <apex:repeat value="{!wrapclasslist}" var="a" > <li style="padding:5px;cursor:pointer;" onclick="passValueToController('{!a.value}'); return false;" > {!a.stateName} </li> </apex:repeat> <apex:outputPanel id="frm"> statename is: <apex:inputText value="{!wrpclas.stateName}"/> <br/><br/> value is: <apex:inputText value="{!wrpclas.value}"/> <br/><br/> active is: <apex:inputText value="{!wrpclas.active}"/> <br/><br/> </apex:outputPanel> </apex:form> </apex:page>
Apex class:
public class testclass7 { public list<wrapperclass> wrapclasslist{get;set;} public list<wrapperclass> wrapclassaddedlist {get;set;} public wrapperclass wrpclas{get;set;} public string selectedValue{get;set;} public testclass7 (){ wrapclasslist = new list<wrapperclass>(); wrapclassaddedlist = new list<wrapperclass>(); string teststring= ' { "sucess":1,"data": [ {"stateName": "Andrapradesh", "value": "apx" ,"active":"yes"}, { "stateName": "Telangana", "value":"tsx","active":"processing-no"}, {"stateName": "Banglore", "value": "bngx","active":"processing-yes"} , {"stateName": "Maharastra", "value":"mhx" , "active":"no" } ] } '; Map<String, Object> maptest = (Map<String, Object>) JSON.deserializeUntyped(teststring); system.debug('Afterdeserilizing the values are:'+maptest); Object ob = (Object)maptest.get('data'); system.debug('Afterdeserilizing get the data values are:'+ob); String srlze = System.JSON.serialize(ob); system.debug('done serilization of the values:'+srlze); wrapclasslist = (list<wrapperclass>)System.JSON.deserialize(srlze,list<wrapperclass>.class); system.debug('After binding to the wrapper class the values is:'+wrapclasslist); } /* public void testvalues(){ system.debug('for Datatable functionality:'+ selectedValue); for(wrapperclass e: wrapclasslist){ if(e.value==selectedValue){ wrapclassaddedlist.add(e); } } */ public void testvalues(){ system.debug('for Datatable functionality:'+ selectedValue); for(wrapperclass e: wrapclasslist){ if(e.value==selectedValue){ // wrpclas.add(e); system.debug(e); } } } public class wrapperclass{ public string stateName{get;set;} public string value{get;set;} public string active{get;set;} } }
how to display the data Onselecting the data..
Please provide your suggestions to render it dependig upon the selection .,
thanks
Deepika
You are binding correctly but getting null values in vf page because you are not assigning any value to wrapclas in apex.So it is displaying as null.Assign value to wrapclas.then it will work.
I added a line in testvalues().Try below code Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.
Thanks and Regards
All Answers
You are binding correctly but getting null values in vf page because you are not assigning any value to wrapclas in apex.So it is displaying as null.Assign value to wrapclas.then it will work.
I added a line in testvalues().Try below code Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.
Thanks and Regards