aspose file tools*
The moose likes JSF and the fly likes FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component" Watch "FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component" New topic
Author

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

Karsten Wutzke
Ranch Hand

Joined: Jul 20, 2010
Posts: 106

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


OCJP JavaSE 6 (86%)
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

try this:
repo-form:repo-edoc-datatable


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Karsten Wutzke
Ranch Hand

Joined: Jul 20, 2010
Posts: 106

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

Joined: Jul 14, 2010
Posts: 754

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. [=
 
jQuery in Action, 2nd edition
 
subject: FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component
 
Similar Threads
JSF validation issue
Popuppanel+datatable in richface(JSF)
Action does not work inside rich:popupPanel
rich tabpanel : first rich tab not loaded with focus with first tab
SessionAffinityManager setCookie SESN0066E: The response is already committed to the client.