commandbutton

p:commandButton or p:button with actionListener and outcome?

北慕城南 提交于 2019-12-13 05:01:24
问题 I'm using PrimeFaces and have a Save button, basically a maintenanceTask is sent to my page, I edit it within here, then press Save and it should be saved to the database and then redirected to the original page. I have a working Save method, but can't seem to get both the navigation and method to fire off. <p:commandButton value="#{message.commonButtonSave}" title="#{message.commonSaveTooltip}" rendered="#{maintenanceTaskEnquiryBean.screenMode == 'editTasks'}" disabled="#

Two h:commandButton in the same h:form: one works, the other doesn't

我的梦境 提交于 2019-12-12 04:29:47
问题 I have a .xhtml with this piece of code: <h:inputText value="#{boardMBean.loginToAdd}"/> <h:commandButton action="#{boardMBean.addUser}" immediate="true" process="@this" value="Adicionar"/> (...) <h:commandButton action="#{boardMBean.edit}" value="Salvar" class="btn btn-large"/> The second h:commandButton works fine, i.e., submits the form correctly. In the other hand, the first, instead of calling the addUser() method from BoardMBean , just refresh the page and nothing happens. I'm using JSF

p:commandButton refreshes entire page instead of partially whereas f:ajax works fine

倖福魔咒の 提交于 2019-12-12 03:37:52
问题 I try to update a part of the page on button click. Right now, I have the following : template.xhtml <h:form prependId="false"> <h:commandButton value="NEWS" action="news"> <f:ajax render="newsContent"></f:ajax> </h:commandButton> <h:panelGroup layout="block" id="newsContent"> <ui:insert name="newsContent"> <ui:include src="/WEB-INF/partials/news/news.xhtml"/> </ui:insert> </h:panelGroup> </h:form> /WEB-INF/partials/news/news.xhtml <h:commandLink action="newsdetails"> <f:ajax render=

Use of h:form in Facelets files in /WEB-INF opened by RequestDispatcher#forward() to execute methods of managed beans

梦想的初衷 提交于 2019-12-12 03:13:17
问题 I'm using Java EE for an enterprise application on Glassfish. I have some xhtml files in WEB-INF to prevent direct URL access, that I can access using a servlet. I need to call a method of a managed bean when the user press a button. The xhtml code I'm using is: <h:form><p:commandButton action="#{managedBean.testFunction()}" value="Test function" type="submit" ajax="false" styleClass="block" /></h:form> The problem is that the input of h:form seems to redirect me to the actual path to my

Execute commandButton-beanFunction in WEB-INF/page.xhtml coming from forward

[亡魂溺海] 提交于 2019-12-12 01:56:40
问题 I'm using Java EE for an enterprise application on Glassfish 4.1, I've the following components: a Java Servlet: protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); this.setUser(um.getLoggedUser()); final String indexPath = "/Index.xhtml"; final String creatorPath = "/WEB-INF/HiddenPages/EventPageCreator.xhtml"; if(creator()) request.getRequestDispatcher("/WEB-INF

commandButton only works on the second click

≡放荡痞女 提交于 2019-12-11 23:54:03
问题 Hi i had a button but it only reacts on the second click on it. I use jsf 2.2 and primefaces 4.0 <p:commandButton style="width:350px" type="submit" action="#{regiBean.register}" value="#{msg['regi_title']}" ajax="false" update="regiForm"> </p:commandButton> 来源: https://stackoverflow.com/questions/23171637/commandbutton-only-works-on-the-second-click

Primefaces commandButton action doesn't work

依然范特西╮ 提交于 2019-12-11 19:43:14
问题 I have a Primefaces project with the following xhtml file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:body> <ui:composition> <h:form> <p:dataTable id="parameters" var="parameter" value="#{devTestController

Excel CommandButton names changing

你离开我真会死。 提交于 2019-12-11 16:43:30
问题 I created an excel file with macros on ActiveX-CommandButtons . They worked well, when I just finished them. As soon as I opened the file again, the CommandButton-Names changed . As example: CommandButton1 changed to CommandButton2 CommandButton2 changed to CommandButton3 etc. I didn't found anything in my reasearch, so is this an excel bug or just something that you can change in your preferences? 回答1: Right click on CommandButton Go to (click on) 'Format Text Effects' Give the name to

primefaces commandbutton conditional statement

两盒软妹~` 提交于 2019-12-11 06:51:51
问题 I want a conditional statement in my commandbutton (Primefaces 6.0) which should show a dialog if my java method return false or true. Something like that: <p:commandButton onclick="(myJavaMethod) ? deleteDialog.show() : confirmDialog.show()"> <p:confirm header="Deleting Branch" message="Do you want to delete the Branch?"/> </p:commandButton> myJavaMethod return false if i can't delete it and true if i can delete it. My Dialogs look like this: <!-- DELETE-DIALOG --> <p:dialog id="deleteDialog

Clicking p:commandButton causes the value of p:selectOneMenu being set twice

故事扮演 提交于 2019-12-11 04:36:35
问题 I ran into an issue with PrimeFaces - consider form with SelectOneMenu being put inside of Inplace . Next to the Inplace we have a CommandButton that is meant to reset the value of the SelectOneMenu . The form looks like this: <h:form id="myform"> <p:inplace id="inplace" editor="true"> <p:ajax event="save" update="@(form)" /> <f:facet name="output"> <h:outputText value="#{testBean.year}" /> </f:facet> <f:facet name="input"> <p:selectOneMenu id="selYears" value="#{testBean.year}"> <f