关于由于session 和 request设置在dialog中初始化的问题.

本文探讨了使用ADF(ADF Faces)中的af:switcher组件进行页面元素切换时遇到的问题,特别是在对话框中配置af:switcher组件,并尝试通过按钮触发状态改变时出现的行为不符合预期的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

代码如下:

 

        <af:commandButton text="display">
          <af:showPopupBehavior popupId="popupId" triggerType="action"/>
        </af:commandButton>
        <af:popup id="popupId" contentDelivery="lazyUncached"
                  binding="#{switchFacet.deletePopup}">
          <af:dialog title="Delete report set" type="okCancel"
                     closeIconVisible="true"
                     inlineStyle="width:400px; height:200px; margin:auto; padding:inherit;"
                     visible="true" dialogListener="#{switchFacet.initialize}" >
            <af:panelGroupLayout layout="vertical" partialTriggers="hhh">
              <af:panelGroupLayout partialTriggers="hhh">
                <af:switcher defaultFacet="three"
                             facetName="#{switchFacet.facetName}">
                  <f:facet name="one">
                    <af:group>
                      <af:outputText value="This is facet:one 1 1 1 1 1 1 1 1 1"/>
                      <af:outputText value="[#{ switchFacet.facetName},]"/>
                      <af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
                                                label="Label 1"/>
                    </af:group>
                  </f:facet>
                  <f:facet name="two">
                    <af:outputText value="This is facet:two 2 2 2 2 2 2 2"/>
                  </f:facet>
                </af:switcher>
              </af:panelGroupLayout>
              <af:spacer width="10" height="10"/>
              <af:panelGroupLayout>
                <af:commandButton text="yes" partialSubmit="true" id="hhh"
                                  action="#{switchFacet.setFacet}"
                                  visible="#{switchFacet.isDisplay}"/>
                <af:commandButton text="ok" visible="#{switchFacet.isOkDisplay}"
                                  action="#{switchFacet.initializeState}"/>
                <af:commandButton text="no"
                                  visible="#{switchFacet.isNoDisplay}"/>
              </af:panelGroupLayout>
            </af:panelGroupLayout>
          </af:dialog>
        </af:popup>
  

scope为session时似乎switchFacet.initialize不会被执行,dialog关闭后也不会初始化,request时可以初始话

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值