I have problem with remoteCommand. This component never invoke oncomplete and working only one time. Where I made mistake?
<p:remoteCommand name="showClientEditPopup" action="#{clientController.setCurrentClient}" oncomplete="alert('OnComplete');">
</p:remoteCommand>
In my case it was problem with library noty.js (I'm migrating app from RichFaces to PrimeFaces). Solution was simple - migrate noty.js to newer version.
Related
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+.
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.
I am new to jsf.
I am working on migration project.
In this I need to migrate from jsf1.2 to 2.1
and richfaces as well..
In general what I need to change?
I have one more requirement that navigation rules must be quoted explicitly in faces-config.xml?
How to write these rules in faces-config.xml?
Thanks in Advance
First you should understand that this is a painfull to migrate from JSF 1.x to jsf 2.x but it is even more painfull to migrate from Richfaces 3 to Richfaces 4.
JSF 1.x to 2.x upgrade can be done independently from Richface upgrade. So I would recommend you first update JSF and check that everything is working and only after that try updating Richfaces. Look at this question about JSF migration for more info. Or just google it. There is a lot of info about it.
Richfaces 3 to 4 migration is very very painfull because JSF 2 introduced it's own ajax and you will need to change a lot of attributes all overt the project. But the biggest pain is that Richfaces 3 work much more stable than Richfaces 4. Richfaces 4 is very buggy. I can list some bugs that I encountered and some solutions for them.
rich:autocomplete is very buggy. Not sure if it is fixed already
but when I tried using it it was not working with Spring in
composite views(<ui:include pages). After I sumbitted bug report
they seem to do something there but not sure if this works now. I
didn't check. https://issues.jboss.org/browse/RF-11469
I would advise you to replace this component with simple jQuery UI
autocomplete component with some spring mvc controller on backend.
rich:tabPanel is very buggy. Separate tabs do not have action
attribute any more. This was breaking functionality with initing tab
contents when the tab was opened with ajax. Immediate attribute also
not working for tabs. Here is the issue on jboss jira: https://issues.jboss.org/browse/RF-11417 workaround is really stupid.
I just went into source code of richfaces and made it working.
Exception handling is very buggy. Seems that exceptions are just
swallowed in many places in richfaces source on ajax requests so you
can not handle them the right way.
I went again into Richfaces code and removed exception swallowing by
throwing out exceptions.
rich:fileUpload component can work and can not work for you. You
can get request prolog can not be read exception in some
cases(This is what I was getting). And This is connected with new
app server feature of reading multipart request into
request.getParts(). And Richfaces do not handle such situation and
error out because inputstream of multipart request is already read
fully.
I again went to source code of Richfaces and added catch for
situation when request.getParts is not empty. I even created an
issue on Jboss but guys said this works on new Jboss server that's
why it is not an issue(I use tomcat). https://issues.jboss.org/browse/RF-13061 the issue is close still it is not working on tomcat.
A lot of issues on client side. By default multiple forms will not
work on your pages like they were working in jsf 1.2 and richfaces 3
because the viewstate id is not updated where and when it needs to
be.
To fix this you will need to add additional script. It is described
in the answer to this question
Also on the client side you should know that if in the response of
any ajax request you will have some js that will fail everything
stops working. You can not have js errors inside xhtml. The page
will freeze completelly. Also it is tricky to have CDATA tags on
the xhtml pages. They can also fail.
Richfaces messages work the way that sometimes they show up and
sometimes not. They are ajax rendered but seems that they can break
the page. Ajax reposnse can have an update that should update
messages that is not rendered on the page and when it will not find
this message in your html it will stop rendering everything that is
left to update. As a result your links and buttons will not rerender
anything in some cases.
Here evaluating limitRenderattribute helps a lot.
It is a short list. There probably a lot more to be aware of and that you will see after update =)) Richfaces 4 are still buggy.
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.
I want to use reCaptcha on my project with JSF. Corresponding primefaces component doesn't want to work properly inside wizard component. I decided to try to use the code from example for JSP http://code.google.com/intl/en-en/apis/recaptcha/docs/java.html I can not understand how best to remake it to JSF. The problem is in java code injection into JSP and result validation via FacesValidator.
Can someone have any ideas?
Take a look at tomahawk t:captcha on MyFaces SVN. The code only use the standard JSF API (it was updated to use JSF 2.0 ResourceHandler API), so it can help you to build your own using recaptcha.