You need to sign in to do that
Don't have an account?
sooraj kesavadas
displaying multiselect picklist in a community vf page
I have four multi select picklists inside the contact object and I am trying to display them to the community user so that they can select as needed. The vf page I have used is:
and my controller is:
The fields are displaying in the correct fashion but out of two pick lists I have queried, I can only see one of them in the community and even that partially. What am I doing wrong in displaying the pick lists? This is the picture of my community page:
Any advice is very much appreciated.Thank you!
<apex:page standardcontroller="contact" showheader="false" extensions="ContactEditpageController"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script> <script> $j = jQuery.noConflict();</script> <apex:form > <apex:pageBlock id="pb1" mode="edit"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> </apex:pageBlockButtons> <apex:pageMessages /> <apex:pageBlockSection title="Edit Address" columns="2"> <apex:inputField value="{!myContact.MailingStreet}"/> <apex:inputField value="{!myContact.MailingCity}"/> <apex:inputField value="{!myContact.MailingState}"/> <apex:inputField value="{!myContact.MailingPostalCode}"/> <apex:inputField value="{!myContact.MailingCountry}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Interest" columns="1"> <apex:inputField value="{!myContact.News__c}"/> <apex:inputField value="{!myContact.Research__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form>
and my controller is:
public with sharing class ContactEditpageController { public contact myContact { get; set; } public ContactEditpageController(ApexPages.StandardController controller) { user loggdinUserRecord=[select ContactId from user where id=:userinfo.getuserid()]; myContact=[select id,email,MobilePhone,account.id,News__c,Research__c,HomePhone,FirstName,LastName,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry from contact where id =:loggdinUserRecord.contactid]; } public pagereference save(){ PageReference pageRef = new PageReference('/apex/ContactEditPage'); try{ update myContact; ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM,'Contact detail updated.Thank you!')); }catch(exception e){ ApexPages.addMessages(e); pageRef=null; } return pageRef;}}
The fields are displaying in the correct fashion but out of two pick lists I have queried, I can only see one of them in the community and even that partially. What am I doing wrong in displaying the pick lists? This is the picture of my community page:
Any advice is very much appreciated.Thank you!