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

SelectList Value returns null
I'm am developing a visualforce page to take an original set of records (representing field mappings) and allow the user to change them using 'SelectLists'/'SelectOptions' and save them to new records. However, when I debug the page, I find that any 'SelectList' value that is changed using the drop-down on the page is null when I go to 'save()' the new records:
Controller:
public List<MeetingFieldMappings1__c> fieldMappings {get; set;} public void setupFieldMapping(){ if(fieldMappingEnabled){ // get the current field mappings List<MeetingFieldMappings1__c> mappings = new List<MeetingFieldMappings1__c>(); if(meeting != null){ mappings = [SELECT Id,Name,LeadField__c,ContactField__c,LeadAllowUpdates__c,ContactAllowUpdates__c,Meeting__c FROM MeetingFieldMappings1__c WHERE Meeting__c = :meeting.id LIMIT 25]; if(mappings.size() > 0){ mappingsExist = true; fieldMappings = mappings; } } // defaults mappingsExist = false; mappings = [SELECT Id,Name,LeadField__c,ContactField__c,LeadAllowUpdates__c,ContactAllowUpdates__c,Meeting__c FROM MeetingFieldMappings1__c WHERE Meeting__c = null LIMIT 25]; fieldMappings = mappings; } }
Page:
<apex:form> <div id="fieldMappingDialog" style="display: none;"> <apex:pageBlock > <table> <tr> <th>Meeting Member Field</th> <th>Lead Field</th> <th>Contact Field</th> </tr> <apex:repeat value="{!fieldMappings}" var="mapping"> <tr> <td><apex:outputField value="{!mapping.Name}" /></td> <td> <apex:selectList value="{!mapping.LeadField__c}" size="1" disabled="{!NOT(mapping.LeadAllowUpdates__c)}"> <apex:selectOptions value="{!leadFieldsPickList}" /> </apex:selectList> </td> <td> <apex:selectList value="{!mapping.ContactField__c}" size="1" disabled="{!NOT(mapping.ContactAllowUpdates__c)}"> <apex:selectOptions value="{!contactFieldsPickList}" /> </apex:selectList> </td> </tr> </apex:repeat> </table> </apex:pageBlock> </div> </apex:form>
What am I doing wrong?
What does the controller code look like for leadFieldsPickList and contactFieldsPickList?
Here is an example of the picklist values generator.
Sorry the first set of code is such a klug, it's hard to read. I've actually made a test page using the same code without any of the other elements on the page and it worked fine.
So I'm thinking it's another issue rather than I'm not creating the picklists correctly!
The issue seems to be: I am using a jQuery.dialog({}); function in jQuery UI and it is screwing up the form! I think I'll have to create a 2nd form and have it mirror the values in the dialog if i want this UI affect.