首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >顶点:命令按钮内部顶点:panelBar

顶点:命令按钮内部顶点:panelBar
EN

Stack Overflow用户
提问于 2012-07-20 08:50:19
回答 2查看 983关注 0票数 1

我有一个在panelBar中显示的项目列表,每个项目都有一个调用控制器上的操作的comandButton,问题是该操作方法从未被调用!帮助?

代码如下:

代码语言:javascript
复制
<apex:panelBar id="eventBarSeller" switchType="client" items="{!relatedEventsSeller}" var="event" rendered="true">
    <apex:panelbarItem label="{!event.SUBJECT__c}">
        <apex:outputText escape="false" value="{!event.BODY__c}" />
        <br/>
        <br/>
        <apex:commandButton value="View details" action="{!showPopup}" rerender="popup" immediate="true" rendered="true"/>
    </apex:panelBarItem>
</apex:panelbar>

和弹出式outputPanel:

代码语言:javascript
复制
<apex:outputPanel id="popup">
       <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopup}"/>
            <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopup}">
                This is where I would put whatever information I needed to show to my end user.<br/><br/><br/>
                <apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="popup"/>
       </apex:outputPanel>
</apex:outputPanel>

在控制器中,我有以下内容:

代码语言:javascript
复制
public boolean displayPopup {get; set;}     

public void closePopup() {
    System.Debug(LoggingLevel.INFO, 'Close Popup...');
    displayPopup = false;    
}

public void showPopup() {
    System.Debug(LoggingLevel.INFO, 'Show Popup...');
    displayPopup = true;
}

因为我检查了日志,所以showPopup get函数从未被调用过,这会发生什么?提前感谢!

EN

回答 2

Stack Overflow用户

发布于 2012-07-20 13:19:10

暂时不确定,但您可以尝试将切换类型从客户端更改为服务器或ajax:

代码语言:javascript
复制
<apex:panelBar id="eventBarSeller" switchType="server/ajax" items="{!relatedEventsSeller}" var="event" rendered="true">

服务器和ajax switchTypes可能比客户端慢一点,但它应该可以可靠地处理服务器端的操作方法。rerender属性受此影响。来自VF开发人员指南:

票数 0
EN

Stack Overflow用户

发布于 2012-08-08 21:44:53

试试这个(对我有效):

页面:

代码语言:javascript
复制
<apex:form>

    <apex:panelBar>
        <apex:panelbarItem>
            <apex:commandButton value="View details" action="{!showPopup}" reRender="myPopup"/>
        </apex:panelBarItem>
    </apex:panelbar>

    <apex:outputPanel id="myPopup">
           <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopup}">
                    Your Information Here
           </apex:outputPanel>
    </apex:outputPanel>

</apex:form>

控制器:

代码语言:javascript
复制
public Boolean displayPopup { get; set; }

public PageReference showPopup() {
    System.Debug(LoggingLevel.INFO, 'Show Popup...');
    displayPopup = true;
    return null;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11571399

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档