commandbutton

<p:blockUI> does not respond on <h:commandButton><f:ajax>

感情迁移 提交于 2019-12-11 04:12:36
问题 I got a <h:commandButton like: <h:commandButton id="login" actionListener="#{bean.login}" value="Login" styleClass="btn btn-primary btn-sm"> <f:ajax execute="@form" render="@form"/> </h:commandButton> and a <p:blockUI id="block" block=":form" trigger="login" /> It is not working. The block is never shown up. It does work with a <p:commandButton> . How can I achieve it with a <h:commandbutton> . If that is not possible: Is there any workaround? 回答1: The <p:blockUI> listens on PrimeFaces/jQuery

Change ActiveX Command button color back to previous color after clicked

我怕爱的太早我们不能终老 提交于 2019-12-11 02:12:01
问题 I have a spreadsheet with over 65 ActiveX Command Buttons. When I left click one command button, it turns green and add a (+1) in a cell. When I right click the same command button, it turns red and add a (+1) in a cell. When I click another command button, I want to return the previous command button back to the default grey. The issue is that the previous command button remains the same color as I previous clicked. How do I make the command button that was clicked, return back to default

JSF & ui:repeat - issue with adding an object to cart

限于喜欢 提交于 2019-12-06 21:01:28
Once again I need some help with my pizza-search-programm I have written with Java Server Faces. The program: A user can search for pizzas by entering a form. A filtered search is possible as the user can decide whether he searches for a pizza name, a pizza id or other specified criteria. The program will generate a SQL query which returns pizza objects and stores it into a list of objects. A JSF page displays the list of pizza objects by iterating them through a ui:repeat tag. Pizza name, pizza ID, available sizes (displayed as radio buttons) and a list of possible quantities are displayed.

Calling javascript on complete of commandbutton action

倾然丶 夕夏残阳落幕 提交于 2019-12-04 05:39:45
问题 How can I call a JavaScript function after completion of command button action? I'm using JSF 1.0. 回答1: Just let JSF conditonally render the desired script. E.g. <h:form> <h:commandButton value="Submit" action="#{bean.submit}" /> <h:panelGroup rendered="#{bean.submitted}"> <script>alert('Form was submitted!');</script> </h:panelGroup> </h:form> with private boolean submitted; public void submit() { // ... submitted = true; } public boolean isSubmitted() { return submitted; } 来源: https:/

Validate input as required only if certain command button is pressed

久未见 提交于 2019-12-03 03:59:55
I have specific use case for JSF validation. For example I have an inputText field: <p:inputText id="input" required="#{myBean.required}" value="#{myBean.value}" maxlength="20" disabled="#{myBean.disabled}"> <p:ajax event="blur" process="@this" update="name" listener="#{myBean.listener}"/> </p:inputText> Value of input is number (in some cases it can also be a string, because this is part of composite component, but problem is better described if we assume this is a number). This input is part of the form, at the end of form I have submit button: <p:commandButton value="Save" actionListener="#

Looping through multiple Command Buttons to change their properties based on cell values

泄露秘密 提交于 2019-12-02 09:54:35
问题 I have an interactive table filled with over 100 different command buttons, each of which assign values to variables then use a custom function to calculate their output. They reference a table on the second sheet to get the values they assign. Is there a way to, based on whether a cell contains content or not, change the color of each button? So far, here's what I have (non-functional, of course). Sub Auto_Open() Dim n As Integer n = 2 Do Until n = 114 If Sheet2.Cells(n, 4) = vbNullString Or

primefaces commandbutton update does not work

感情迁移 提交于 2019-12-02 02:56:53
问题 I have minimized my code to better show you what is not working. <h:body> <f:view> <h:form id="wbSelectForm"> <p:commandButton id="viewWorkbenchButton" icon="ui-icon-show" title="View Workbench" update=":wbTestPanel" actionListener="#{WorkbenchControllerBean.test}"> </p:commandButton> </h:form> <p:panel id="wbTestPanel"> Test: Active Wb: #{WorkbenchControllerBean.number} </p:panel> </f:view> </h:body> When i press the commandButton, i would expect that 'wbTestPanel' is being updated, which

commandButton inactive after ajax rendering

三世轮回 提交于 2019-12-02 01:54:01
I have a problem with these two commandButton : Join and Leave. I want to hide Join if I click on leave and vice-versa. When I put ajax on false, there is no problem (but all the page is refresh and I don't find this optimal). But when ajax attribut is on true with specific updating (cf comment in the code), the rendering is good but the new button whitch appear become inactive. If I click on it, nothing happens (well it's seems the actionListener trigger but the view is not refreshed, I have to manual refresh to see the difference) Thanks for reading. <h:form id="formWaitingList" rendered="#

primefaces commandbutton update does not work

混江龙づ霸主 提交于 2019-12-01 22:52:47
I have minimized my code to better show you what is not working. <h:body> <f:view> <h:form id="wbSelectForm"> <p:commandButton id="viewWorkbenchButton" icon="ui-icon-show" title="View Workbench" update=":wbTestPanel" actionListener="#{WorkbenchControllerBean.test}"> </p:commandButton> </h:form> <p:panel id="wbTestPanel"> Test: Active Wb: #{WorkbenchControllerBean.number} </p:panel> </f:view> </h:body> When i press the commandButton, i would expect that 'wbTestPanel' is being updated, which does somehow NOT happen. I know that because WorkbenchControllerBean.getNumber() is not called. I am

h:commandbutton vs h:commandlink

泪湿孤枕 提交于 2019-11-30 06:54:26
We are using JSF-2.1.7 and in all our form post requests. I am trying to justify whether to use <h:commandButton> or <h:commandLink> . The appearance of <h:commandLink> (href <a/> ) can be controlled using style and jQuery. Which is recommended <h:commandButton> or <h:commandLink> ? Is there any real advantage? BalusC There is no functional difference apart from the generated markup and the appearance. The <h:commandButton> generates a HTML <input type="submit"> element and the <h:commandLink> generates a HTML <a> element which uses JavaScript to submit the form. Both are to be used to submit