Another Salesforce blog!!!

Salesforce, Apex

October, 2016

Cascading dropdownlist

<apex:page controller=”parentchildController2″> <apex:form > <br/> <apex:pageBlock id=”pb” title=”Cascading dropdownlist”> ParentID Selected: {!parentValue} <br/> Child Id Selected: {!contactValue} <br/> <apex:selectList value=”{!parentValue}” size=”1″ style=”width:175px;”> <apex:selectOptions value=”{!ParentOptions}” /> <apex:actionSupport event=”onchange” reRender=”pb” /> </apex:selectList> <br/><br/> <apex:selectList value=”{!contactValue}” size=”1″ id=”contacts” style=”width:175px;”> <apex:selectOptions value=”{!contactOptions}”/> <apex:actionSupport event=”onchange” reRender=”pb” /> </apex:selectList> </apex:pageBlock> </apex:form> </apex:page> Controller: public class parentchildController2 { public String contactValue {get;set;} […]

Dynamically Showing or Hiding Markup

Link Use CSS to toggle markup visibility. You could use the tag to do the same thing but we recommend using CSS as it’s the more standard approach. This example uses $A.util.toggleClass(cmp, ‘class’) to toggle visibility of markup. <!–c:toggleCss–> <aura:component> <ui:button label=”Toggle” press=”{!c.toggle}”/> <p aura:id=”text”>Now you see me</p> </aura:component> /*toggleCssController.js*/ ({ toggle : function(component, event, […]