commandbutton

How can I create toggle buttons in JSF?

耗尽温柔 提交于 2019-11-29 14:50:40
How can I create toggle buttons in JSF? Basically, I need two buttons "in" and "out". They essentially call the same managed bean, but as a result of every click the one should be disabled and the other should be enabled and vice versa. How can this be done? Should I use ajax functionality? BalusC Just have a boolean property which you inverse in action method and use exactly that property in the disabled attribute of the both buttons, inversed. Kickoff example: @ManagedBean @ViewScoped public class Bean { private boolean enabled; public void toggle() { enabled = !enabled; } public boolean

h:commandbutton vs h:commandlink

自古美人都是妖i 提交于 2019-11-29 06:29: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? 回答1: 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>

My own primefaces p:commanButton icon

元气小坏坏 提交于 2019-11-29 04:25:10
I cannot use my own icon for a primefaces p:commandButton. My code is: <p:commandButton value="Cancel" action="#{userBb.cancel()}" icon="ui-icon-myCancel" /> css is: .ui-icon-myCancel{ background-image: url(images/cancel_16.png) !important; } Structure of folders is ordinary: /resources/images/cancel_16.png As a result i get: When I try: .ui-state-default .ui-icon .ui-icon-myCancel{ background-image: url(images/cancel_16.png) !important; } I get: When I look at firebug report, there is section span <span class="ui-button-icon-left ui-icon ui-c ui-icon-myCancel"></span> there is: .ui-state

h:commandButton is not working once I wrap it in a <h:panelGroup rendered>

只谈情不闲聊 提交于 2019-11-28 12:45:57
The reason why the topic has "kind of" is because I have an example in JSF 2.2 where I use a commandButton and call a bean function twice (depending on the url). It's basically the same code, which executes only in one example. Here's the code with the description of the "error" below the code: User bean @ManagedBean @RequestScoped public class User { private String name; private String surname; private int age; private int id; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname

Creating a Class to Handle Access Form Control Events

允我心安 提交于 2019-11-28 10:34:46
I'm trying to create a Class which will handle multiple Control Events in Access. This is to save the repetition of typing out many lines of identical code. I've followed the answer located on the following page, but with a few adjustments to tailor it to Access rahter than Excel. How to assign a common procedure for multiple buttons? My Class code below: Option Compare Database Public WithEvents ct As Access.CommandButton 'Changed object type to something recognised by Access Public Sub ct_Click() MsgBox ct.Name & " clicked!" End Sub My Form code below: Option Compare Database Private

How can I create toggle buttons in JSF?

拥有回忆 提交于 2019-11-28 08:15:13
问题 How can I create toggle buttons in JSF? Basically, I need two buttons "in" and "out". They essentially call the same managed bean, but as a result of every click the one should be disabled and the other should be enabled and vice versa. How can this be done? Should I use ajax functionality? 回答1: Just have a boolean property which you inverse in action method and use exactly that property in the disabled attribute of the both buttons, inversed. Kickoff example: @ManagedBean @ViewScoped public

p:commandButton vs. h:commandButton

試著忘記壹切 提交于 2019-11-28 01:28:16
When I am using a PrimeFaces p:commandButton <p:commandButton action=#{bean.action} /> I don't see the the validation messages for inputs (both the default h: ones or the PrimeFaces p: ones.) For example with <f:validateRequired /> When I am using default command button like <h:commandButton action=#{bean.action} /> I do see the validations. What can be the cause of this difference? I am using Prime Faces 3.5 with Mojarra 2.1.18 <h:form id="reliefhourheadcopy-form"> <h:panelGrid columns="1"> <h:outputText value="Kopiere Entlastungsstunden von" /> <h:outputText value="Semester: #

My own primefaces p:commanButton icon

人盡茶涼 提交于 2019-11-27 18:24:15
问题 I cannot use my own icon for a primefaces p:commandButton. My code is: <p:commandButton value="Cancel" action="#{userBb.cancel()}" icon="ui-icon-myCancel" /> css is: .ui-icon-myCancel{ background-image: url(images/cancel_16.png) !important; } Structure of folders is ordinary: /resources/images/cancel_16.png As a result i get: When I try: .ui-state-default .ui-icon .ui-icon-myCancel{ background-image: url(images/cancel_16.png) !important; } I get: When I look at firebug report, there is

Primefaces dialog + commandButton

微笑、不失礼 提交于 2019-11-27 15:14:48
I'm trying to use primefaces <p:dialog> combined with <p:commandButton> . In my .xhtml page I have a picklist and commandButton which is used to show a dialog. Dialog displays datatable with target values from picklist. Dialog has two buttons: cancel and submit. My problem is that submit button is not fired. What's strange, commandButton out of dialog works. Here's my .xhtml: <body> <ui:composition template="./../resources/mainTemplate.xhtml"> <ui:define name="content"> <h:form> <p:dialog id="dlg" header="#{messages.chooseSkillLevel}" widgetVar="dlg" modal="true" dynamic="true"> <h:dataTable

Open new window by POST using h:commandButton

旧时模样 提交于 2019-11-27 14:26:46
I need to open a JSF page in a new window by POST on click of a <h:commandButton> . I know I can acheive this using the JavaScript. But I would like to achive this using JSF and not JavaScript. How can I achieve this? I'm using JSF 2.0. The only non-JS way is to set target="_blank" in the parent <h:form> . <h:form target="_blank"> ... <h:commandButton value="Open in new Window" /> </h:form> This however affects all non-ajax(!) actions which are performed in the very same form. So if you're smart, make the action which shouldn't open in a new window an ajax action. However, ajax is also