# Migration guide 14.0.0 -> 15.0.0

## Breaking Changes

!> **Legacy ThemeRoller themes are no longer supported and will not render correctly. Please migrate to the new PrimeFaces themes.**

!> **Paginator component now uses `button` instead of `link` so be aware if you have any custom CSS or JS that targets the `link` element.**

## Themes

If you use `Vela`, `Arya`, `Bootstrap`, `Luna`, `Material` or `Nova` themes, please note that the theme files have been moved to the `themes` module in the separate jar file `primefaces-themes.jar`.

```xml
<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces-themes</artifactId>
    <version>15.0.0</version>
</dependency>
```

## Deleted

  * Deleted `Chart.js` legacy components and Java models as its been deprecated since 14.0.0
  * Deleted `InputSwitch` as its been deprecated since 10.0.0
  * Deleted **Apache Commons FileUpload** support for native uploading now that Servlet 3.0 is the minimum requirement.
  * Deleted `autocomplete="off"` from any hidden inputs as is recommended by w3c spec
  * Deleted long time deprecated `primefaces.LEGACY_WIDGET_NAMESPACE`
  * Deleted deprecated `layout="grid"` layouts in `DataGrid`, `SelectOneRadio`, `SelectManyCheckbox` and others
  * Removed additional themes from primefaces.jar (only saga is still there), you now need to include `primefaces-themes.jar`. Please check the docs. 
  * Deleted legacy client-side JavaScript methods that were unused and sometimes did not even work properly anymore. Affects:
    * `PrimeFaces.setCaretToEnd`. Unused and did not work. Use `element.setSelectionRange(0, element.value.length)` on an `HTMLInputElement` or `HTMLTextAreaElement` if you need that functionality.
    * `PrimeFaces.getSelection`. Worked, but returned a string or Selection object, whereas it was meant to always return a string.
    * `PrimeFaces.hasSelection`. Did not work and always returned `false`.

## Deprecated

  * `Separator` component is deprecated since 15.0.0, please switch to `Divider`.
  * `Spacer` component is deprecated since 15.0.0, please use any of the modern CSS methods of spacing. We are not deleting it as it's been around since PF 2.0 and used widely in applications.
  * The `allSuffix` attribute of the `importEnum` is deprecated since 15.0.0. Please use the special key `ALL_VALUES` to
    access all values, which is and was always available.
  * The themes saga, arya and vela are now called saga-blue, arya-blue and vela-blue. The old names are still supported but will removed in the next version.

## AutoComplete

  * `emptyMessage` attribute is reinstated and defaults to `No records found.` from Messages_{locale}.properties to control the message when there is no data to display.

## Barcode

  * Barcode component now uses the **Okapi** library for barcode generation instead of `barcode4j` and `qrcodegen`. Simply update your dependency to use **Okapi** instead.
  * `magnification` attribute is new and defaults to `2.0` to control the size of the barcode.

## FilterMeta

  * `FilterMeta` has a new `normalize` property which is read from the Datatable/TreeTable `isFilterNormalize` property to handle diacritics.

## Core

  * Class `org.primefaces.component.api.UIData` was renamed `org.primefaces.component.api.PrimeUIData`.
  * Context param `primefaces.HTML5_COMPLIANCE` now defaults to `auto`.

## Calendar

  * `defaultMillisec` was renamed to `defaultMillisecond`.

## DatePicker

  * `yearNavigator` was changed from `Boolean` to `String` to allow more flexibility. Display the year navigator. When set to `'true'` or `'input'`, the year is shown as a numeric input, which is accessible for visually impaired users. If set to `'select'`, it appears as a dropdown menu. The default setting is `'false'`.

## FeedReader

  * Switched from [Rome](https://rometools.github.io/rome/) library which uses XML parsing to non XML very fast [RSS Reader](https://github.com/w3stling/rssreader)

## FileUpload

* **Removed Messages**
  The following attributes have been removed:

  * `invalidSizeMessage`
  * `invalidFileMessage`
  * `fileLimitMessage`

  PF I18N will now be used instead.
  See the English example: [locale-en.js](https://github.com/primefaces/primefaces/blob/2c7e80045eeb34f9b248cd56407671c5e65e5c0d/primefaces/src/main/resources/META-INF/resources/primefaces/locales/locale-en.js#L228-L233)

  ```js
  "primefaces.FileValidator.FILE_LIMIT": "Maximum number of files exceeded.",
  "primefaces.FileValidator.FILE_LIMIT_detail": "Maximum number: {0}.",
  "primefaces.FileValidator.ALLOW_TYPES": "Invalid file type.",
  "primefaces.FileValidator.ALLOW_TYPES_detail": "Invalid file type: '{0}'. Allowed types: '{1}'.",
  "primefaces.FileValidator.SIZE_LIMIT": "Invalid file size.",
  "primefaces.FileValidator.SIZE_LIMIT_detail": "File '{0}' must not be larger than {1}.",
  ```

* **Removed Attributes**

  * `sizeLimit`
  * `fileLimit`
  * `allowTypes`
  * `virusScan`

  Please attach `p:validateFile` to the `p:fileUpload` component.
  If you want to validate on the client, make sure to **enable Client-Side Validation**.

* **dropZone Changes**
  When using `dropZone`, you must now explicitly set:

  * `mode="advanced"`
  * `auto="true"` (if needed)
    These are no longer set automatically.

* **Renamed Attributes**

  * `dragDropSupport` → `dragDrop`
  * `validateContentType` → `contentType` (on `p:validateFile`)

## InputNumber

  * `padControl` attribute was changed from `Boolean` to `String` to allow more flexibility. Allow padding the decimal places with zeros. If set to 'floats', padding is only done when there are some decimals (up to the number of decimal places from the decimalPlaces variable). If set to an integer, padding will use that number for adding the zeros. If set to "true" it will always pad the decimal places with zeroes, and never if set to "false". Default is "true"

## Menus

  * Default render behaviour of *empty* (not having any relevant/rendered child) menu containers has changed. In the past the container div was always rendered regardless of its children. Now the container div is only rendered if there are any relevant children.
    Affected components: `Breadcrumb`, `ContextMenu`, `MegaMenu`, `Menu`, `Menubar`, `MenuButton`, `PanelMenu`, `SlideMenu`, `Stack`, `Steps`, `TabMenu`, `TieredMenu`

## Paginator
  * All actions are now rendered as `button` and not `link` anymore.

## ProgressBar
  * `value` label is now rendered inside the `value` div to match other PrimeTek libraries.

## Showcase
  * Was migrated to Jakarta EE 10. Requires e.g. Jetty 12 and Java 17 to run stand-alone.

## Tree / TreeTable
  * `CheckboxTreeNode` now inherits from `DefaultTreeNode` to eliminate duplicate code
  * `TreeNode#getChildren` return value has been change to `TreeNodeChildren`. It was `List<TreeNode>` before but our code also only accepted `TreeNodeList`.
  * `TreeNodeList` has been deprecated, please use `DefaultTreeNodeChildren` or `CheckboxTreeNodeChildren`.

## TriStateCheckbox
  * `value` must now be Boolean and possible values are `null`, `true`, `false`

## Toolbar

  * Default render behaviour of *empty* (not having any relevant/rendered child) toolbar containers has changed. In the past the container div was always rendered regardless of its children. Now the container div is only rendered if there are any relevant children. Separators/Dividers are not considered relevant children, meaning a toolbar with only separators will not be rendered.
