Hi Suresh,Thanks for your help.I will test your code and I let you know if it work.Best RegardsRafael Hi You can pass the value by using ActionFunction . Here is some code you can refer ... This is a small page which contains one pickList field ie Type... when you will choose "Other" from that Field an section is rendred which contains only hello..
here is my page..
<apex:page controller="Mycontrollernew">
<script type="text/javascript">
function Callmefunc(id)
{
alert(''+id);
var type = document.getElementById(id).value;
alert(type);
check(type);
//return true;
}
</script>
<apex:form >
<apex:actionFunction name="check" action="{!makingfield}" reRender="refresh">
<apex:param name="Mahavir" value="" />
</apex:actionFunction>
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!account.Type}" id="check" onchange="Callmefunc('{!$Component.check}');">
</apex:inputField>
</apex:pageBlockSection>
<apex:outputPanel id="refresh" >
<apex:outputPanel rendered="{!readonly=='true'}" >
helooooo
</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller class
public class Mycontrollernew {
public Account account{get;set;}
public String act{get;set;}
public String readonly {get;set;}
public Mycontrollernew(){
}
public void makingfield() {
act =System.currentPageReference().getParameters().get('Mahavir');
System.debug('!!!!!!!!!!!!!!!!!!!asish!!!!!!!!!!!!!LeadType!!!!!!!!!!!!!!!!!'+act);
if(act=='Other') {
readonly = 'true';
}
}
}
2 answers