- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个 tabView,其中每个选项卡都包含一个数据表。我是这样设置的
<p:tabView id="tabView" styleClass="manage-tab-view" prependId="false"
activeIndex="#{managementTabBean.activeIndex}" dynamic="true" cache="false">
<p:tab id="users" title="#{msg['TeamManagement.Tabs.Users']}" >
<ui:include src="tab1.xhtml" />
</p:tab>
<p:tab id="athletes" title="#{msg['TeamManagement.Tabs.Athletes']}">
<ui:include src="tab2.xhtml" />
</p:tab>
</p:tabView>
在每个选项卡中,我试图显示一个数据表。现在我把它设置成这样:
标签 1:
<h:form id="userProfileViewForm" prependId="false">
<p:dataTable var="userProfile" value="#{userProfileListBean.objects}"
id="userProfilesTable" sortBy = "#{userProfile.lastName}" sortFunction = "#{userProfileListBean.sortUserLastName}" sortOrder = "ascending" lazy="true">
<p:column sortBy="#{userProfile.lastName}" sortFunction = "#{userProfileListBean.sortUserLastName}" id="userName">
p:commandLink>
<p:commandLink rendered="#{!appContextBean.isCWContext()}"
onclick="window.location.href='userBS.xhtml?id=#{userProfile.id}'">
<div class="clickable-cell">
<h:outputText
value="#{userProfile.firstName} #{userProfile.lastName}" />
</div>
</p:commandLink>
</p:column>
...more columns...
Tab2:相似数据表
<p:dataTable var="athlete" value="#{athleteListBean.objects}"
tableStyle="width:auto" sortBy="#{athlete.getDisplayName()}" sortFunction = "#{athleteListBean.sortAthleteDisplayName}" id="athletesTable"
sortOrder="#{athleteListBean.getListSortOrderDesc()}" lazy="true" paginator="true" rows="15" paginatorPosition="bottom"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}">
<p:column sortBy="#{athlete.getDisplayName()}" sortFunction = "#{athleteListBean.sortAthleteDisplayName}" id="athleteColumn">
<h:outputText styleClass="athlete-listing athlete-name" value="#{athlete.firstInitial} #{athlete.lastName}" />
</p:column>
如您所见,我为两个数据表设置了自定义初始排序函数。
由于某种原因,第一个选项卡排序函数被调用,而第二个选项卡排序函数没有。在我交换选项卡 View 中的选项卡后,tab2 排序函数被调用,但 tab1 没有。
基本上仅在第一个选项卡的数据表上调用初始排序函数,基于选项卡 View 中选项卡的顺序。谁能告诉我为什么会这样?
感谢您的帮助。
最佳答案
我有一个类似的问题,在我的例子中,第二个选项卡上有一个 p:dataTable 和 p:columnToggler,点击按钮隐藏或显示列显示为黑色,无法删除列。
我找到的解决方案是在 p:TabView 中的 p:ajax 中添加事件“tabChange”
这样问题就解决了,我已经在 p:columnToggler 上正常工作了。
也许您解决了 p:dataTable 的顺序问题。
这里是我的代码:
<p:tabView effect="fade" effectDuration="fast" prependId="false">
<p:ajax event="tabChange" update="@this"/>
<p:tab title="#{text['liquidacionForm.tabDatosLiq']}">
<ui:include src="/datosLiquidacion.xhtml"></ui:include>
</p:tab>
<p:tab title="#{text['liquidacionForm.tabEstanciasLiq']}">
<ui:include src="/estanciasLiquidadas.xhtml"></ui:include>
</p:tab>
</p:tabView>
关于java - Tabview 中的 Primefaces 数据表 - 第二个选项卡上的初始排序不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16700845/
我在那个 tab view 里面有一个 tab view,在那个 tab view` 里面有另一个 tab view,还有一个警告框。当我尝试打开它时,我的应用程序被强制关闭。 但同样的 AlertD
在 SwiftUI 中,TabView 必须是 Root View 。因此,您不能使用 NavigationLink 导航到 TabView。比如说我的应用程序中有四个屏幕。 屏幕 A 是一个包含屏幕
我有这门课: class PageViewModel:ObservableObject { @Published var cars = [Car]() func delete(_ ca
有没有办法在 TabView 中禁用透明度为 iOS 15 ?如果我的 List没有填满整个屏幕 TabView背景是透明的,我希望始终显示 TabView背景。 最佳答案 感谢@Asperi 为我指
我目前在我的应用程序上面临 pb。我想为由 SwiftUI TabView 控制的项目的插入和删除设置动画。 这是我能想到的最简单的重现问题的 View struct ContentView: Vie
我有一个 TabView SwiftUI 中有两个标签生命周期应用,其中一个具有复杂的 View 结构:NavigationView里面有很多 subview ,即:NavigationLink s
我认为我错过了一些简单的东西,但我无法弄清楚它到底是什么。 我正在尝试使用 UITabViewController 设置一个应用程序,其中一个选项卡将具有 UITableView 和 UISearch
我正在使用 TabVIew,我有两个问题: 1.如何去除 TabView 标题的边框底部? 2. 如何在 TabView 标题中的项目之间添加分隔符? 谢谢, 陈 最佳答案 您既不能删除底部颜色,也不
我有一个简单的 TabView: TabView { NavigationView { VStack { NavigationLink(destinat
我创建了一个带有多个选项卡的应用程序,每个选项卡都有一个 webview。 我的网页 View : struct WebView : UIViewRepresentable { let req
我想创建一个 Activity,它在顶部有一个标题,在它下面有一个 TabHost。这是我的 XML 文件中的内容
我刚刚开始使用 Nativescript,所有这些工作给我留下了深刻的印象! 作为将 VueJS Web 应用程序迁移到移动设备的项目的一部分,我正在尝试使用 tabview 并理解这一点。我似乎无法
我在 TabView 类中有这段代码: package jungle.timer; import com.example.jungletimer.R; import android.os.Bundle
我想在运行时在 android 中单击该选项卡来更改选项卡 View 。 当我在“收藏夹”选项卡中单击时,此选项卡图像会自动像“主页”选项卡一样。 请帮助我。 像这样之前 之后 请举例... 提前致谢
我需要使用 java 代码在运行时创建选项卡 View 。 注意: 不使用 xml 设计 最佳答案 在 XML 中创建 TabHost、TabWidget,然后在运行时添加 TAbHost.TabSp
我正在尝试在操作栏中创建一个自定义选项卡 View ,如下所示: 我得到了这个观点: 我想改变 tabviews 指示器的背景,这样背景颜色就变得不可见,我们在选定的 tabview 指示器下有一条绿
我可以在工具栏中创建选项卡 View ,就像应用程序照片 (Yosemite) 一样吗?我只想要一个分段按钮,没有图像。我尝试将 TabView Controller 的样式设置为“工具栏”,但它也会
我想使用 PrimeFaces TabView 组件在选项卡中显示来 self 们服务器的数据。我需要三个选项卡来显示具有不同数据的三个表。 如果我这样写就可以了: // logic
我已经完全改变了我的代码。但是事件索引仍然显示出问题。有时它会被调用,有时它不会。 下面的 xhtml 代码有什么问题? Admin Panel
SwiftUI 中的 View 默认具有透明背景。这通常意味着它们具有白色背景,因为这是您应用的默认背景颜色。但是,这也意味着您可以使用 ZStack更改整个应用程序的背景颜色,除非您明确设置自己的背
我是一名优秀的程序员,十分优秀!