jsf-2

how to find id based on pagination

假如想象 提交于 2020-01-03 19:39:16
问题 I am using the jQuery DataTables plugin on a JSF <h:dataTable> . In this page I have 86 records. +++++++++++++++++++++++++++++++++++++ + id + Name + Email + +++++++++++++++++++++++++++++++++++++ + 1 + Name 1 + Email 1 + + 2 + Name 2 + Email 2 + + 3 + Name 3 + Email 3 + +........ + 4 + Name 4 + Email 4 + +++++++++++++++++++++++++++++++++++++ + 1.2.3.4..... Next + +++++++++++++++++++++++++++++++++++++ Note: Per table I am showing 10 records. What my client want is add a column Views which will

JSF 2.0: When is encodeAll called and when is encodeBegin called?

半城伤御伤魂 提交于 2020-01-03 17:49:08
问题 Consider a custom UIComponent (for test purposes only): public class UITest extends UIComponentBase { @Override public void encodeBegin(FacesContext context) throws IOException { System.out.println("encodeBegin"); } @Override public void encodeAll(FacesContext context) throws IOException { System.out.println("encodeAll"); } } When I add it to page inside a composite component, the encodeBegin() method gets called. However, when add it to page outside a composite component, the encodeAll()

primefaces commandbutton actionlistener not called

主宰稳场 提交于 2020-01-03 17:47:37
问题 I am using primefaces 3.0 and jsf 2.0 . I have prepared client master which add client using wizard and at the same time reflected in datatable. Then I have updated edit utility in datatable. Then I have added delete button in datatable and try call delete method of bean. But when I click on delete button wizard validation for adding client is executed. So I have created another file ClientEditdatatable.xhtml and included in clientmaster.xhtml but same result remain. Now I want to add delete

JSF2 how to specify more than one custom element library in web.xml file

旧街凉风 提交于 2020-01-03 17:01:05
问题 I have two custom components and I need to use them both on the same project. I know how to specify single component (tutorial: http://myjavabuddy.blogspot.com/2013/04/writing-custom-components-for-jsf-20.html) (web.xml): <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun

PrimeFaces lazydatamodel load method not called

我的梦境 提交于 2020-01-03 10:19:20
问题 I happen not to understand why my load method is not called in a lazydatamodel of my primefaces table. My xhtml page goes like this <h:form id="myForm"> <p:dataTable value="#{myBean.configDataModel}" id="configTable" var="config" paginator="true" rows="10" selectionMode="single" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,20"> . . </h:form> My Bean code goes like this and

Navigate to the Same Page After Action in JSF 2

大兔子大兔子 提交于 2020-01-03 09:11:26
问题 I have a component done in JSF 1.x, this component has a command button as follows <h:commandButton ... action="#{templateController.next}" /> Where templateController was passed as an EL binding and can be any object that implements a certain interface. The generic implementation of next() was just executing code and then returning an empty string causing the same page to refresh: public String next() { ..... return ""; } Now I am trying to port that component to JSF 2, my problem is that an

HTML 4 <button> in JSF 2.1

橙三吉。 提交于 2020-01-03 07:31:08
问题 I would like to use the commands: The JSF <h:commandButton> generates an <input...> but I would like that instead of generating the <input> I would like that this generate a HTML 4 standard <button> . 回答1: You should look into the Primefaces p:commandButton . This will render to a <button> tag on the client. http://www.primefaces.org/showcase/ui/commandButton.jsf 回答2: Closest what you can get with standard JSF component set is <input type="button"> which is generated by <h:button>. <h:button

Invoke ActionListener of Backing Component in Composite Component

喜欢而已 提交于 2020-01-03 05:54:09
问题 try to write a composite component that allows mutltiple text inputs. I read that it is possible to define a backing component for a composite component, so I don't have to write a renderer nor a handler. What I couldn't figure out is how to delegate actions declared in composite's xhtml to the backing component. I guess i did not yet quite understand the concept of this. Does anybody has an Idea? I am using Tomcat 7, EL 2.2, Spring 3, Mojarra 2.1.7 This is the way i'd like to use the

web.xml with different files in welcome-file-list

北战南征 提交于 2020-01-03 05:33:08
问题 i'm starting to use JSF and I'm a bit lost. I'm developping a JSF application and I have two enter points. Some times I need my browser to open a page named mydata.xhtml and another times I need to open a page named dataexchange.xhtml. Now I have done the first one, and the application works fine. I think I have to change my web.xml file, isn`t it? My web.xml is this. <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www

How to display the label of a selected value of a <h:selectOneMenu> in a <h:outputText>?

隐身守侯 提交于 2020-01-03 05:01:08
问题 I want to show the label of the selected value of <h:selectOneMenu /> in a <h:outputText /> . I have the following dropdown where I get the selected value. <h:column> <h:selectOneMenu value="#{bean.selectedCity}"> <f:selectItem itemValue="1" itemLabel="NewYork"/> <f:selectItem itemValue="2" itemLabel="Washington"/> </h:selectOneMenu> </h:column> I want to display the selected value, but the following only shows 1 or 2 . <h:outputText value="#{bean.selectedCity}" /> I want to display the label