Adf高级listView

时间:2018-01-13 17:45:12

标签: java oracle-adf

任何专家adf java web Develop都可以帮助..这个列表视图是从列表中以编程方式返回的,而不是模型中的默认集合。添加任何按钮或任何动作adf组件或任何面板时,它都不起作用。我怎样才能让按钮动作有效(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;
}

1 个答案:

答案 0 :(得分:0)

首先,&#34; bean2&#34;的范围是什么?在你的情况下,它不能是&#34;请求&#34;或&#34; backingBeanScope&#34;。尝试制作它&#34; viewScope&#34;。此外,默认情况下该按钮具有&#34; partialSubmit = true&#34;,因此您需要在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>