• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component

 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a repository of files, there's one tab for each type, here only external documents. They're listed per tab via data table. Don't be irritated by the sub tables, it's just for grouping certain files to a company. There's a delete commandLink to the right of each data table entry which pops up a dialog asking if s/he really wants to delete the file. On deletion, I want to update the list of files of course.

I have the following code:
Note the AJAXed h:commandButton above (it's a button on a RichFaces popup dialog to confirm deletion). Specifying simply works. Specifying to only update the necessary part/s results in a FacesException:

Why isn't JSF able to find any of the outcommented IDs above? Any explanation welcome.

Karsten
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean render=":repo-form:repo-edoc-datatable"... this works.

But what is the policy here? I thought the : syntax is for components outside the current form. Isn't there a form-local syntax? (I tried to use render="@form:repo-edoc-datatable" but this just resulted in another exception: @form:repo-edoc-datatable : Invalid id keyword specified for 'render' attribute...)

Thanks
Karsten
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, your form ID will go attached to every component that your page has.

Try this, in your h:form put the option prependId=false and test with your old code. [=
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic