Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 JSF/Primefaces中的动态tabIndex属性_Jsf 2_Primefaces_Tabindex - Fatal编程技术网

Jsf 2 JSF/Primefaces中的动态tabIndex属性

Jsf 2 JSF/Primefaces中的动态tabIndex属性,jsf-2,primefaces,tabindex,Jsf 2,Primefaces,Tabindex,我面临一个JSF/Primefaces的问题。 我在JSF应用程序中的每个组件上使用tabIndex属性,以允许用户逐步浏览屏幕。 我编写了一些JSF复合组件来重用屏幕的各个部分。现在我有一个问题,这些组件中的tabIndex是“硬编码”的,因此如果我重用这些组件,tabIndex与其他组件冲突,并且tabing的顺序将不正确 例如: ComponentA: tabIndexes: 1,2,3 ComponentB: tabIndexes 1,2,3 ComponentC: tabI

我面临一个JSF/Primefaces的问题。 我在JSF应用程序中的每个组件上使用tabIndex属性,以允许用户逐步浏览屏幕。 我编写了一些JSF复合组件来重用屏幕的各个部分。现在我有一个问题,这些组件中的tabIndex是“硬编码”的,因此如果我重用这些组件,tabIndex与其他组件冲突,并且tabing的顺序将不正确

例如:

  ComponentA: tabIndexes: 1,2,3
  ComponentB: tabIndexes 1,2,3
  ComponentC: tabIndexes: 4,5,6

  ScreenA: Components: A,C --> no problem, because every tabIndex is unique.
  ScreenB: Components: B,C --> no problem, because every tabIndex is unique.
  ScreenC: Components: A,B,C --> problem, because of conflicting tabIndex.
  ScreenD: Components: A,B --> problem, because of conflicting tabIndex.
(每种组合都是可能的)

我认为我需要以一种动态的方式创建tabIndex值,但我不知道如何做到这一点。
有人有主意吗?我很高兴得到关于这一点的每一个提示。

我不确定我是否能理解,但可能是这样的

tabindex="#{tabIndexBean.getIndex}"
方法:

int index=0;
public int getIndex() {
    index++;
    return index;
}

你能更具体地说明你的设置吗。提供代码以支持您的需求。我不太明白你的意思,太棒了!你的解决方案使我走上了正确的道路。谢谢