Port ListShuttle component from RichFaces to PrimeFaces - jsf

We are using an application with primefaces 4 with JBoss EAP 6.1. One of the screens need a listshuttle component which is not available in primefaces but available in rich faces.
Is there an easy way to create the custom component using reference of rich faces implementation or any other work around?

There's a PrimeFaces component that works like a listshuttle: the pickList.
I am aware that the showcase is for 5.0, however, I worked on a project that used PF 4.0 and we had a few pickLists.
http://www.primefaces.org/showcase/ui/data/pickList.xhtml
It's customizeable in its interface (check the PickList on steroids section), and in its actions via the onTransfer method. Cheers.

Related

c:if as part of composite:insertChildren

I am trying to migrate one app to new app server and JSF seems to start behaving differently due to different JSF implementation. It is MyFaces 2.0 now, that I am having problem with. This worked on older server:
there is composite component <abc:form> that includes <composite:insertChildren> tag.
when using this component in xhtml like this:
<abc:form>
<c:if test="true">
this text will not be visible. But it should be.
</c:if>
</abc:form>
this <c:if... part is children. However nothing is rendered. As if c:if resolved to false, or no testing occurs.
I am aware that this case can be resolved by utilizing <h:outputText> instead of <c:if>, but I have a lot of code where <c:if> is included in more complex children. This example is just a simplification that describes my pain.
So, is it legal to have jstl tags that are includeable as children to components? I assume JSP/JSF lifecycles are to blame here.
edit: As visible in comment below, this is a combination of JSF and portlet (WebSphere Portal 9 on WAS 8.5.5). I am still not sure whether portal (and portal bridge) or pure JSF is to be blamed here. Therefore I created demo project that manifests my problem. If there is any kind soul that can use this code to try deploying it to his/hers own portal, it would be much appreciated.
It was created in Rational Application Developer, by creating new portlet project with one JSF portlet inside. Then I added composite component to WebContent/resources, and modified default portlet view (xhtml).
Exported projects from RAD
I tested your code locally in a simple Tomcat webapp and c:if worked as expected as a child of your composite component. From your comments, you indicated that you are using the MyFaces Portlet Bridge for JSF 2.0. That version of the bridge is 3.0.0-alpha. Since things worked correctly in a webapp (even with MyFaces Core 2.0.0) and the portlet bridge version is still alpha, it seems extremely likely that there is a bug in the bridge (maybe PORTLETBRIDGE-179 ?). Since MyFaces bridge is no longer maintained, I'm doubtful that the bridge will ever be fixed.
I'd recommend that you work around this issue by replacing JSTL tags with JSF HTML tags that essentially render the same markup:
<c:if test="true">... -> <h:panelGroup rendered="true">...
<c:choose><c:when test="true">...<c:otherwise>...
->
<h:panelGroup rendered="true">...<h:panelGroup rendered="false">...
<c:set> -> <ui:param>
<c:forEach> -> <ui:repeat>
See also: JSTL in JSF2 Facelets... makes sense?
One other, more difficult solution would be to implement your composite component as a simple custom Java component or full custom Java component instead.
If there is any kind soul that can use this code to try deploying it to his/hers own portal, it would be much appreciated.
I could not reproduce this issue in Liferay 7.0 + JSF 2.2 + Liferay Faces Bridge 4.1.2. c:if worked fine as a child of your composite component. Full disclosure, I am a Liferay Faces Bridge developer. Unfortunately, I don't think Liferay Faces Bridge will solve your issue since we only support Mojarra (not MyFaces) and JSF 2.1+.

Can Bootsfaces be used with Richfaces?

I have a web application with the following:
JSF 2.2.6
Java 1.7
Tomcat 8
Richfaces 4.5.7
Omnifaces 2.2
I would like to enhance the look and feel of the web app to use Bootsfaces. I have added Bootsfaces jar to my project (via .ivy) and rebuilt.
Before even updating the first web page to use Bootsfaces in the project I wanted to see if there were any conflicts after adding the Bootsfaces jar. It seems there is. I am getting the following errors shown in Firebug:
ReferenceError: jsf is not defined
TypeError: RichFaces.ui is undefined
Does anyone know whether Bootsfaces works with Richfaces and if so could they kindly provide a link with migration steps to follow?
Currently, we, the BootsFaces team, do not support RichFaces. We strive for compatibility with PrimeFaces, OmniFaces, AngularFaces and - if possible - ButterFaces. Neither RichFaces nor ICEFaces are on our list.
However, if someone were to join our team in order to support RichFaces, they'd certainly be welcome!

Custom component in IceFaces?

Who knows how to create a custom component in an old version of IceFaces 1.6.2? I didn't find anything in the web about that, just some materials about custom components for JSF 1.1. Please, show me simple "Hello World" custom component with file name and directory declaration.
Please look at http://www.exadel.com/tutorial/jsf/jsftutorial-customcomponents.html
JSF Tutorial. You do not need special example for IceFaces 1.6.2, you can use IceFaces component within you own jsf component.

Is p:media incompatible with view scope?

I am using jsf 2.1 in a web project with primefaces 3.5 and glassfish 3.2.
When I use p:media tag along with a view scoped managed bean, an error occurs indicating an xml parsing error.
I am not pretty shure if this leadds to the same problem like with using Richfaces and its a4j:mediaOutput. There you cannot use it in ViewScope but here is a link to a workaround. I hope it fits to your problem.

How to add seam in existing JSF application?

I have existing JSF portlet application running in Liferay ,How to add Seam support? I am using JSF2. Also I am confused which seam version should I use? Seam2 or Seam3?
Thanks,
Manoj
I've not added Seam support to an existing JSF application, so I can't comment on that part. If you are using JSF2, though, your only option at this point is Seam 3. Support for JSF2 is slated for Seam 2.3, but that is in Beta right now. Here's the latest info I've seen on Seam 2.3: https://community.jboss.org/blogs/marek-novotny/2012/04/02/seam-230beta1-is-out

Resources