[JBoss JIRA] Created: (RF-8763) a4j:ajax is not added on page in JBoss
by Pavol Pitonak (JIRA)
a4j:ajax is not added on page in JBoss
--------------------------------------
Key: RF-8763
URL: https://jira.jboss.org/browse/RF-8763
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-a4j-core
Affects Versions: 4.0.0.Alpha2
Environment: JBoss 6 snapshot (June 8, 2010), RichFaces 4.0.0.Alpha2 & 4.0.0-SNAPSHOT
Reporter: Pavol Pitonak
The following code doesn't work in JBoss 6 (snapshot from June 8) but works in Tomcat 6.0.26.
It generates <input id="form:nameInput" type="text" name="form:nameInput" />
<h:form id="form">
<h:outputLabel value="Name:" for="nameInput" />
<h:inputText id="nameInput" value="#{richBean.name}">
<a4j:ajax event="keyup" execute="@form" render="output" />
</h:inputText>
<h:panelGroup id="output">
<h:outputText value="Hello #{richBean.name}!" rendered="#{not empty richBean.name}" />
</h:panelGroup>
</h:form>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months
[JBoss JIRA] Created: (RF-8336) UIDataAdaptor: events broadcasting is happening with wrong client id
by Nick Belaevski (JIRA)
UIDataAdaptor: events broadcasting is happening with wrong client id
--------------------------------------------------------------------
Key: RF-8336
URL: https://jira.jboss.org/jira/browse/RF-8336
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: component-tables
Affects Versions: 3.3.2.SR1
Reporter: Nick Belaevski
Assignee: Nick Belaevski
Fix For: 4.0.0.BETA1
The following code:
<rich:dataTable var="top" value="#{forum5Bean.data}" rowKeyVar="row">
<rich:column>
<h:outputText value="#{top}" />
<a4j:commandButton value="Delete">
<a4j:actionparam value="#{row}"
assignTo="#{forum5Bean.itemValue}" />
</a4j:commandButton>
</rich:column>
</rich:dataTable>
doesn't work because parameter is submitted with name=clientId (i.e. including row number), but in the time of event broadcast, clientId of a4j:actionparam component doesn't include row index.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 10 months
[JBoss JIRA] Created: (RF-8197) Optimize AjaxChildrenRenderer render component check algorithm
by Jan Ziegler (JIRA)
Optimize AjaxChildrenRenderer render component check algorithm
--------------------------------------------------------------
Key: RF-8197
URL: https://jira.jboss.org/jira/browse/RF-8197
Project: RichFaces
Issue Type: Patch
Security Level: Public (Everyone can see)
Affects Versions: 3.3.2.SR1
Environment: Myfaces 1.2.8, Facelets 1.1.15, Tomcat 6.0.20
Reporter: Jan Ziegler
I just realized some possible "lifecycle processing overhead" when doing ajax actions:
In render response phase each ajax component is checked for rendering by the method AjaxChildrenRenderer.encodeAjaxComponent(). That - what I could see - is the case when:
# the component´s rendered-attribute is true
# the component is ajaxRendered
# the componentId is defined in the reRenderId-List
This also reflects the order of checking, so the first thing to be done is check if the component´s rendered-attribute is true. But this might also lead to additional lifecycle processings when
rendered-conditions are bound to managed beans by el expressions. To evaluate the rendered condition, request scoped managed beans must be created. to my opion this is suboptimal, like in my case the managed bean performs some (time intensive?) actions in its constructor or the rendered conditions relies on a list which must be fetched from the database - and this also happens even if the componentId is not in den reRenderId-List.
So why not first evaluate if the componentId is in the reRenderId-List or the component is ajaxRendered and then (if one of this conditions is true) additionally check the rendered-condition?
This might be accomplished with a small change AjaxChildrenRenderer.encodeAjaxComponent():
{code}
public void encodeAjaxComponent(FacesContext context,
UIComponent component, String currentPath, Set<String> ids,
Set<String> renderedAreas) throws IOException {
if (component.isRendered()) { // skip not-rendered components.
boolean found = false;
boolean limitToList = AjaxContext.getCurrentInstance(context).isLimitToList();
String elementId = component.getId();
String absoluteId = currentPath + elementId;
if (!ids.isEmpty()) {
// list for rendering may contains absolute id ( best ),
// component Id or client ID
// String clientId = element.getClientId(context);
if (ids.contains(absoluteId) || ids.contains(elementId)) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(
Messages.RENDER_AJAX_AREA_INFO, absoluteId));
}
// renderChild(context, element);
found = true;
}
}
//
if (!found && limitToList
&& component instanceof NamingContainer
&& noIdUnderPath(absoluteId
+ NamingContainer.SEPARATOR_CHAR, ids)) {
return;
}
if (!found && !limitToList && component instanceof AjaxOutput) {
if (((AjaxOutput) component).isAjaxRendered()) {
// renderChild(context, element);
found = true;
}
}
if (!found) {
if (component instanceof AjaxChildrenEncoder) {
((AjaxChildrenEncoder) component).encodeAjaxChild(context,
currentPath, ids, renderedAreas);
} else {
// Special case - for control components, not produced
// html code - such as message bundles loaders,
// MyFaces aliases etc. we call encodeBegin/end methods
// even if components not in rendered areas.
boolean special = isSpecialElement(context, component);
if (special) {
component.encodeBegin(context);
}
encodeAjaxChildren(context, component, currentPath, ids,
renderedAreas);
if (special) {
component.encodeEnd(context);
}
}
} else {
renderedAreas.add(component.getClientId(context));
renderChild(context, component);
}
}
}
{code}
Patched version (the isRendered()-condition is moved the the last else-Block before the component will be rendered):
public void encodeAjaxComponent(FacesContext context,
UIComponent component, String currentPath, Set<String> ids,
Set<String> renderedAreas) throws IOException {
boolean found = false;
boolean limitToList = AjaxContext.getCurrentInstance(context).isLimitToList();
String elementId = component.getId();
String absoluteId = currentPath + elementId;
if (!ids.isEmpty()) {
// list for rendering may contains absolute id ( best ),
// component Id or client ID
// String clientId = element.getClientId(context);
if (ids.contains(absoluteId) || ids.contains(elementId)) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(
Messages.RENDER_AJAX_AREA_INFO, absoluteId));
}
// renderChild(context, element);
found = true;
}
}
//
if (!found && limitToList
&& component instanceof NamingContainer
&& noIdUnderPath(absoluteId
+ NamingContainer.SEPARATOR_CHAR, ids)) {
return;
}
if (!found && !limitToList && component instanceof AjaxOutput) {
if (((AjaxOutput) component).isAjaxRendered()) {
// renderChild(context, element);
found = true;
}
}
if (!found) {
if (component instanceof AjaxChildrenEncoder) {
((AjaxChildrenEncoder) component).encodeAjaxChild(context,
currentPath, ids, renderedAreas);
} else {
// Special case - for control components, not produced
// html code - such as message bundles loaders,
// MyFaces aliases etc. we call encodeBegin/end methods
// even if components not in rendered areas.
boolean special = isSpecialElement(context, component);
if (special) {
component.encodeBegin(context);
}
encodeAjaxChildren(context, component, currentPath, ids,
renderedAreas);
if (special) {
component.encodeEnd(context);
}
}
} else if (component.isRendered()) { // skip not-rendered components.
renderedAreas.add(component.getClientId(context));
renderChild(context, component);
}
}
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 10 months