[JBoss JIRA] (RF-12254) kitchensink archetype - accessing wrong facelet is held in session and consequently accessing a correct one causes HTTP Status 500
by Juraj Huska (JIRA)
Juraj Huska created RF-12254:
--------------------------------
Summary: kitchensink archetype - accessing wrong facelet is held in session and consequently accessing a correct one causes HTTP Status 500
Key: RF-12254
URL: https://issues.jboss.org/browse/RF-12254
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: archetype, mobile
Affects Versions: 4.2.2.Final
Environment: project generated from kitchensink archetype
Reporter: Juraj Huska
Priority: Minor
When accessing wrong facelet on mobile device and consequently the right application context, then the HTTP Status 500 is returned with error message, which can be viewed in the attached screenshot.
It is caused because the {{PageBean}} hold the wrong part of the URL in the session,
{code}
public void setLocation(String location) {
this.location = location;
this.page = String.format("/mobile/%s.xhtml", location);
}
{code}
Note that I have tried to change the scope of the PageBean to RequestScoped, but then the list with members what not updated with the new created ones.
--
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
[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
12 years