Giter Site home page Giter Site logo

primefaces / primefaces Goto Github PK

View Code? Open in Web Editor NEW
1.7K 129.0 738.0 133.26 MB

Ultimate Component Suite for JavaServer Faces

Home Page: http://www.primefaces.org

License: MIT License

Java 42.01% CSS 16.43% JavaScript 33.54% HTML 7.79% SCSS 0.22%

primefaces's Introduction

Maven Actions Status CI Actions Status Integration Tests Sonar License: MIT Discord Chat Stackoverflow Prime Discussions

PrimeFaces Hero

PrimeFaces

This is an overview page, please visit PrimeFaces.org for more information.

PrimeFaces Logo

Overview


PrimeFaces is one of the most popular UI libraries in Java EE Ecosystem and widely used by software companies, world renowned brands, banks, financial institutions, insurance companies, universities and more. Here are some of the users who notified us or subscribed to a PrimeFaces Support Service.

Community <> Elite <> Pro


This is the open source code and issue tracker of the PrimeFaces master (a.k.a. community version).
Please check the following link for informations about Elite and Pro: PrimeFaces Support

What does that mean?

  • PrimeFaces is developed by PrimeTek and the open source community.
  • The most contributers here on GitHub are working on PrimeFaces in their spare time.
  • PrimeTek pushes fixes and new features from their closed source Elite and Pro repositories to the community edition.
  • We, the community on GitHub, only provide support for issues, which are reproducable with the current SNAPSHOT (scroll down for more information on how to use it).
  • We are NOT able to port bugfixes to elite releases. This is up to PrimeTek and can e.g. be triggered with PrimeFaces PRO.

Versions


Version Binary Source JSF version Java version Documentation
14.0.x JAR Sources 2.3 - 4.0 11 - ? 14.0.0 Documentation
13.0.x JAR Sources 2.0 - 4.0 1.8 - ? 13.0.7 Documentation
12.0.x JAR Sources 2.0 - 4.0 1.8 - ? 12.0.0 Documentation
Archive
Version Binary Source JSF version Java version Documentation
11.0.0 primefaces-11.0.0.jar primefaces-11.0.0-sources.jar 2.0 - 4.0 1.8 - ? 11.0.0 Documentation
10.0.0 primefaces-10.0.0.jar primefaces-10.0.0-sources.jar 2.0 - 3.0 1.8 - ? 10.0.0 Documentation
8.0 primefaces-8.0.jar primefaces-8.0-sources.jar 2.0 - 2.3 1.8 - ? 8.0 Documentation
7.0 primefaces-7.0.jar primefaces-7.0-sources.jar 2.0 - 2.3 1.7 - ? 7.0 Documentation
6.2 primefaces-6.2.jar primefaces-6.2-sources.jar 2.0 - 2.3 1.6 - ? 6.2 Documentation
6.1 primefaces-6.1.jar primefaces-6.1-sources.jar 2.0 - 2.3 1.5 - ? 6.1 Documentation
6.0 primefaces-6.0.jar primefaces-6.0-sources.jar 2.0 - 2.2 1.5 - ? 6.0 Documentation
5.3 primefaces-5.3.jar primefaces-5.3-sources.jar 2.0 - 2.2 1.5 - ? 5.3 Documentation
5.2 primefaces-5.2.jar primefaces-5.2-sources.jar 2.0 - 2.2 1.5 - ? 5.2 Documentation
5.1 primefaces-5.1.jar primefaces-5.1-sources.jar 2.0 - 2.2 1.5 - ? 5.1 Documentation

For a full list of the available downloads, please visit the download page.

Maven


Release
<!-- Java EE / javax.* / JSF 2.2 - JSF 2.3 -->
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>13.0.7</version>
</dependency>

<!-- Jakarta EE / jakarta.* / Faces 3.0 - Faces 4.0  -->	
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>13.0.7</version>
    <classifier>jakarta</classifier>
</dependency>
SNAPSHOT
<!-- Java EE / javax.* / JSF 2.3 -->
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>14.0.0-SNAPSHOT</version>
</dependency>

<!-- Jakarta EE / jakarta.* / Faces 3.0 - Faces 4.0  -->
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>14.0.0-SNAPSHOT</version>
    <classifier>jakarta</classifier>
</dependency>

<repositories>
  <repository>
    <id>sonatype-snapshots</id>
    <name>Sonatype Snapshot Repository</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases>
        <enabled>false</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>

