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

Actions not working when SelectList is inside pageBlockTable or Repeat
SelectList put in table or repeat visualforce elements causes all controller methods to break. No errors are shown, however, the debug statements for methods that are called from the page are not showing. No javascript errors either.
When select list is substituted with any other element the row is successfuly added to the table, but when SelectList is there and it is not blank the new row is not added as well as other butons do not work on the page.
VFP:
CTR:

When select list is substituted with any other element the row is successfuly added to the table, but when SelectList is there and it is not blank the new row is not added as well as other butons do not work on the page.
VFP:
<apex:page controller="Test_Ctr"> <apex:form id="theForm"> <apex:pageBlock title="Filters"> <apex:pageBlockButtons location="bottom"> <apex:commandButton action="{!newFilter}" value="New Filter" rerender="theForm"/> <apex:commandButton action="{!testValues}" value="Test Values" rerender="theForm"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!ftsWrap}" var="row"> <apex:column> <!--apex:selectList value="{!row.fieldvar}" size="1"> <apex:selectOptions value="{!listOptions}"/> </apex:selectList--> <apex:selectList value="{!row.fieldvar}" size="1" > <apex:actionSupport event="onchange" reRender="theForm"/> <apex:selectOptions value="{!listOptions}"></apex:selectOptions> </apex:selectList> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
CTR:
public with sharing class Test_Ctr { public List <filtersWrap> ftsWrap {get;set;} public List <SelectOption> listOptions {get;set;} public Test_Ctr(){ System.debug('*****Test_Ctr()'); ftsWrap = new List <filtersWrap> (); //filtersWrap fw = new filtersWrap(); //ftsWrap.add(fw); newFilter(); listOptions = objectFieldsGetter(); System.debug('ftsWrap: '+ftsWrap); } public List<SelectOption> objectFieldsGetter() { String selectedObject = 'Task'; Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject); Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap(); List<SelectOption> fieldNames = new List<SelectOption>(); for (String fieldName: fieldMap.keySet()) { fieldNames.add(new SelectOption(fieldName,fieldName)); } return fieldNames; } public class filtersWrap{ public SelectOption fieldvar {get;set;} //public List <SelectOption> fields {get;set;} } public void newFilter(){ System.debug('*******newFilter()'); filtersWrap fw = new filtersWrap(); //fw.fields = objectFieldsGetter(); System.debug('fw: '+fw); System.debug('ftsWrap: '+ftsWrap); ftsWrap.add(fw); System.debug('ftsWrap: '+ftsWrap); } public void testValues(){ System.debug('*******testValues()'); System.debug('ftsWrap: '+ftsWrap); } }
All Answers
The reason your functions are not getting called is because at runtime you are trying to convert a string to selectoption type.
I might be able to point you in the right direction if you can tell what exactly you are trying to achieve.