Primefaces dialog + commandButton

You can try either of the following , I vote number one, it’s a cleaner design IMO Bring the <p:dialog/> outside of the general <h:form/> and put an <h:form/> inside it instead <p:dialog id=”dlg” header=”#{messages.chooseSkillLevel}” widgetVar=”dlg” modal=”true” dynamic=”true”> <h:form> <h:dataTable value=”#{editSkills.skillsAndLevels}” var=”skillslevel”> <h:column> #{skillslevel.skill.umiejetnosc} </h:column> <h:column> <p:selectOneMenu value=”#{skillslevel.level}” > <f:selectItems value=”#{editSkills.levels}” var=”level” itemLabel=”#{level.stopien}” itemValue=”#{level.id}” /> … Read more

@EJB in @ViewScoped managed bean causes java.io.NotSerializableException

@ViewScoped beans are stored in HTTP session. Any objects which are stored in the HTTP session needs to implement Serializable. See also JSF managed bean causing java.io.NotSerializableException during Tomcat deployment and java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException. The NotSerializableException is usually self-explaining since it mentions the full qualified name of the class which needs to be serialized … Read more

How to use Parameterized MessageFormat with non-Value attributes of JSF components

You could create a custom EL function for this with which you can ultimately end up like: <h:commandLink … title=”#{my:format(msg[‘someMessage’], someBean.value)}” /> You can use the MessageFormat API to perform the job, exactly as <h:outputFormat> is doing under the covers. An alternative is to create a custom component which does the same as JSTL’s good … Read more