You need to sign in to do that
Don't have an account?
mr209204
Dynamic Edit Page - Visual Force
I've created some visual force pages using this example
http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage
I've been able to create the example and some other pages successfully and replacing the input field from the drop down menu to check boxes which isn't too hard. I am now trying to create a page and trying to do this with a Multi-Select Picklist and it is not quite working. Any help is greatly appreciated.
This is what I have so far.
Contact_Type__c is the multi-select picklist
http://wiki.apexdevnet.com/index.php/Visualforce_DynamicEditPage
I've been able to create the example and some other pages successfully and replacing the input field from the drop down menu to check boxes which isn't too hard. I am now trying to create a page and trying to do this with a Multi-Select Picklist and it is not quite working. Any help is greatly appreciated.
This is what I have so far.
Contact_Type__c is the multi-select picklist
Code:
<apex:page standardController="Contact" tabStyle="Contact" > <apex:form > <apex:sectionheader title="Create New Contact"> <apex:actionregion > <apex:pageBlock title="Contact Information" id="thePageBlock" mode="edit"> <apex:pageBlockSection title="Basic Information" columns="1"> <apex:inputfield value="{!contact.firstName}" /> <apex:inputfield value="{!contact.lastName}" /> <apex:inputfield value="{!contact.MailingStreet}" /> <apex:inputfield value="{!contact.MailingCity}" /> <apex:inputfield value="{!contact.MailingState}" /> <apex:inputfield value="{!contact.MailingCountry}" /> <apex:inputfield value="{!contact.MailingPostalcode}" /> <apex:inputfield value="{!contact.Phone}" /> <apex:inputfield value="{!contact.MobilePhone}" /> <apex:inputfield value="{!contact.Fax}" /> <apex:inputfield value="{!contact.Email}" /> <apex:pageBlockSectionItem> <apex:outputLabel value="Contact Type"/> <apex:outputPanel > <apex:inputfield value="{!contact.Contact_Type__c}"> <apex:actionSupport event="onchange" rerender="thePageBlock"status="status1"/> </apex:inputfield> <apex:actionStatus startText="applying value..." id="status1"/> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:pageBlockSection title="Volunteer" Columns="1" rendered="{!contact.Contact_Type__c = 'Volunteer'}"> <apex:inputfield value="{!contact.Volunteer_Certifications__c}" /> </apex:pageBlockSection> </apex:pageBlockSection> </apex:pageBlock> </apex:actionregion> </apex:sectionheader> </apex:form> </apex:page>
mr209204 wrote:
with a Multi-Select Picklist and it is not quite working.
What does "not quite working" mean. I think a little more detail is required.
What I want to accomplish is...when I select an item and add it to the selected section on the mulit-select picklist more fields will show up. When I select another item the same happens. When I move the item back the fields that correspond to that selection go away. This is what I would like to figure out/get help on.
I've been able to do this with check boxes and if I cannot do this with a Mulit-select picklists then I will go back to using check boxes.
Any other suggestions?
This way you'll be firing AJAX events on the "invisible" outputPanel that contains your multi-select picklist, instead of the multi-select picklist itself.
For this to work, you'll probably also have to change the event type to "onmouseover", which will work much better than the other Java script events (like "onchange").
Also you cannot deselect the item after it is selected.
Message Edited by mr209204 on 09-02-2008 10:01 AM
Must the pageBlock id="thePageBlock"?
i used id="editblock" and it did not work, then I changed to "thePageBlock", it worked....
Something is missing?
I remember I did changed both places.... and it did not work...
Now I tried again with the different name, and it works.
Not sure why.