jsf-2

Disable/enable commandbutton on ajax event

家住魔仙堡 提交于 2019-12-21 02:36:43
问题 I want to be able to disable the commandbutton below once it's hit and enable it once the event listener runs and msg1 is rendered. <h:commandButton value="Submit"> <f:ajax execute="@form" render="msg1" listener="{bean.method}" /> </h:commandButton> How could I do this? UPDATE: I found out that I can attach onclick event to the commandButton element itself to disable it. How can I detect the listener method has returned so I can enable the button again? 回答1: You could do it with help of the

Navigate using p:selectOneMenu

无人久伴 提交于 2019-12-21 02:31:39
问题 I'm using a select one menu to do navigation to different parts of my site: <p:selectOneMenu value="#{navigator.outcome}"> <f:selectItem itemLabel="Select page..." /> <f:selectItem itemValue="page1" itemLabel="Page 1" /> <f:selectItem itemValue="page2" itemLabel="Page 2" /> <f:selectItem itemValue="page3" itemLabel="Page 3" /> <p:ajax event="change" listener="#{navigator.navigate}" /> </p:selectOneMenu> Is there a more SEO friendly way of doing this? I'm worried that the JavaScript links won

Navigate using p:selectOneMenu

喜欢而已 提交于 2019-12-21 02:31:09
问题 I'm using a select one menu to do navigation to different parts of my site: <p:selectOneMenu value="#{navigator.outcome}"> <f:selectItem itemLabel="Select page..." /> <f:selectItem itemValue="page1" itemLabel="Page 1" /> <f:selectItem itemValue="page2" itemLabel="Page 2" /> <f:selectItem itemValue="page3" itemLabel="Page 3" /> <p:ajax event="change" listener="#{navigator.navigate}" /> </p:selectOneMenu> Is there a more SEO friendly way of doing this? I'm worried that the JavaScript links won

JSF1064 “Unable to find or serve resource” warning on jsf 2.0

我怕爱的太早我们不能终老 提交于 2019-12-20 23:31:14
问题 I'm working on an Enterprise project with Java EE 5 and JSF 2.0 (Mojarra 2.0.3) on Weblogic 10.3.3 I don't have an error, but a very annoying warning in my console when going through my application. Whenever I perform a redirect in JSF, I get a warning in my console of the following form: Nov 7, 2011 5:36:46 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, images/jquery-theme/ui-icons_cc0000_256x240.png. Nov 7,

How to show 2 line in one column in datatable?

早过忘川 提交于 2019-12-20 18:44:04
问题 I have a data table in my application. One column have heavy data which increasing the width of table. I want to split the data to two or more lines in that column. I have tried by setting width for that column but data did't split and doesn't show total data. <p:column headerText="#{msgs['exception.label.exceptionMsg']}" width="200"> <h:outputText value="#{exception.exceptionMsg}"/> </p:column> How can i split the data? 回答1: The .ui-datatable tbody td has a default style of white-space:

How to create custom 404 messages in JSF 2.0?

人盡茶涼 提交于 2019-12-20 17:32:53
问题 Currently in my app when a user types some illegal destination in the URL bar, sees this: I would like to make it more beautiful and customize it with my own markup and a bit of css. -Do i need to program that on my app or i have to configure that in the application server? -Where should i start from if i want to do that? 回答1: You can declare custom <error-page> s in web.xml depending on <error-code> (the HTTP status code) or <exception-type> (the full qualified exception class name which was

How to create custom 404 messages in JSF 2.0?

自古美人都是妖i 提交于 2019-12-20 17:31:10
问题 Currently in my app when a user types some illegal destination in the URL bar, sees this: I would like to make it more beautiful and customize it with my own markup and a bit of css. -Do i need to program that on my app or i have to configure that in the application server? -Where should i start from if i want to do that? 回答1: You can declare custom <error-page> s in web.xml depending on <error-code> (the HTTP status code) or <exception-type> (the full qualified exception class name which was

Validate input as required only if certain command button is pressed

懵懂的女人 提交于 2019-12-20 13:19:28
问题 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

How to disable ViewState?

好久不见. 提交于 2019-12-20 12:29:20
问题 I'm coming into Java world from MS and ASP.NET and looking for the similar to ASP.NET component-based HTML framework in Java. After reviewing tons of links in internet it looks like JSF2 (with facelets) is best match (is this true by the way? or there are other better choices?). The problem I'm encountering during evaluation right now is correct usage of JSF's view state. My final usage scenario would be a clustered WEB server and i'm NOT going to have any session/server-stored objects and i

How to add TLD and Tag Lib files into a Maven's jar project

别等时光非礼了梦想. 提交于 2019-12-20 12:26:07
问题 I have a Maven project that is packaged as jar . And I also have a Maven project that is packaged as war . This war project has a tld file and some xhtml files (the tag libs). The structure of the war project is (basically): pom.xml src main java ... webapp WEB-INF my-facelets.taglib.xml facelets aTag.xhtml anotherTag.xhtml META-INF my-facelets.taglib.tld And then appeared a requirement to remove those xml, xhtml and tld files from the war project and package them into the jar project. So my