function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kakasaheb EKKakasaheb EK 

Dependent pick-list demo using Field set not displaying(hiding value) second value..??

Hi All,
I have created "Electronic_Device__c" as cusom object and added two picklist in that.
1.Device Type(Master Picklist)
2.Device_Name__c

VF Page Code
 <apex:page controller="FieldSetTest" tabStyle="Product2">
  <apex:form >
       <apex:pageBlock >
            <apex:pageBlockSection title="Device Details" collapsible="False" columns="1">
                <apex:repeat value="{!$ObjectType.Electronic_Device__c.FieldSets.Device_Field_Set}" var="f"> 
                    <apex:inputField required="{!f.Required}" value="{!device[f]}" />
                </apex:repeat>
            </apex:pageBlockSection>
       </apex:pageBlock>
    </apex:form>
</apex:page>

Controller code:-

public class FieldSetTest{
 public Electronic_Device__c device { get; set; }
     
 public FieldSetTest(){
     device = new Electronic_Device__c();
 }
}


I am able to acheive 90% percent but when I running tha page output display this way...
Not visible Device name...why..??
Martijn SchwarzerMartijn Schwarzer
Hi Sachin,

Why not just list the fields?
 
<apex:page controller="FieldSetTest" tabStyle="Product2">
  <apex:form >
       <apex:pageBlock >
            <apex:pageBlockSection title="Device Details" collapsible="False" columns="1">
                <apex:inputField value="{!device.Device_Type__c}" />
                <apex:inputfield value="{!device.Device_Name__c}" />
            </apex:pageBlockSection>
       </apex:pageBlock>
    </apex:form>
</apex:page>

Hope this helps!

Best regards,
Martijn Schwärzer

Ps. If my answer helped you, please mark it as best answer. It will help others find best answer as well.