You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Pavitra Subramaniam (JIRA)" <de...@myfaces.apache.org> on 2010/10/06 02:22:35 UTC

[jira] Issue Comment Edited: (TRINIDAD-1922) In Facelets, Partial Refreshing Not Working

    [ https://issues.apache.org/jira/browse/TRINIDAD-1922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918344#action_12918344 ] 

Pavitra Subramaniam edited comment on TRINIDAD-1922 at 10/5/10 8:22 PM:
------------------------------------------------------------------------

Ok, I was able to reproduce the issue Mamallan encountered when creating a standalone testcase. The problem is not with Mojarra's partial response processing code, rather it's a problem with the renderer implementation of LabelAndMessageRenderer!!

The problem is that when building a partial response for an inputText with id "foo", the above renderer, under certain conditions determines that the <input> HTML needs to be within a <table> and so renders HTML with <table> as the root element with an id "foo_xc" !!

This is the reason why partial update fails when using JSF Ajax. This renderer code appears to have been implemented this way for legacy reasons (from the UIX days). With JSF 2 and especially when using JSF 2 Ajax style requests, we always expect the root DOM element to have the same id as the component for which it's generated. Currently the PPR response for 

<tr:inputText id="foo" />

in jsf 2 ajax becomes

<update id="foo"><![CDATA[
  <table id="foo__xc_" class="af_inputText" cellpadding="0" cellspacing="0" border="0" summary="">
    <tr>
      <td class="af_inputText_label" nowrap><span id="foo::icon" style="display:none;"><a name="_msgAnc_foo" title="Error" class="AFErrorIconStyle">X</a></span></td>
      <td valign="top" nowrap class="AFContentCell">
        <input id="foo" name="foo" class="af_inputText_content" size="30" type="text" value="Success"></td>
    </tr>
    <tr>
      <td></td>
      <td class="AFComponentMessageCell"><span id="foo::msg" style="display:none;"></span></td>
    </tr>
  </table>]]>
</update>

Investigating a fix...

      was (Author: pasubra):
    Ok, I was able to reproduce the issue Mamallan encountered when creating a standalone testcase. The problem is not with Mojarra's partial response processing code, rather it's a problem with the renderer implementation of LabelAndMessageRenderer!!

The problem is that when building a partial response for an inputText with id "foo", the above renderer, under certain conditions determines that the <input> HTML needs to be within a <table> and so renders HTML with <table> as the root element with an id "foo_xc" !!

This is the reason why partial update fails when using JSF Ajax. This renderer code appears to have been implemented this way for legacy reasons (from the UIX days). With JSF 2 and especially when using JSF 2 Ajax style requests, we always expect the root DOM element to have the same id as the component for which it's generated. Currently the PPR response for 

<tr:inputText id="foo" />

in jsf 2 ajax becomes

<update id="foo"><![CDATA[
  <table id="foo__xc_" class="af_inputText" cellpadding="0" cellspacing="0" border="0" summary="">
    <tr>
      <td class="af_inputText_label" nowrap><span id="foo::icon" style="display:none;"><a name="_msgAnc_foo" title="Error" class="AFErrorIconStyle">X</a></span></td>
      <td valign="top" nowrap class="AFContentCell">
        <input id="foo" name="foo" class="af_inputText_content" size="30" type="text" value="Success"></td>
    </tr>
    <tr>
      <td></td>
      <td class="AFComponentMessageCell"><span id="foo::msg" style="display:none;"></span></td>
    </tr>
  </table>]]>
</update>

Working on fixing the renderers to render their root element with the right id.
  
> In Facelets, Partial Refreshing <tr:inputText> Not Working
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1922
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1922
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0.3-core
>         Environment: Any browser
>            Reporter: Mamallan Uthaman
>
> Trinidad currently has an issue partial refreshing an <tr:inputText>. This problem is specific to facelets where we use JSF Ajax apis. I tested with the latest code from our trunk, and below is my  test page:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
>                 xmlns:f="http://java.sun.com/jsf/core"
>                 xmlns:tr="http://myfaces.apache.org/trinidad"
>                 xmlns:trd="http://myfaces.apache.org/trinidad/demo"
>                 xmlns:trh="http://myfaces.apache.org/trinidad/html">
>     <tr:document id="d1" title="Client Behavior Support">
>         <tr:form id="f1">
>             <tr:panelHeader text="Ajax Issue"/>
>             <tr:panelHorizontalLayout>
>                 <tr:commandLink text="Press" id="cb1" partialSubmit="true">
>                     <tr:setActionListener from="Success" to="#{sessionScope.status}"/>
>                 </tr:commandLink>
>                 <tr:inputText value="#{sessionScope.status}"  partialTriggers="cb1" columns="6"/>
>             </tr:panelHorizontalLayout>
>         </tr:form>
>     </tr:document>
> </ui:composition>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.