Comments (31)
Thanks for sharing. Do you have a question or a problem you want to ask me about?
from apex-mdapi.
IMPORTANT REQUEST: When you share source code it is not easy to read and makes it harder for me to help you. Please read this and make sure by clicking the Preview tab when making requests that your question and source code is readable.
from apex-mdapi.
Hi Andrew Fawcett,
Below link i pasted my code
please help me..........
from apex-mdapi.
I am sorry, this time i have no idea at all what you want help with??? You just keep sending me really badly formatted code and what look like statements of requirements? You don't tell me what you have been trying, what errors your getting or anything? Sorry if I am missing something?
from apex-mdapi.
Hi Andrew Fawcett,
That code success but small problem.I try to display all multipicklists Dynamically as checkboxes in an visualforce page Dynamically.I got checkboxes but multipicklists and checkboxes both display on visualforce page.I want only Multipicklist related fieldname with checkboxes.
help me.......
from apex-mdapi.
Still trying to understand your problem, can you share screenshots, with arrows pointing to the problem?
from apex-mdapi.
Hi andrew Fawcett ,
Thank you for Reply
I want to only Multipicklists Field Name and checkboxes
from apex-mdapi.
Please put 4 space characters in front of every line when you past code, notice how in your last response the code is leaking out of the grey box?
from apex-mdapi.
I think you needed to use the 'rendered' attribute on the apex:inputField to conditionally hide it when the field is a multi-picklist type.
from apex-mdapi.
Hi andrew Fawcett,
Without using fieldset I displayed all fields dynamically .I will use rerender means all fields will be hide
page like:
apex:repeat value="{!listObjectFields}" var="fieldAPIName" >
<apex:inputField value="{!sObjectToBind[fieldAPIName]}" style="" rendered="{!Render}">
<apex:selectCheckboxes value="{!checkboxSelections}" layout="PageDirection" >
<apex:selectOptions value="{!MyCheckboxes}"/>
/apex:selectCheckboxes
/apex:inputField
public list selectOption getMyCheckboxes(){
string objectname ='rajesh__MForm__c';
list SelectOption options = new list SelectOption ();
Schema.sObjectType objType = sObjectToBind.getSObjectType();
Schema.DescribeSObjectResult objDescribe = objType.getDescribe();
map String, Schema.SObjectField fieldMap = objDescribe.fields.getMap();
for(Schema.SObjectField field : fieldMap.values())
{
Schema.DescribeFieldResult fieldResult = field.getDescribe();
if(fieldResult.getType() == Schema.DisplayType.MultiPickList)
{
Schema.Picklistentry[] values = fieldResult.getPickListValues();
Map String, String> picklists = new Map String, String ();
for(Schema.Picklistentry val: values)
{
picklists.put(val.getLabel(), val.getValue());
fieldpicklists.put(fieldResult.getName(), picklists);
options.add(new SelectOption(val.getValue(), val.getLabel()));
}
}
}
return options;
}
from apex-mdapi.
I am talking about using the rendered attribute not the rerender attribute.
Something likes this...
<apex:repeat value="{!listObjectFieldInfoList}" var="fieldInfo">
<apex:selectCheckboxes value="{!checkboxSelections}" layout="PageDirection" rendered="{!fieldInfo.IsMultiSelectPickList==true}">
<apex:selectOptions value="{!MyCheckboxes}"/>
</apex:selectCheckboxes>
<apex:inputField value="{!sObjectToBind[fieldInfo.fieldAPIName]}" rendered="{!fieldInfo.IsMultiSelectPickList==false}"/>
</apex:repeat>
For this to work you will need to expose an Apex list not just a list of String list fields.
In your controller...
public class FieldInfo
{
String fieldAPIName {get;set;}
Boolean IsMultiSelectPickList {get;set;}
}
public List<FieldInfo> listObjectFieldInfoList {get;set;}
from apex-mdapi.
Hi andrew Fawcett,
Using above code I tried. I got checkboxes but remaining fields not visible only repeated checkboxes without field name visible on my page .I want display all fields in an visualforce page but Insted of multipicklists Fields place checkboxes Dynamically How?
help me..............
from apex-mdapi.
Are you also setting IsMultiSelectPickList to false when the field is not a multi-select pick list type?
from apex-mdapi.
You might also want to try something like this...
<apex:pageBlockSection title="Fields" columns="2">
<apex:repeat value="{!listObjectFieldInfoList}" var="fieldInfo">
<apex:pageBlockSectionItem rendered="{!fieldInfo.IsMultiSelectPickList==true}">
<apex:outputLabel value="{!fieldInfo.label}"/>
<apex:selectCheckboxes value="{!checkboxSelections}" layout="PageDirection">
<apex:selectOptions value="{!MyCheckboxes}"/>
</apex:selectCheckboxes>
</apex:pageBlockSectionItem>
<apex:inputField value="{!sObjectToBind[fieldInfo.fieldAPIName]}" rendered="{!fieldInfo.IsMultiSelectPickList==false}"/>
</apex:repeat>
</apex:pageBlockSection>
from apex-mdapi.
I also spotted a bug, you need to locate the checkboxSelections and MyCheckboxes fields within the each FieldInfo class, so you can support having multiple multi-picklist fields on your object.
<apex:pageBlockSection title="Fields" columns="2">
<apex:repeat value="{!listObjectFieldInfoList}" var="fieldInfo">
<apex:pageBlockSectionItem rendered="{!fieldInfo.IsMultiSelectPickList==true}">
<apex:outputLabel value="{!fieldInfo.label}"/>
<apex:selectCheckboxes value="{!fieldInfo.checkboxSelections}" layout="PageDirection">
<apex:selectOptions value="{!fieldInfo.MyCheckboxes}"/>
</apex:selectCheckboxes>
</apex:pageBlockSectionItem>
<apex:inputField value="{!sObjectToBind[fieldInfo.fieldAPIName]}" rendered="{!fieldInfo.IsMultiSelectPickList==false}"/>
</apex:repeat>
</apex:pageBlockSection>
from apex-mdapi.
I am afraid that is all the help i can give you today and I will be quite busy for the next few days.
Please also check out this web site, where there is lots of Salesforce help...
from apex-mdapi.
Hi Andrew Fawcett,
I got following error after using above code
Here My code is there below link
https://github.com/mahesh10811f0011/apex-mdapi/blob/master/Multipicklists%20%20checkboxes
Please send me
[email protected]
from apex-mdapi.
The Visualforce page code here does not look like the examples i've given you?
from apex-mdapi.
Hi Andrew Fawcett,
Thai is old code Now i added that location
https://github.com/mahesh10811f0011/apex-mdapi/blob/master/Multipicklists%20%20checkboxes
from apex-mdapi.
Your always passing true?
listObjectFieldInfoList.add(new FieldInfo(fieldResult.getName(),TRUE,fieldResult.getLabel()));
You need to pass true for multi select picklist fields and false for all others.
from apex-mdapi.
Your also not populating MyCheckboxes in your FieldInfo class.
from apex-mdapi.
Please at least try to debug your code.
from apex-mdapi.
Hi afawcett ,
This i completed means I complete my metadata project.Not now i try to different ways (from one week to )i saw in debug also but debug logs i removed on that code
from apex-mdapi.
Hi afawcett,
please help me.........
from apex-mdapi.
Have you tried my last two suggestions?
from apex-mdapi.
Hi Andrew Fawcett,
i try to if and else coditions , In if condition i gave when multiselectpicklist came change these picklists values are checkboxes ,In else condition Multipicklists all disabled and remaining fields i gave True.But there is no result.I con't able to populate MyCheckboxes in my apex class
from apex-mdapi.
Hi, sorry for the late response, are you still struggling with this?
from apex-mdapi.
YES
from apex-mdapi.
I'm not sure how i can help you, i am finding it really hard to understand at this point.
I also don't have a lot of time to debug your code for you.
I can only give you suggestions of things to try, but at the moment i don't have any more suggestions.
I know this is not an issue with the Apex Metadata API and more to do with your Visualforce page and code, so I will close this issue.
I can still try to help you here though, just not sure how at this time...
from apex-mdapi.
Hi Andrew,
I need to show display the pageblocksection based on multiselect picklist chosen.
Say for the example, I have the multipicklist field in contact object, where the values are one, two, three.
Whenever i choose "One" Option corresponding page block must be showned.
<apex:page standardController="Contact" showHeader="false">
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!contact.Choose_Number__c}">
<apex:actionSupport event="onchange" reRender="ppc" />
</apex:inputField>
</apex:pageBlockSection>
<apex:pageBlockSection title="PPC Test" id="ppc" rendered="{!contact.Choose_Number__c == 'PPC'}">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Could you help me to achieve this?
from apex-mdapi.
@yuvrajdeveloper this is not the correct issue, nor the correct repository to be asking this type of general vf question. I have however in this instance, responded to your other issue, lets continue chatting on that one.
from apex-mdapi.
Related Issues (20)
- MetadataServiceExamples outdated
- Test Class For MetadatadeolpyController Class
- Help article to use named credentials with wrapper has been removed HOT 1
- Generate an Apex from WSDL
- GlobalValueSetTranslation HOT 2
- Update search layout task, event, activity HOT 1
- System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element customizeSetup
- Apex Wrapper Metadata API Takes Time to Reflect the Change
- Can't create in production org
- Can't create a sharing rule HOT 2
- GlobalValueSetTranslation
- Can we create ApexClass natively? Any Example? HOT 1
- UserInfo.getSessionId() makes this unusable in packaged code HOT 2
- How do we update multiple profiles at once?
- LightningComponentBundle (LWC): reading/creating/updating
- Creating Apex Trigger
- Creating a MultiPicklist HOT 2
- System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element includeRecordsOwnedByAll
- How To get Picklist Value according to record type for a custom object HOT 3
- Can anyone suggest on how to read the flexipage? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apex-mdapi.