[JBoss JIRA] (RF-12283) Provide better way to specify maxRequestSize in rich:fileUpload (per component, not globally)
by Jan Papousek (JIRA)
Jan Papousek created RF-12283:
---------------------------------
Summary: Provide better way to specify maxRequestSize in rich:fileUpload (per component, not globally)
Key: RF-12283
URL: https://issues.jboss.org/browse/RF-12283
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-input
Affects Versions: 4.2.2.Final
Reporter: Jan Papousek
Now, when developer wants to specify size limit for uploaded files, he/she has to specify 'rg.richfaces.fileUpload.maxRequestSize' context parameter in web.xml:
{code}
<context-param>
<param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
<param-value>100000</param-value>
</context-param>
{code}
It would be much better to provide an attribute (e.g. 'sizeLimit') for rich:fileUpload component. Why? Consider the following use cases:
- different size limit for text files and images
- different size limit depending on user's role
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12276) js-Tags rendered in wrong order
by Christian Werner (JIRA)
Christian Werner created RF-12276:
-------------------------------------
Summary: js-Tags rendered in wrong order
Key: RF-12276
URL: https://issues.jboss.org/browse/RF-12276
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.2.2.Final
Environment: MyFaces 2.1.7, Tomcat 6.0.35
Reporter: Christian Werner
This bug is affected in IE8, works with Firefox
After submit a form (using the action method of commandButton in a popup panel), appear in various javascript errors on IE8:
{noformat}
Benutzer-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)
Zeitstempel: Tue, 22 May 2012 13:16:54 UTC
Meldung: 'jQuery' ist undefiniert
Zeile: 3
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/javax.faces.resource/richfaces-utils.js....
Meldung: 'jQuery' ist undefiniert
Zeile: 1
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/javax.faces.resource/AutocompleteBase.js...
Meldung: 'jQuery' ist undefiniert
Zeile: 1
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/javax.faces.resource/Autocomplete.js.jsf...
Meldung: Objekt erwartet
Zeile: 189
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 193
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 197
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 201
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 205
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 209
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 213
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 217
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 221
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
Meldung: Objekt erwartet
Zeile: 225
Zeichen: 1
Code: 0
URI: http://christian:8080/webseed.ui/jsp/propagation/propagations.jsf?convers...
{noformat}
A couple of javascripts of richfaces components (ie. autocomplete.js) are rendered before the jquery script in the DOM. The autocomplete component works then no longer in IE8.
It then looks like this:
{noformat}
<link rel="stylesheet" type="text/css" href="/webseed.ui/javax.faces.resource/print.css.jsf?ln=styles.print" media="print" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-utils.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-selection.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/AutocompleteBase.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/Autocomplete.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/Autocomplete.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/jsf.js.jsf?ln=javax.faces&stage=Development&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/jquery.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-queue.js.jsf?conversationContext=1">
{noformat}
The normal output looks like this. Comically affected are the scripts at the end to find. Coincidence?
{noformat}
<link rel="stylesheet" type="text/css" href="/webseed.ui/javax.faces.resource/print.css.jsf?ln=styles.print" media="print" /><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/javax.faces.resource/layout.css.jsf?ln=styles&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/jsf.js.jsf?ln=javax.faces&stage=Development&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/jquery.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-queue.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-base-component.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/status.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-event.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/popupPanel.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/popupPanelBorders.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/popupPanelSizer.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/popupPanel.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/component-control.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/togglePanel.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/tabPanel.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/tabPanel.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/togglePanelItem.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/tab.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/poll.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/toolbar.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/toolbar.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/jquery.position.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/popup.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/menuKeyNavigation.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/menu-base.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/menu.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/dropdownmenu.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/menuitem.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/message.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/msg.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/jquery.hotkeys.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/hotkey.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/collapsiblePanel.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/collapsiblePanelItem.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/icons.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/collapsiblePanel.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/panel.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/datatable.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/datatable.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/tooltip.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/tooltip.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/datascroller.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/datascroller.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><link rel="stylesheet" media="screen" type="text/css" href="/webseed.ui/rfRes/list.ecss.jsf?db=eAHrmrY!HgAFywI!&ln=org.richfaces&conversationContext=1" /><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-utils.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/richfaces-selection.js.jsf?conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/AutocompleteBase.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script><script type="text/javascript" src="/webseed.ui/javax.faces.resource/Autocomplete.js.jsf?ln=org.richfaces&conversationContext=1"><!--
//--></script>
{noformat}
Nice greetings,
Christian
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12268) 4.1.0.final javascript error : element is null, ajax queue operation
by zhifu Jin (JIRA)
zhifu Jin created RF-12268:
------------------------------
Summary: 4.1.0.final javascript error : element is null, ajax queue operation
Key: RF-12268
URL: https://issues.jboss.org/browse/RF-12268
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component
Affects Versions: 4.1.0.Final
Reporter: zhifu Jin
the issue is when have two requests like below will cause js error:"element is null" and browser crash.
1. first request sending, and don't have response arrived.
2. the second request start, will add this request into queue.
3. first response arrived , the second request will be dequeue and send request, it will find source element first, and our page had changed, the element is null.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12022) showcase - UAgentInfo is not serialized
by Juraj Huska (JIRA)
Juraj Huska created RF-12022:
--------------------------------
Summary: showcase - UAgentInfo is not serialized
Key: RF-12022
URL: https://issues.jboss.org/browse/RF-12022
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: showcase
Affects Versions: 4.2.0.Final
Environment: -showcase,
-Tomcat 6,7,
-arquillian tests
Reporter: Juraj Huska
Priority: Trivial
When running functional tests for showcase with Arquillian on Tomcat 6 or 7, I am encountering following exception during showcase undeploying process:
{code}
WARNING: Cannot serialize session attribute userAgent for session E4F43AA62674D093726971AC8361F9F8
java.io.NotSerializableException: org.richfaces.demo.ui.UAgentInfo
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1585)
at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:1015)
at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:528)
at org.apache.catalina.session.StandardManager.unload(StandardManager.java:469)
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:678)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4882)
at org.apache.catalina.manager.ManagerServlet.undeploy(ManagerServlet.java:1390)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:382)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
{code}
UAgentInfo is used by UserAgentProcessor(session scoped bean) and therefore IMHO should be serialized. When I made it serialize-able, the exception disappeared. I did not notice any broken functionality by this exception, and same for the fixed one showcase, only cleaner test output.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12200) Support wildcard or regex on CDK cdk:passThrough and cdk:passThroughWithException
by Paul Dijou (JIRA)
Paul Dijou created RF-12200:
-------------------------------
Summary: Support wildcard or regex on CDK cdk:passThrough and cdk:passThroughWithException
Key: RF-12200
URL: https://issues.jboss.org/browse/RF-12200
Project: RichFaces
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Components: cdk
Affects Versions: 4.2.1.Final
Environment: All
Reporter: Paul Dijou
When using cdk:passThrough or cdk:passThroughWithException, you can specify which attributes are concerned. It would be great if there was the possibility to use wildcards instead, like :
{code}
cdk:passThrough="style on*"
{code}
This one will pass the {{style}} attribute but also all attributes starting with "on" (ultimate usefull for all onclick, onmouseover, ...).
We could also think about supportting any king of regex instead. But it might be a little more complex to use.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12187) CDK: improve messages for errors in parsing XML configs
by Lukáš Fryč (JIRA)
Lukáš Fryč created RF-12187:
-------------------------------
Summary: CDK: improve messages for errors in parsing XML configs
Key: RF-12187
URL: https://issues.jboss.org/browse/RF-12187
Project: RichFaces
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Components: cdk
Affects Versions: 4.2.1.Final
Reporter: Marek Novotny
Assignee: Lukáš Fryč
Fix For: 4.3.0.Milestone1
CDK fails with following output:
{code}
[INFO] --- maven-cdk-plugin:4.2.0.Final:generate (default) @ jboss-seam-ui ---
[ERROR] XML error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
{code}
which hides the real issue.
Add {{exception.getMessage()}} to those messages to reveal real issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12230) [CDK] c:foreach in a cast component will result on a List<Object> instead of List<UIComponent>
by Paul Dijou (JIRA)
Paul Dijou created RF-12230:
-------------------------------
Summary: [CDK] c:foreach in a cast component will result on a List<Object> instead of List<UIComponent>
Key: RF-12230
URL: https://issues.jboss.org/browse/RF-12230
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: cdk
Affects Versions: 4.2.1.Final
Environment: All
Reporter: Paul Dijou
Look at the following code :
{code:xml}
<cdk:object type="javax.faces.component.UIComponent" name="prependFacet"
value="#{component.getFacet('prepend')}"/>
<c:choose>
<c:when test="#{prependFacet.family eq 'javax.faces.Panel'}">
<c:forEach var="child" items="#{component.getFacet('prepend').getChildren()}">
{code}
I'm using a {{<cdk:object>}} to assign my facet to a var. Then I make some test and finally, I want to iterate over the children of my facet. This will result on this Java code on the renderer :
{code:java}
UIComponent prependFacet = component.getFacet("prepend");
if (isEqual(prependFacet.getFamily(),"javax.faces.Panel")) {
for (UIComponent child: component.getFacet("prepend").getChildren()) {
{code}
That's perfect! But now, since I have a var for my facet, why not using it in the {{<c:forEach>}}? Seems natural. So I change my code to :
{code:xml}
<cdk:object type="javax.faces.component.UIComponent" name="prependFacet"
value="#{component.getFacet('prepend')}"/>
<c:choose>
<c:when test="#{prependFacet.family eq 'javax.faces.Panel'}">
<c:forEach var="child" items="#{prependFacet.getChildren()}">
{code}
Only the last line is different from the previous one. What does the generated Java code looks like? That:
{code:java}
UIComponent prependFacet = component.getFacet("prepend");
if (isEqual(prependFacet.getFamily(),"javax.faces.Panel")) {
for (Object child: prependFacet.getChildren()) {
{code}
Whaaaaat?! Why is it a "Object" in the "for" loop and not a "UIComponent" anymore? Of course, the component is now broken since I'm calling {{UIComponent}} methods inside the loop.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] (RF-12231) [CDK] EL empty method doesn't work for Collection
by Paul Dijou (JIRA)
Paul Dijou created RF-12231:
-------------------------------
Summary: [CDK] EL empty method doesn't work for Collection
Key: RF-12231
URL: https://issues.jboss.org/browse/RF-12231
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: cdk
Affects Versions: 4.2.1.Final
Environment: All
Reporter: Paul Dijou
Let's say I want to test if a component doesn't have any children. I write thise code :
{code:xml}
<c:if test="#{empty(component.getChildren())}">No children!</c:if>
{code}
Seems logic, right? If the List is empty, then it means there is no children. The generated Java code is the following :
{code:java}
if (isEmpty(component.getChildren())) {
responseWriter.writeText("No children!",null);
}
{code}
And the "isEmpty" method :
{code:java}
private static boolean isEmpty(Object object)
{
return object == null || object.toString().length() == 0;
}
{code}
This method will *always* returns {{false}}, even if the list is empty. Why? Because the list will not be null and an empty list toString() renders "{{[]}}", so "{{object.toString().length()}}" will be eval to "2", which is different from "0". So based on these test, the component will *always* have children.
The "isEmpty" method should adapt its test depending on the type of object. It's an instance of Collection, calling "isEmpty()" is probably better.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months