0

I have such id of dialog form form:processFilterPanel_fpanel_tv:dialogFormIO:j_idt195:ItemWidget_input

And I want to work with one element of form at backend side. The problem that this part of id j_idt195 is always changing by jsf (when it starts a new session) and I don't know how to get it. Have any ideas?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Diana Meissen
  • 153
  • 3
  • 10
  • sure, find out what naming container does not have a fixed id assigned by you and assign it one. – Kukeltje May 07 '18 at 10:08
  • Maybe try to set a id on your dialog, so it will be the same on every session. – stakahop May 07 '18 at 11:13
  • @stakahop , Unfortunately I already use id `ItemWidget`. I have main form `form:processFilterPanel_fpanel_tv` and component is located on form (`dialogFormIO`), which appears when the button is pressed. And if I don't indicate the whole path, I will have ComponentNotFoundException – Diana Meissen May 07 '18 at 11:21
  • Omnifaces can help finding them http://showcase.omnifaces.org/viewhandlers/NoAutoGeneratedIdViewHandler – Kukeltje May 08 '18 at 09:13

1 Answers1

0

Just use id="yourFavId" on the component and reference it.

JSF gives those weird looking ids to the html components that didn't have a defined one.

Jorge.V
  • 1,329
  • 1
  • 13
  • 19
  • 1
    Thanks for trying to help, but what is 'the' component? This and your second sentence is al described in high detail in the 'duplicate'... Please mark this question as such.. – Kukeltje May 07 '18 at 10:30
  • In his first sentence he tells us about it: The form, which has the id that he can't manage. Also, sadly, I can't cast closing votes because of duplication or any other reason. – Jorge.V May 07 '18 at 10:54
  • Unfortunately I already use it `ItemWidget`. I have main form `form:processFilterPanel_fpanel_tv` and component is located on form (`dialogFormIO`), which appears when the button is pressed. And if I don't indicate the whole path, I will have ComponentNotFoundException – Diana Meissen May 07 '18 at 11:19
  • Have you tried widgetVar from primefaces? – Jorge.V May 08 '18 at 05:55
  • @Jorge.V, @Kukeltje, thank you, I solve my problem. I had 1 unnamed container (it was `fluidGrid`), I just gave it an id and the problem is solved – Diana Meissen May 08 '18 at 09:08