VisualForce 中未触发事件

发布于 2024-08-30 16:27:15 字数 1231 浏览 5 评论 0原文

在下面的页面中,Topic__c 是一个单选选项列表。我的目的是让这个列表控制下面哪些输入字段可用。用户选择一个选项,onchange 事件应该触发,并重新呈现字段。

<apex:inputField value="{!Call_Report__c.Topic__c}" id="topic" > 
           <apex:actionSupport event="onchange" reRender="tickerInput,sectorInput,bondInput">  
             <apex:param name="topicSelection" value="{!Call_Report__c.Topic__c}" /> 
            </apex:actionSupport> 
 </apex:inputField>
<apex:inputField value="{!Call_Report__c.Tickers__c}" rendered="{!Call_Report__c.Topic__c='Issuer'}" id="tickerInput" />
<apex:inputField value="{!Call_Report__c.Sector__c}" rendered="{!Call_Report__c.Topic__c='Industry'}" id="sectorInput"/> 
<apex:inputField value="{!Call_Report__c.Security__c}" rendered="{!Call_Report__c.Topic__c='Specific Bond'}" id="bondInput" />

我在这里做明显错误的事情吗? http://community.salesforce.com/t5/Visualforce-Development/Multi-select-picklist-not-firing-event-for-AJAX-refreshes/mp/173572/highlight/false#M22119< /a> 似乎暗示我所做的事情是合理的......

In the page below,Topic__c is a single-select picklist. My intention is to have this list control which of the input fields is available below. The user selects an option, and the onchange event should fire, and rerender the fields.

<apex:inputField value="{!Call_Report__c.Topic__c}" id="topic" > 
           <apex:actionSupport event="onchange" reRender="tickerInput,sectorInput,bondInput">  
             <apex:param name="topicSelection" value="{!Call_Report__c.Topic__c}" /> 
            </apex:actionSupport> 
 </apex:inputField>
<apex:inputField value="{!Call_Report__c.Tickers__c}" rendered="{!Call_Report__c.Topic__c='Issuer'}" id="tickerInput" />
<apex:inputField value="{!Call_Report__c.Sector__c}" rendered="{!Call_Report__c.Topic__c='Industry'}" id="sectorInput"/> 
<apex:inputField value="{!Call_Report__c.Security__c}" rendered="{!Call_Report__c.Topic__c='Specific Bond'}" id="bondInput" />

Am I doing something obviously wrong here? http://community.salesforce.com/t5/Visualforce-Development/Multi-select-picklist-not-firing-event-for-AJAX-refreshes/m-p/173572/highlight/false#M22119 seems to imply that what I am doing is reasonable...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如痴如狂 2024-09-06 16:27:15

我很确定您需要在比这更高的级别重新渲染,例如 的级别或

I'm pretty sure you need to rerender at a higher level than that, like at the level of an <apex:outputPanel id="thePanel"> or an <apex:page id="thePage">

赠佳期 2024-09-06 16:27:15

我同意。尝试将代码包装在 outputPanel 中并重新渲染。

I agree. Try wrapping your code in an outputPanel and rerendering that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文