Usage


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:jsf="http://xmlns.jcp.org/jsf"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<h:head>

	</h:head>

	<h:body>

		<p:spinner />

	</h:body>
</html>

Demo


Please refer to the showcase in order to see the full usage of the components. Sources of PrimeFaces showcase are available within module primefaces-showcase.

Contribution


Visit the contribution page for detailed information.

Release Instructions


  • Run mvn versions:set -DgenerateBackupPoms=false -DnewVersion=14.0.0 to update all modules versions
  • Commit and push the changes to GitHub
  • In GitHub create a new Release titled 14.0.0 to tag this release
  • Run mvn clean deploy -Prelease to push to Maven Central
  • Rename Milestone in GitHub Issues and close it
  • Create a new Milestone

License


Licensed under the MIT License.

primefaces's People

Contributors

blutorange avatar buunsal avatar cagataycivici avatar christophs78 avatar cnsgithub avatar dependabot[bot] avatar doleron avatar erickdeoliveiraleal avatar fanste avatar firsthour avatar flipwarthog avatar hatspencer avatar jasonex7 avatar jepsar avatar jfarcand avatar jungm avatar matinh avatar melloware avatar mertsincan avatar msgeissler avatar nicolaisotta avatar obreidenbach avatar rapster avatar ravihariharan avatar rdebusscher avatar stiemannkj1 avatar sudheerj avatar tandraschko avatar wal-jan avatar wsaca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

primefaces's Issues

LayoutUnit gutter attribute ignored if collapsible is false

As mentioned here:

http://forum.primefaces.org/viewtopic.php?f=3&t=14863&p=45313#p45313

The gutter attribute wont have any effect if you set a layout units' caollapsible attribute to "false".

Proposed patch is

Index: org/primefaces/component/layout/LayoutRenderer.java
===================================================================
--- org/primefaces/component/layout/LayoutRenderer.java (revision 7645)
+++ org/primefaces/component/layout/LayoutRenderer.java (working copy)
@@ -104,8 +104,8 @@
                 if(unit.getMinSize() != 50) writer.write(",minSize:" + unit.getMinSize());
                 if(unit.getMaxSize() != 0) writer.write(",maxSize:" + unit.getMaxSize());

+                writer.write(",spacing_open:" + unit.getGutter());
                 if(unit.isCollapsible()) {
-                    writer.write(",spacing_open:" + unit.getGutter());
                     writer.write(",spacing_closed:" + unit.getCollapseSize());
                 }

RowExpansion problem with a Lazy Datatable

A datatable getting its data from a lazydatamodel. The table also contains a rowexpander. This is how it looks:

<p:datatable var="productgroup" value="#{productbean.productgroups}">
    <p:column>
        <p:rowToggler/>
    </p:column>
    <p:column>
        <h:outputText value="#{productgroup.name}"/>
    </p:column>
    <p:rowExpansion>
        <p:datatable var="product" value="#{productgroup.products}">
            <p:column>
                <h:outputText value="#{product.name}"/>
            </p:column>
            <p:column>
                <h:outputText value="#{product.description}"/>
            </p:column>      
        </p:datatable>
    </p:rowExpansion>
</p:datatable>

The EL expression #{productbean.productgroups} returns a LazyDataModel.

Initially the datatable is displayed OK. However when I expand a row, JSF reports that it cannot evaluate the #{productgroup.products} expression (the expression on the second datatable).

Improve DataTable LiveScroll Performance

Window live scrolling, with specified number or rows N. It displays only the current N rows, where on scrolling down dataTable removes previous rows from view and load new ones and vice versa for scrolling up.

