JSF 2.2 displayValueOnly - jsf

Is there a possibility to use the option "displayValueOnly" (https://wiki.apache.org/myfaces/DisplayValueOnly) with JSF 2.2?
I think the link above is explaining the feature of Tomahawk which exists only for older JSF versions, right?
Is there a alternative for creating a read and edit mode without creating two elements and without using "readOnly" or "disabled"?
Thank you!

Tomahawk is not compatible with JSF 2.2 - I've tried a few components and they work fine for others you've to work on the Tomahawk source.

Related

How to use different primefaces versions in one project?

In my project I have to implement a page which use primefaces v6.1 but other pages are written in primefaces version 3.
Its hard to update versions for other pages, on the other hand i dont want to use v3 for the new page.
First i have a idea; manipulating primefaces-p.taglib.xml which is in META-INF,
<namespace>http://primefaces6version.org/ui</namespace> . Try to use in the xhtml page:
xmlns:p="http://primefaces6version.org/ui" and components now can be in primefaces 6 versions! But its not worked, i dont know why.
Is there any idea how to use different primefaces versions in same project?
This is not easily possible and would require a lot of work. It would e.g. require fully refactored (classes renamed etc) version of PrimeFaces including everything in the taglibs and more. You could try just creating a customized PF version for just the datatable, but personally I'd bite the apple and upgrade the application.

When and why we use the verbatim in jsf?

As i am now working on jsf i want to know why we use the tag verbatim in jsf and what is the significance of it ?
Any help would be of great appreciation.
Since you've tagged your question with jsf-2 the answer is: you shouldn't use it.
It is deprecated in JSF 2.0. It was a part of JSF 1.X and used to hold plain HTML. See also this answer, the docs (since 2.1 there is an additional info: The use of this element has been deprecated in Facelets for JSF 2.0 and beyond) and the usage example.

Can I use PrimeFaces push with just PrimeFaces and Extensions jars?

I don't understand how to use PrimeFaces Push when I have PrimeFaces 5.1 jar and PrimeFaces Extensions 2.1.0 in my classpath.
Are there any other jar dependencies that I need to take care of?
Could you please provide me the brief clarification on this, please?
Read Primefaces 5.1 documentation page 12
After that you need to read entire chapter 9. Only after reading that and checking tutorials ask your next question. Please read twice if time permits

Are RichFaces 3.3.3 and JSF 2.1 going to work fine together?

Currently I'm using JSF 1.2 and RichFaces 3.3.3 and they work fine. But am I going to have to update my current RichFaces version up to 4.x and make the changes, coprresponding to the migration guide if I decide to update my JSF version up to 2.1.29. I mean are there components which are not going to work appropriate or ever work at the JSF 2.1.29 + RichFaces 4.x(4.5.2 in particularly) combination. I mean components like a4j:keepAlive which I think should be replaced with something else.
Basically they are going together but with some limitations, because RichFaces 3.3.3 does not support some JSF 2 functionalities like built-in facelets (VDL), Bean Validation (JSR-303), JSF 2 afax functionality, ... see here.
But there are some workarounds to get over the limitations...
The problems you will depends strongly on the used Richfaces Components in your project.
If you want to use JSF 2 (2.0, 2.1, 2.2) and its benefit, I would consider also updating to RichFaces 4 (4.0, 4.1, 4.2, 4.3, 4.4, 4.5) in order to get all the benefits from JSF 2. You need to investigate time for both solutions. But if you go with RichFaces 4, future changes will be more efficient I think.
If you decide to stay on Richfaces 3.3, I would consider update the version to 3.3.4 which consists of a security patch applied to the 3.3.3.Final release and which introduces basic JSF 2 support to the 3.3.X branch.

Omnifaces: Using CombinedResourceHandler with Richfaces

when using CombinedResourceHandler in a Richfaces application only stylesheets and user defiend scripts are combined. The standard JavaScript resource and all Richfaces specific resources remain as seperated resources.
The Omnifaces documentation states:
RichFaces has the same problem with several JS files, but this is so far not exactly trivial to workaround
So my question is what this 'non-trivial workaround' would be?
As far as I can see, CombinedResourceHandler wont handle resources when getRendererType() returns org.richfaces.renderkit.ResourceLibraryRenderer. These are then handled by org.richfaces.renderkit.html.ResourceLibraryRenderer.
I am not sure what would be the best way to combine RichFaces behaviour with OmniFaces here.
I was able to create a solution by modifying OmniFaces CombinedResourceHandler.
Details in short:
Richfaces utilizes a concept called ResourceLibrarys wich means a resource may not only be a single file but instead a collection of those files. For example, RichFaces uses a resource named base-component.reslib. RichFaces ResourceHandler interpretes this resource dependency as dependency to
javax.faces:jsf.js
jquery.js
richfaces.js
richfaces-base-component.js
So the CombinedResourceHandler needed some extra functionality to seperate dependencies to ordinary Resources from Richfaces ResourceLibraries. The latter needed to be resolved according to specifications obtained from RichFaces sources.
It was not trivial to work this around without modifying the CombinedResourceHandler itself. The CombinedResourceHandler itself has really to be modified to use a reflection hack which extracts the resources from RichFaces' org.richfaces.resource.ResourceLibraryFactoryImpl. The reflection hack is necessary in order to keep OmniFaces free of RichFaces dependencies so that it can be used together with other component libraries like PrimeFaces.
As per issue 107, this was implemented in 1.3-20121206.

Resources