You need to sign in to do that
Don't have an account?
Issue with actionsupport inside a selectlist
Hi,
I have a requirement as once the objectname is selected from the selectlistoptions it has to display all its field names. I am trying to acheive this but the actionsupport is not calling the method in action(action="{!getfieldnames}").Please help.
VF page:
<apex:page controller="Workbenchlike" >
<style>
td{
text-align:center;
}
</style>
<apex:form >
<div style="text-align:center;font-size:20px">
Select from the list :-
<apex:outputPanel >
<apex:selectList size="1" value="{!selectedobj}" >
<apex:selectOptions value="{!selectobjs}"/>
<apex:actionSupport action="{!getfieldnames}" event="onchange" reRender="table"/>
</apex:selectList>
</apex:outputPanel>
</div>
<div style="text-align:center; font-size:15px">
<table id="table" >
<tr>
<td>
FieldNames:<br/>
<apex:selectList ></apex:selectList>
</td>
<td>
Selected Values:<br/>
<apex:selectList ></apex:selectList>
</td>
</tr>
</table>
</div>
</apex:form>
</apex:page>
Controller:
public class Workbenchlike {
public string selectedobj {get; set;}
public map<string, schema.sobjectType> selectobjs {get; set;}
public workbenchlike(){
selectobjs = schema.getGlobalDescribe();
system.debug('output is'+selectobjs);
system.debug('selectedobject' +selectedobj);
}
public void getfieldnames(){
system.debug('selectedobject' +selectedobj);
}
}
Thank you.
Regards,
Sujendran.
I updated the code and it is working check below code.
Apex Class Visualforce page
Kindly mark this as solved if the reply was helpful.
Thanks
Shaik
All Answers
I updated the code and it is working check below code.
Apex Class Visualforce page
Kindly mark this as solved if the reply was helpful.
Thanks
Shaik