This is caused by statefulness of the <f:viewParam>. JSF utility library OmniFaces has solved this with its <o:viewParam>. See also: Process f:viewParam only on page load ...
javax.persistence.NoResultException: No entity found for query This particular exception will be thrown when you use JPA Query#getSingleResult() and the query actually didn't return any result. You should be reading the stack trace of the exception to naildown one responsible for calling this method, and to understand why exactly this...
jsf,templates,facelets,composition,viewparams
When using templating, anything outside <ui:composition> and <ui:define> is ignored. This includes <f:metadata>. Move it to inside an <ui:define> of the <ui:composition>. E.g. <ui:composition template="/templates/masterLayout.xhtml"> <ui:define name="metadata"> <f:metadata> <f:viewParam ... /> </f:metadata> </ui:define> <ui:define name="content"> ... </ui:define> </ui:composition> See also: When using <ui:composition> templating, where should I declare...
jsf,disabled-control,viewparams
There's a timing problem. The action event is queued during apply request values phase. It will as part of safeguard against tampered requests also evaluate the disabled (and rendered) attribute at that point. However, as it's only actually set right before the render response phase, then it will indeed always...
jsf,redirect,error-handling,jsf-2.2,viewparams
When I add required="true", nothing happens You need <h:message(s)> to show faces messages associated with a given (input) component. You probably already know how to do that for <h:inputText>. You can do exactly the same for <f:viewParam>. <f:metadata> <f:viewParam id="foo" ... required="true" /> </f:metadata> ... <h:message for="foo" /> Сan...