SF :Salesforce中,reRender控件和rendered控件的使用

来源:互联网 发布:餐饮电脑收银软件 编辑:程序博客网 时间:2024/06/04 18:17

reRender:

    用途:局部刷新

    这个属性的value值是组件的ID,可以是一个或多个ID,多个ID用','隔开。

rendered:

    用途:可以控制一个控件是页面上是否能显示出来。

    这个属性的value是一个Boolean值。如果是true,控件会在页面上显示,否则,不会在页面上显示。


reRender与rendered的联合使用:

    不能在一个控件中,写reRender和rendered两个属性。要把控件显示不显示的控件放在局部刷新的控件里面。


eg:

<apex:form >

        

        <apex:pageBlock title="Condition">

            <apex:pageBlockSection columns="2">

            <apex:outputPanel title="Account">

                <apex:outputLabel value="Account: "></apex:outputLabel>

                <apex:selectList value="{!optionAcc}" size="1" style="width:230px">

                    <apex:selectOptions value="{!optionAccList}"></apex:selectOptions>

                    <apex:actionSupport event="onchange" action="{!searchAccOppList}" reRender="oppId, contentId"/>

                </apex:selectList>

            </apex:outputPanel>

            

            <apex:outputpanel title="Opportunity" id="oppId">

                <apex:outputLabel value="Opportunity: "></apex:outputLabel>

                <apex:selectList value="{!optionOpp}" size="1" style="width:230px">

                    <apex:selectOptions value="{!optionOppList}"></apex:selectOptions>

                    <apex:actionSupport event="onchange" action="{!searchOppContentList}" reRender="contentId"/>

                </apex:selectList>

            </apex:outputpanel>

        </apex:pageBlockSection>

            

        </apex:pageBlock>

        

        <apex:outputPanel id="contentId">

            <apex:pageBlock title="Content" rendered="{!showContentVersion}">

......



本文出自 “prodigal_k” 博客,请务必保留此出处http://919637235.blog.51cto.com/7344598/1529929

0 0
原创粉丝点击