[JBoss JIRA] (RF-12281) rich:tree is iterated multiple times when item is selected
by Alex Vb (JIRA)
Alex Vb created RF-12281:
----------------------------
Summary: rich:tree is iterated multiple times when item is selected
Key: RF-12281
URL: https://issues.jboss.org/browse/RF-12281
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-tree
Affects Versions: 4.2.2.Final
Reporter: Alex Vb
I have a decently sized tree and I'm using the selectionChangeListener in combination with toggleType="client" selectionType="ajax" render="node" to trigger a selection event on the server. The panelGroup "node" is re-rendered afterwards but it takes 1-2 seconds for each request. After enabling some debug logging I noticed that the entire tree is iterated 4 times for each request. Note a small test-tree exhibiting the same behavior:
2012-05-22 08:39:29.287 DEBUG CustomPhaseListener - Before phase: APPLY_REQUEST_VALUES 2
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChildrenKeysIterator(0)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChild(1)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChildrenKeysIterator(1)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.287 DEBUG Bean - selectionChanged()
2012-05-22 08:39:29.287 DEBUG CustomPhaseListener - After phase: APPLY_REQUEST_VALUES 2
2012-05-22 08:39:29.287 DEBUG CustomPhaseListener - Before phase: PROCESS_VALIDATIONS 3
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChildrenKeysIterator(0)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChild(1)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChildrenKeysIterator(1)
2012-05-22 08:39:29.287 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.302 DEBUG CustomPhaseListener - After phase: PROCESS_VALIDATIONS 3
2012-05-22 08:39:29.302 DEBUG CustomPhaseListener - Before phase: UPDATE_MODEL_VALUES 4
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChildrenKeysIterator(0)
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChild(1)
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChildrenKeysIterator(1)
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.302 DEBUG CustomPhaseListener - After phase: UPDATE_MODEL_VALUES 4
2012-05-22 08:39:29.302 DEBUG CustomPhaseListener - Before phase: INVOKE_APPLICATION 5
2012-05-22 08:39:29.302 DEBUG CustomPhaseListener - After phase: INVOKE_APPLICATION 5
2012-05-22 08:39:29.302 DEBUG CustomPhaseListener - Before phase: RENDER_RESPONSE 6
2012-05-22 08:39:29.302 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.318 DEBUG TreeNodeBase - getChildrenKeysIterator(0)
2012-05-22 08:39:29.318 DEBUG TreeNodeBase - getChild(1)
2012-05-22 08:39:29.318 DEBUG TreeNodeBase - getChildrenKeysIterator(1)
2012-05-22 08:39:29.318 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.318 DEBUG TreeNodeBase - getChild(2)
2012-05-22 08:39:29.318 DEBUG CustomPhaseListener - After phase: RENDER_RESPONSE 6
On the rather large tree each iteration takes 300-500 ms which explains the slow behavior. I have played around with every setting I could find, if selectionType is set to "client" the tree is iterated only once (during the render response phase) but the selection event does not seem to be triggered. If toggleType is set to ajax, only the "expanded" parts of the tree are iterated.
I have no idea why the iteration is necessary for all these phases but I "fixed" it in my implementation by recompiling the org.richfaces.component.TreeRange class with an updated method:
public boolean shouldIterateChildren() {
if (tree.isLeaf())
return false;
else {
char separatorChar = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance());
String clientId = tree.getClientId();
boolean render = false;
for (String idToRender : FacesContext.getCurrentInstance().getPartialViewContext().getRenderIds()) {
// render the tree if you explicitly mention either the client id (e.g. "menuForm:tree") or the parent component client id (e.g. "menuForm")
// note that when clicking on an object in the tree, the following render target is requested: menuForm:tree@selection
if (clientId.equals(idToRender) || clientId.matches(idToRender + separatorChar + ".*")) {
render = true;
break;
}
}
// always render if it's not a postback
return render || !FacesContext.getCurrentInstance().isPostback();
}
}
--
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
11 years, 12 months
[JBoss JIRA] (RF-12560) showcase - drag and drop - demo with drag indicator throws JS errors when dragging an item
by Juraj Húska (JIRA)
Juraj Húska created RF-12560:
--------------------------------
Summary: showcase - drag and drop - demo with drag indicator throws JS errors when dragging an item
Key: RF-12560
URL: https://issues.jboss.org/browse/RF-12560
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-drag/drop, showcase
Affects Versions: 4.3.0.M1
Environment: Firefox, Chrome
JBoss AS 7.1.1.Final, Tomcat
Reporter: Juraj Húska
When attempting to drag an item with support of drag indicators, JS errors are thrown to the console.
Please see the attachments for the errors. The errors are thrown after successfully dragging one item. Then dragging is not working at all.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 12 months
[JBoss JIRA] (RF-12574) rich:accordion height of first element is wrongly computed
by Jiří Štefek (JIRA)
Jiří Štefek created RF-12574:
--------------------------------
Summary: rich:accordion height of first element is wrongly computed
Key: RF-12574
URL: https://issues.jboss.org/browse/RF-12574
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-output
Affects Versions: 4.3.0.M2
Environment: RichFaces 4.3.0.20121024-M2
Metamer 4.3.0.20121024-M2
JBoss AS 7.1.1.Final
OpenJDK Runtime Environment 1.6.0_24-b24 @ Linux
Firefox 16.0 @ Linux x86_64 / Chrome 21.0.1180.89 @ Linux x86_64 / IE9
Reporter: Jiří Štefek
Priority: Minor
When some other item than first of the rich:accordion is selected and then the first item is selected, the height of the content of the first item is wrongly computed and its height is as big as whole accordion height.
In 4.2.3 CR1 it works correctly.
Problem only occurs when @switchType is ajax.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 12 months
[JBoss JIRA] (RF-12606) rich:calendar bad Html syntaxe a table is under span, wich is not allowed (cause ajax error?('error@malformedXML'))
by Adrien Adrien (JIRA)
Adrien Adrien created RF-12606:
----------------------------------
Summary: rich:calendar bad Html syntaxe a table is under span, wich is not allowed (cause ajax error?('error@malformedXML'))
Key: RF-12606
URL: https://issues.jboss.org/browse/RF-12606
Project: RichFaces
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: component-input
Affects Versions: 4.3.0.M2
Environment: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=calenda...
Reporter: Adrien Adrien
Fix For: 4.3.0.M2
In html code rich:calendar has table under span.
Seem to cause error (a4j:log) in my code during ajax refresh :
--------------------------------------------------------------
error[20:47:12.191]: Received 'error@malformedXML' event from <input ...
error[20:47:12.192]: [200] undefined: undefined
Example
-------------
http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=calenda...
W3c don't detect error , but it's visible with firebug when you inspect rich:calendar
Use firefox plugin HTML Validor http://users.skynet.be/mgueury/mozilla/
----------------------------------------------------------------------
validate page after javascript excecution
line 101 column 986 - Erreur: document type does not allow element "TABLE" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag
code:
<span style="width:200px" id="j_idt1578:calendar">
<span style="white-space: nowrap;" id="j_idt1578:calendarPopup"><input type="text" style="vertical-align: middle; " readonly="readonly" name="j_idt1578:calendarInputDate" id="j_idt1578:calendarInputDate" class="rf-cal-inp "><img style="vertical-align: middle" src="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.3.Final/PackedCompressed/blueSky/org.richfaces.images/calendarIcon.png" id="j_idt1578:calendarPopupButton" class="rf-cal-btn " alt=""><input type="hidden" value="11/2012" style="display:none" name="j_idt1578:calendarInputCurrentDate" id="j_idt1578:calendarInputCurrentDate" autocomplete="off"></span>
<table cellspacing="0" cellpadding="0" border="0" onclick="RichFaces.$('j_idt1578:calendar').skipEventOnCollapse=true;" style="display:none; position:absolute;z-index: 3" class="rf-cal-extr rf-cal-popup undefined" id="j_idt1578:calendarContent"><tbody><tr><td
...blablabla
</table>
</span>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years