jsf-2

Faces messages are not cleared on subsequent requests

谁说我不能喝 提交于 2020-01-16 01:05:48
问题 Case is as follows: you have a bean method which parses a file, and if parsing fail, error message is added, and if parsing successful, success message is added. But when you make consecutive operations: fail > success , i expect that the fail message will disappear and the success message appears, but what happens is that fail message is still there, and success message is added to it. Clearing the MessageList before adding the message is not a solution, because list is already cleared, if

FullAjaxExceptionHandler does not redirect to error page for Ajax request

无人久伴 提交于 2020-01-16 01:01:34
问题 I know there has been numerous questions here on this question, but almost all of them suggest adding the following code because there is another layer "above" the FullAjaxExceptionHandler that is sending a plain redirect instead of doing an Ajax redirect (see this similar question): if ("partial/ajax".equals(request.getHeader("Faces-Request"))) { // JSF ajax request. Return special XML response which instructs JavaScript that it should in turn perform a redirect. response.setContentType(

FullAjaxExceptionHandler does not redirect to error page for Ajax request

夙愿已清 提交于 2020-01-16 01:01:32
问题 I know there has been numerous questions here on this question, but almost all of them suggest adding the following code because there is another layer "above" the FullAjaxExceptionHandler that is sending a plain redirect instead of doing an Ajax redirect (see this similar question): if ("partial/ajax".equals(request.getHeader("Faces-Request"))) { // JSF ajax request. Return special XML response which instructs JavaScript that it should in turn perform a redirect. response.setContentType(

Rendering HTML5 buttons (button, reset and submit) in JSF2

风流意气都作罢 提交于 2020-01-15 15:31:13
问题 As you may know that you can render button in HTML5 in 2 methods: Using void element <input type="button" /> or If you want content, use the <button></button> element (which isn't a void element). In JSF2, there are 2 ways to generate buttons; either with UICommand or UIOutcomeTarget component. I understand what these 2 components are for, my question what would be the best component for the 2 HTML5 button types, should one create these HTML5 components in JSF2? So far, the best aspects is to

<p:ajax> not firing when choosing null value

ぐ巨炮叔叔 提交于 2020-01-15 15:26:26
问题 I have the following p:selectOneMenu : <p:selectOneMenu widgetVar="selectELclUpdateLcl" style="font-size:11px;" value="#{tabparam.selectedDataEntite}" appendTo="@this" id="selectedDataEntite" required="true" requiredMessage="Entité obligatoire" converter="entiteConverter"> <p:ajax event="change" listener="#{tabparam.enableBloc}" update="sBloc sTLocal sEtage" /> <f:selectItem noSelectionOption="true" itemLabel="-- Entités --" value="#{null}"></f:selectItem> <f:selectItems value="#{tabparam

java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager

谁都会走 提交于 2020-01-15 12:23:49
问题 I'm using JSF Composite Component for reuse component. However, I keep getting a null-pointer error, I follow some of the tutorial I found but none mention this problem. The stack trace added: java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager$ArbitraryMethodRegargetHandler.retarget(FaceletViewHandlingStrategy.java:1883) at com.sun.faces.application.view.FaceletViewHandlingStrategy.retargetMethodExpressions

java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager

萝らか妹 提交于 2020-01-15 12:23:39
问题 I'm using JSF Composite Component for reuse component. However, I keep getting a null-pointer error, I follow some of the tutorial I found but none mention this problem. The stack trace added: java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager$ArbitraryMethodRegargetHandler.retarget(FaceletViewHandlingStrategy.java:1883) at com.sun.faces.application.view.FaceletViewHandlingStrategy.retargetMethodExpressions

Adding multiple rows in database table from one JSF page in one go

孤街醉人 提交于 2020-01-15 12:13:17
问题 Can we add multiple rows in the database table from one JSF page in one go? Actually i want to make an attendance page, i want to take attendance of all employees in one JSF page in one go that is when user will press save button then all employees attendance will get save in database. Is it possible to achieve this using managed bean and JSF page? Kindly give me some idea that how it can be achieved? I've done insert,view,update and delete for single row. 回答1: Yes, just use a <h:dataTable> .

Adding multiple rows in database table from one JSF page in one go

ぐ巨炮叔叔 提交于 2020-01-15 12:10:22
问题 Can we add multiple rows in the database table from one JSF page in one go? Actually i want to make an attendance page, i want to take attendance of all employees in one JSF page in one go that is when user will press save button then all employees attendance will get save in database. Is it possible to achieve this using managed bean and JSF page? Kindly give me some idea that how it can be achieved? I've done insert,view,update and delete for single row. 回答1: Yes, just use a <h:dataTable> .

Adding multiple rows in database table from one JSF page in one go

﹥>﹥吖頭↗ 提交于 2020-01-15 12:09:13
问题 Can we add multiple rows in the database table from one JSF page in one go? Actually i want to make an attendance page, i want to take attendance of all employees in one JSF page in one go that is when user will press save button then all employees attendance will get save in database. Is it possible to achieve this using managed bean and JSF page? Kindly give me some idea that how it can be achieved? I've done insert,view,update and delete for single row. 回答1: Yes, just use a <h:dataTable> .