+ Start a Discussion
Sandip458Sandip458 

Is it possible to call javascript function from "Rendered" attribute

Hello All,

 

Is it possible to call javascript function from "Rendered" attribute of pageblock section item..

 

 

 

 

 

 

 

Thanks,

Sandip

Ron HessRon Hess

no place to specify your call , but it sounds like you are looking for onrendered="JSCODE"

 

i think you can just put a script block inside your panel that will be rendered, that should allow your code to run after the page rerenders that section.

Sandip458Sandip458

Thanks Ron for your reply.

 

I am looking for solution like I have two drop down list  "Visa Status"  which has two values Yes & No

I f will select Yes then Visa Type drop down list should be rendered  & populate just below  the Visa status drop down list .

And if I will select NO then Visa Type drop down should not be rendere.

 

 

Please suggest me the better  approch ..

 

 

 

 

 Regards,

Sandip

 

iceberg4uiceberg4u

I think you could do this

<apex:outputPanel rendered="{!showStatesList=true}">
                                                            <apex:selectList value="{!states}" multiselect="false"
                                                                size="1" styleClass="list_box" style="width: 195px;" >
                                                                <apex:selectOptions value="{!statesList}"
                                                                    id="states1" />
                                                            </apex:selectList>
                                                           
                                                        </apex:outputPanel>
                                                       
                                                        <apex:outputPanel rendered="{!showStatesList=false}">
                                                           
                                                            <apex:inputText value="{!company.StateName__c}" styleClass="txt_box"
                                                            maxlength="30" onblur="this.value=this.value.trim()"/>
                                                        </apex:outputPanel>