Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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中的selectonemenu和selectmanycheckbox获取所选值_Jsf_Primefaces - Fatal编程技术网

无法从jsf中的selectonemenu和selectmanycheckbox获取所选值

无法从jsf中的selectonemenu和selectmanycheckbox获取所选值,jsf,primefaces,Jsf,Primefaces,我在做测试程序。所以我需要动态构建GUI。但我无法从selectonemeu和selectmanycheckbox获取所选值。我知道如何从这些数据中获取价值,并且已经习惯了。 我做得很好 answerRadio[qstnCnt].setId("id" + String.valueOf(qstns.getQstn_id()) + qstnCnt); answerRadio[qstnCnt].setId("id"+ String.valueOf(qstns.getQstn_id()) + qstn

我在做测试程序。所以我需要动态构建GUI。但我无法从selectonemeu和selectmanycheckbox获取所选值。我知道如何从这些数据中获取价值,并且已经习惯了。 我做得很好

answerRadio[qstnCnt].setId("id" + String.valueOf(qstns.getQstn_id()) + qstnCnt);
answerRadio[qstnCnt].setId("id"+ String.valueOf(qstns.getQstn_id()) + qstnCnt+rnd.nextInt());
并获取所选值

String qsId = aRadio.getId().substring(2, 6); 
但我最近换了他们的身份证。像下面的

answerRadio[qstnCnt].setId("id" + String.valueOf(qstns.getQstn_id()) + qstnCnt);
answerRadio[qstnCnt].setId("id"+ String.valueOf(qstns.getQstn_id()) + qstnCnt+rnd.nextInt());
并得到选定的值

String qsId = aRadio.getId().substring(2, 6);
因此,我无法获取选定的值 更改ID的原因是组件ID重复,因此指向错误


由于更改了ID,因此它没有指向错误,但无法获取选定值

您没有指定无法获取选定值的原因。