0

I have the following code

<p:selectOneMenu id="dynamicId_#{loopStatus.index}" .....

`loopStatus` comes from `<p:dataGrid  varStatus="loopStatus".....`

but when the page is rendered i see the the id of <p:selectOneMenu becomes like the following dynamicId_ only and it does not append the number that comes from loopStatus.index could some one help me to fix this issue?.

Joe
  • 4,460
  • 19
  • 60
  • 106
  • The behaviour you see cannot be determined by the code you posted. I don't see anything that generates/produces a `lootStatus.index` so that would (in production) mean it is empty. [mcve] please (most likely you use a ui:repeat where a c:foreach would be appropriate, ASSUMING you actually really 100% need the id to be different since in a ui:repeat it is already made different with an index) – Kukeltje Mar 13 '18 at 08:46
  • And tried with other PF components or a `h:selectOneMenu`? Won't work either. Duplicte: https://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense – Kukeltje Mar 13 '18 at 09:00
  • @Kukeltje hope the edit i made helps you to understand from where loopStatus[have corrected so that it makes sense] comes from. – Joe Mar 13 '18 at 09:03
  • If you use a dataGrid, there already is an index in the client-side id...like in a ui:repeat... – Kukeltje Mar 13 '18 at 09:17
  • 3
    Possible duplicate of [JSTL in JSF2 Facelets... makes sense?](https://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense) – Kukeltje Mar 13 '18 at 09:54
  • You can't use ids like that. See the linked post about JSTL in JSF2 for more information. – dognose Mar 13 '18 at 14:20

0 Answers0