如何在单页中显示多个Rich:DataTable?

时间:2017-07-31 10:16:21

标签: jsf-2 richfaces

我想基于数据在一个页面中显示富数据表的动态数量,所以我在做什么,在c:foreach循环ui:include指向datatable.xhtml。但结果我只得到一个数据table.any解决方案将不胜感激..

示例代码:

<c:forEach items="#{bean.list}" var="item">
<ui:include src="/dataTable.xhtml" >
<ui:param name="values" value="#{item.value}" />
<ui:param name="some other values" value="#{item.key}" />
</ui:include>
</c:forEach>

1 个答案:

答案 0 :(得分:0)

不要使用public class Google extends Fragment { public WebView myWebView; public static Google newInstance() { Googlefragment = new Google(); return fragment; } public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.webview, container, false); myWebView = (WebView) rootView.findViewById(R.id.WebViewLayout); myWebView.loadUrl("http://google.com/"); //*Ativar JavaScript WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); //*Forçar links para abrir no WebView ao invés do navegador myWebView.setWebViewClient(new WebViewClient()); return rootView; } ,而是使用JSF组件进行循环。例如<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <WebView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/WebViewLayout"/>

c:forEach

其他替代方案可以是rich:dataGrid

<rich:dataGrid columns="3" var="res" value="#{chProfile.clubItems}">
    <h:panelGroup layout="block" style="width:300px;">
        <rich:dataTable style="width: 100%">
            <rich:column id="item">
                <f:facet name="header">
                    <h:outputText value="#{res.promoName} Club" />
                </f:facet>
            </rich:column>
        </rich:dataTable>
        <h:outputText value="#{res.freeItemsReceived} free #{res.freeItemsReceived == 1 ? 'item' : 'items'} received during this calendar month" /><br />
    </h:panelGroup>
</rich:dataGrid>