Motivation:
dataTable with large number of rows produces large number of DOM elements on the page. Although, with live scrolling, this can be initially solver, after 10 scrolls down, the number of DOM elements is increasing rapidly, especially if you have a dataTable with significant number of columns (>=10).
Users usually scroll down through dataTable (that's the purpose of scrollinhg) thus creating more and more DOM elements on page. If you breach some critical number of these on page, you are facing a serious problem of rerendering this page without reloading it. Therefore, I believe this would be an important innovative improvement on dataTable.

Benefits:

  1. Keeping the number of DOM elements low
  2. Feeling of continuous result set and scrolling is kept

Dashboard: Dynamic Panels

Enhance dashboard to support dynamic panels using ui:repeat or built-in iteration along with static panels.

p:autoComplete displays unconverted text when validation fails

When having a p:autoComplete with a validator and the validation fails, the "raw" (unconverted) value of the invalid selection is displayed instead of the previously selected valid value.

Suggestion:
In AutoCompleteRenderer#encodeInput replace

            if(ac.isValid()) {
                requestMap.put(var, ac.getValue());
                itemLabel = ac.getItemLabel();
            }
            else {
                Object submittedValue = ac.getSubmittedValue();
                itemLabel = (submittedValue == null) ? null : String.valueOf(submittedValue);

                if(itemLabel == null && ac.getValue() != null) {
                    requestMap.put(var, ac.getValue());
                    itemLabel = ac.getItemLabel();
                }
            }

with

            if(ac.isValid()) {
                requestMap.put(var, ac.getValue());
                itemLabel = ac.getItemLabel();
            }
            else {
                // Display label of previously set value if validation fails
                itemLabel = ac.getItemLabel();

                if(itemLabel == null && ac.getValue() != null) {
                    requestMap.put(var, ac.getValue());
                    itemLabel = ac.getItemLabel();
                }
            }

XML escaping in callback param rendering

Partial Response: JSON serialized objects lead to invalid XML if base objects contain attributes with special characters like '<' or '>'

Suggestion:

add XML escaping in PrimePartialResponseWriter.encodeCallbackParams(Map<String, Object>) with org.json.XML.escape(String string) as follows:

private void encodeCallbackParams(Map<String, Object> params) throws IOException, JSONException {

if (params != null && !params.isEmpty()) {

    startExtension(CALLBACK_EXTENSION_PARAMS);
    write("{");

    for (Iterator<String> it = params.keySet().iterator(); it.hasNext();) {
    String paramName = it.next();
    Object paramValue = params.get(paramName);

    if (paramValue instanceof JSONObject) {
        String json = ((JSONObject) paramValue).toString();
        json = XML.escape(json);
        write("\"");
        write(paramName);
        write("\":{");
        write(json.substring(1, json.length() - 1));
        write("}");
    } else if (paramValue instanceof JSONArray) {
        String json = ((JSONArray) paramValue).toString();
        json = XML.escape(json);
        write("\"");
        write(paramName);
        write("\":[");
        write(json.substring(1, json.length() - 1));
        write("]");
    } else if (isBean(paramValue)) {
        String json = new JSONObject(paramValue).toString();
        json = XML.escape(json);
        write("\"");
        write(paramName);
        write("\":");
        write(json);
    } else {
        String json = new JSONObject().put(paramName, paramValue).toString();
        json = XML.escape(json);
        write(json.substring(1, json.length() - 1));
    }

    if (it.hasNext()) {
        write(",");
    }
    }

    write("}");
    endExtension();
}
}

Add beforeShow to calendar

This is a javascript callback to execute before calendar popup is shown.

<p:calendar beforeShow="test" ... />

function test(input, instance) {
    //
}

Block multiple components with BlockUI

t would be helpful if we had possibility to to add more than one area to be blocked on particular ajax action

<p:blockUI block="area1, area2" target"someTarget"/>

p:link does not consider f:param tag

I have the following:

<p:column>
    <h:link outcome="some-outcome">
      <f:param name="someid" value="theid"/>
    </h:link>
</p:column>

and

<p:column>
    <p:link href="some-outcome">
      <f:param name="someid" value="theid"/>
    </p:link>
</p:column>

The default h:link correctly adds the f:param value as a query parameter to the request url, while the p:link does not.

Is there a reason why p:link does not support f:param or is this just a bug?

Caveat: The above code is within a p:datatable component.

Enable datatip for Pie and Donut charts

Datatip enables showing information about series in a tooltip. Add following methods to PieChartModel and DonutChartModel;

  • showDatatip = true;
  • datatipFormat = "%s - %d";

Datatable pagination + rows broken if both are dynamic

Hello,

When both pagination and rows are used together it does not always work correctly. We have a use case with a simple table with 15 rows and when you click advanced it instead uses 100 rows with pagination.

That works fine - but when you selected another page say page nr 2 you are hitting UIData#updatePaginationData then when you switch back to the simple table with 15 rows it get's stuck using 100 rows because UIData#updatePaginationData will not get touched again resetting the value.

What worked for me as a workaround was to override DataTableRender#encodeTbody and add this

    if (rowCount < rows) {
        rows = rowCount;
    }

Not sure if the if (rowCount < rows) sanity check is okay or not. I am not sure if this weird line can be changed instead:

    int rowCountToRender = rows == 0 ? (table.isLiveScroll() ? (table.getScrollRows() + table.getScrollOffset()) : rowCount) : rows;

Using primefaces 5.2 with latest TomEE (1.7.1)

ImageSwitch resource imageswitch.css does not exist.

Wherever a Primefaces ImageSwitch is used, the page reports that imageswtich.css(.jsf) could not be loaded. Looking through the source shows that this file doesn't even exist at all. It should be in primefaces/src/main/resources/META-INF/resources/primefaces/imageswitch/ but it doesn't exist. Other components such as ImageCropper have css files of their own, but the ImageSwitch appears to be missing this.

It should be created or, if it is not meant to exist, it should be removed as a requirement in the component itself.

fileUpload breaks with single quote inside validation messages

With PF 4.0 : Single quotes are not escaped and it makes JS crash when displaying a message.

Can be reproduced with :

<p:fileUpload
  fileUploadListener="#{fileUploadView.handleFileUpload}"
  mode="advanced"
  multiple="true"
  sizeLimit="100000" 
  fileLimit="3" 
  allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
  invalidSizeMessage="Something with quote ' "
  invalidFileMessage="Something with quote ' "
  fileLimitMessage="Something with quote ' "
  messageTemplate="{name} {size} ' ">
</p:fileUpload>

Probably related to https://code.google.com/p/primefaces/issues/detail?id=5593 and https://code.google.com/p/primefaces/issues/detail?id=6532.

TreeTable and c:choose

PrimeFaces 5.1, Mojarra 2.2.10, Tomcat 7.0.59, JSTL 1.2

<p:treeTable var="parametro" sortBy="#{parametro.nome}"
         value="#{bwCadastroParametro.root}">
<p:column style="width: 25% !important;"
          headerText="#{pptCadastroParametro.CodigoLabel}">
    <c:choose>
        <c:when test="#{parametro.listEnumDescValor != null}">
            <h:outputText value="in c:when true"/>
        </c:when>

        <c:otherwise>
            <h:outputText value="in c:otherwise #{parametro.listEnumDescValor != null}"/>
        </c:otherwise>
    </c:choose>
</p:column>
</p:treeTable>

The code above is not working, it always print "in c:otherwise true".
Notice that the "true" is the same condition that is used c:when test's attribute.
If I use "true eq true" as test condition it works.

DataExporter choice of the CSV Separator

We'd like to choose the CSV separator for the DataExporter component, for instance use semicolon or tab in place of comma.

Why ?
Because in no Anglo-Saxon countries (at least in France), Microsoft Excel uses semicolon as the default CSV file separator. As a result, a CSV document exported with the DataExporter component doesn't open properly (the user has to reopen the document in choosing the coma separator to have the columns rightly displayed).

We suggest to add an attribute "CsvSeparator" to the DataExporter component that will allow to choose the Csv separator character.

Scrollable Tree

Add scrolHeight attribute to tree, when defined tree should scroll if content height overflows scroll height.

Add positionType to Dialog

Default positioning of dialog is fixed meaning dialog will be in viewport as page scrolls. Introduce new positionType attribute to allow setting absolute as the alternative value so that dialog will not scroll along with the page.

<p:dialog positionType="fixed|absolute" ...

f:ajax throws JS error with PF components on Firefox

In PrimeFaces 5+, if I use an f:ajax tag as an event handler under a datable (or other components), I get a JavaScript error in Firefox, "event is undefined". It works in other browsers.

I traced it through to CoreRenderer.java, in PF 4 it was wrapping ClientBehavior scripts in a block like this:

writer.write("function(event,ext){PrimeFaces.bc(this,event,ext,[");

In PF 5 it was changed to this:

writer.write("function(ext) {");

MyFaces seems to generate JS for f:ajax that looks like this:

jsf.ajax.request('id',event,...)

Since the wrapper function no longer has an event argument, it causes a JS error in Firefox (Chrome, IE, Opera and Safari have a global event object, so it works there).

I have a small project I made to demonstrate by modifying the Showcase example, I will try to attach.

Add FilterMeta to LazyDataModel

It would be a great improvement if LazyDataModel had a method like this:

public List load(int first, int pageSize, List multiSortMeta, List filterMeta)

FilterMeta would have the field name, filtered value and the improvement would be the filter match mode.

I have a generic data model the extends the LazyDataModel. If I have the filter match mode I can use it to dynamically condition the like clause from my SQL for each filtered field.

Thanks,

fkjaekel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.