gpt4 book ai didi

java - Adf高级 ListView

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:25 25 4
gpt4 key购买 nike

任何专家 adf java web 开发人员都可以提供帮助。此 ListView 是以编程方式从列表返回的,而不是模型中的默认集合。当添加任何按钮或任何操作 adf 组件或任何面板时,它不起作用。我怎样才能使 ot 起作用以使按钮操作起作用(列表项内的 b1)并显示弹出窗口??????

       <af:button text="button 5" id="b5" action="#{bean2.bttttttttttttest5}" immediate="true"/>

<af:listView value="#{bean2.filteredDataList}" var="item" shortDesc="wlmwqd"
emptyText=""
fetchSize="5" id="lv1" >
<af:listItem id="li1">
<af:panelGroupLayout id="pgl1">
<af:outputFormatted value="#{item.hotelName}" id="of1"/>


<af:outputFormatted value="#{item.price}" id="of2"/>
<af:panelGroupLayout id="pgl2">

<af:button text="button 6" id="b1">
<af:showPopupBehavior popupId="p1" triggerType="action"/>
</af:button>


<af:popup childCreation="deferred" autoCancel="disabled" id="p1">
<af:noteWindow id="nw1">
<af:button text="button 2" id="b2"/>
<af:button text="button 3" id="b3"/>
<af:button text="button 4" id="b4"/>
</af:noteWindow>
</af:popup>
</af:panelGroupLayout>
</af:panelGroupLayout>
</af:listItem>
</af:listView>
</af:form>

以及从列表中获取listview的按钮的.java文件代码:

public String bttttttttttttest5() {
List<Hotel>t=ami.getMaxHotelPrice(200);
filteredDataList=t;

return null;
}

最佳答案

首先,“bean2”的范围是什么。在您的情况下,它不能是“request”或“backingBeanScope”。尝试将其设为“viewScope”。另外,按钮默认具有“partialSubmit = true”,因此您需要在listView上放置一个partialTrigger。

这是一个应该可以工作的代码片段:

<af:button text="Run list" id="b1" action="#{viewScope.bean2.bttttttttttttest5}" immediate="true"/>
<af:listView value="#{viewScope.bean2.filteredDataList}" var="item" emptyText=""
fetchSize="5" id="lv1" partialTriggers="::b1">
<af:listItem id="li1">
<af:panelGridLayout id="pgl4">
<af:gridRow marginTop="5px" height="auto" marginBottom="5px" id="gr1">
<af:gridCell marginStart="5px" width="34%" id="gc1">
<af:outputFormatted value="#{item.hotelName}" id="of1"/>
</af:gridCell>
<af:gridCell marginStart="5px" width="33%" id="gc2">
<af:outputFormatted value="#{item.price}" id="of2"/>
</af:gridCell>
<af:gridCell marginStart="5px" width="33%" marginEnd="5px" id="gc3">
<af:panelGroupLayout id="pgl2">
<af:button text="button 6" id="b5">
<af:showPopupBehavior popupId="p1" triggerType="action"/>
</af:button>
<af:popup childCreation="deferred" autoCancel="disabled" id="p1">
<af:noteWindow id="nw1">
<af:button text="button 2" id="b2"/>
<af:button text="button 3" id="b3"/>
<af:button text="button 4" id="b4"/>
</af:noteWindow>
</af:popup>
</af:panelGroupLayout>
</af:gridCell>
</af:gridRow>
</af:panelGridLayout>
</af:listItem>
</af:listView>

关于java - Adf高级 ListView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48242556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com