[richfaces-issues] [JBoss JIRA] (RF-13138) a4j:log - should print partial-response value in a level=debug, but prints [Object] instead

Brian Leathem (JIRA) jira-events at lists.jboss.org
Tue Dec 3 11:37:06 EST 2013


    [ https://issues.jboss.org/browse/RF-13138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928259#comment-12928259 ] 

Brian Leathem commented on RF-13138:
------------------------------------

Running the metamer sample:
http://localhost:8080/metamer/faces/components/a4jLog/simple.xhtml

I get the result below, where the partial-response is clearly visible:

{code}
debug[08:23:15.706]: New request added to queue. Queue requestGroupingId changed to form:submitButton
debug[08:23:15.709]: Queue will wait 0ms before submit
debug[08:23:15.710]: richfaces.queue: will submit request NOW
info [08:23:15.718]: Received 'begin' event from <input id=form:submitButton ...>
info [08:23:15.811]: Received 'beforedomupdate' event from <input id=form:submitButton ...>
debug[08:23:15.812]: Server returned responseText: <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="a4jStatusPanel"><![CDATA[<span id="a4jStatusPanel"><span id="a4jStatus"><span style="display:none" class="rf-st-start"><span style="color: red;">WORKING</span></span><span style="display:none" class="rf-st-error"><span style="color: red;">ERROR</span></span><span class="rf-st-stop"></span><script type="text/javascript">new RichFaces.ui.Status("a4jStatus",{"onstop":function(event){updateLog('[RESTORE_VIEW 1, APPLY_REQUEST_VALUES 2, PROCESS_VALIDATIONS 3, UPDATE_MODEL_VALUES 4, INVOKE_APPLICATION 5, RENDER_RESPONSE 6]')}} )</script></span></span>]]></update><update id="phasesPanel"><![CDATA[<div id="phasesPanel"><span id="requestTime">16:23:15.782</span> <ul class="phases-list"> <li>RESTORE_VIEW 1</li> <li>APPLY_REQUEST_VALUES 2</li> <li>PROCESS_VALIDATIONS 3</li> <li>UPDATE_MODEL_VALUES 4</li> <li>INVOKE_APPLICATION 5</li> <li>RENDER_RESPONSE 6</li> </ul></div>]]></update><update id="form:out"><![CDATA[<span id="form:out">Hello John!</span>]]></update><update id="afterForm:attributes:panel"><![CDATA[<div id="afterForm:attributes:panel"><table id="afterForm:attributes:attributes" class="attributes"> <tbody> <tr> <td class="attributes-first-column"><label id="afterForm:attributes:levelLabel" for="afterForm:attributes:levelInput" style="margin-right: 5px;">level</label><img src="/metamer/resources/images/help.png" alt="help for attribute level" height="18px;" style="vertical-align: middle;" title=" Sets the logging level, can be one of 'debug', 'info', 'warn', 'error'. " class="attribute-help" /></td> <td class=" attributes-second-column"><select id="afterForm:attributes:levelInput" name="afterForm:attributes:levelInput" size="1" style="width: 100%" onchange="submit()">	<option value="">null</option> <option value="debug" selected="selected">debug</option> <option value="error">error</option> <option value="info">info</option> <option value="warn">warn</option> </select></td> <td class=" attributes-first-column"><label id="afterForm:attributes:modeLabel" for="afterForm:attributes:modeInput" style="margin-right: 5px;">mode</label><img src="/metamer/resources/images/help.png" alt="help for attribute mode" height="18px;" style="vertical-align: middle;" title=" Determines how the log appears on the page, can be one of: &quot;inline&quot;, &quot;popup&quot;. When set to &quot;popup&quot;, the popup window is opened by pressing the key combination Ctrl + Shift + L " class="attribute-help" /></td> <td class=" attributes-second-column"><table id="afterForm:attributes:modeInput"> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:0" value="" onchange="submit()" /><label for="afterForm:attributes:modeInput:0"> null</label></td> </tr> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:1" value="console" onchange="submit()" /><label for="afterForm:attributes:modeInput:1"> console</label></td> </tr> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:2" value="inline" onchange="submit()" /><label for="afterForm:attributes:modeInput:2"> inline</label></td> </tr> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:3" value="popup" onchange="submit()" /><label for="afterForm:attributes:modeInput:3"> popup</label></td> </tr> </table></td> </tr> <tr> <td class="attributes-first-column"><label id="afterForm:attributes:renderedLabel" for="afterForm:attributes:renderedInput" style="margin-right: 5px;">rendered</label><img src="/metamer/resources/images/help.png" alt="help for attribute rendered" height="18px;" style="vertical-align: middle;" title=" Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true. " class="attribute-help" /></td> <td class=" attributes-second-column"><table id="afterForm:attributes:renderedInput"> <tr> <td> <input type="radio" name="afterForm:attributes:renderedInput" id="afterForm:attributes:renderedInput:0" value="null" onchange="submit()" /><label for="afterForm:attributes:renderedInput:0"> null</label></td> <td> <input type="radio" checked="checked" name="afterForm:attributes:renderedInput" id="afterForm:attributes:renderedInput:1" value="true" onchange="submit()" /><label for="afterForm:attributes:renderedInput:1"> true</label></td> <td> <input type="radio" name="afterForm:attributes:renderedInput" id="afterForm:attributes:renderedInput:2" value="false" onchange="submit()" /><label for="afterForm:attributes:renderedInput:2"> false</label></td> </tr> </table></td> <td class=" attributes-first-column"><label id="afterForm:attributes:styleLabel" for="afterForm:attributes:styleInput" style="margin-right: 5px;">style</label><img src="/metamer/resources/images/help.png" alt="help for attribute style" height="18px;" style="vertical-align: middle;" title=" CSS style(s) to be applied when this component is rendered. " class="attribute-help" /></td> <td class=" attributes-second-column"><input id="afterForm:attributes:styleInput" type="text" name="afterForm:attributes:styleInput" style="width: 200px;" onchange="submit()" /></td> </tr> <tr> <td class="attributes-first-column"><label id="afterForm:attributes:styleClassLabel" for="afterForm:attributes:styleClassInput" style="margin-right: 5px;">styleClass</label><img src="/metamer/resources/images/help.png" alt="help for attribute styleClass" height="18px;" style="vertical-align: middle;" title=" Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the &quot;class&quot; attribute on generated markup. " class="attribute-help" /></td> <td class=" attributes-second-column"><input id="afterForm:attributes:styleClassInput" type="text" name="afterForm:attributes:styleClassInput" style="width: 200px;" onchange="submit()" /></td> </tr> </tbody> </table> </div>]]></update><update id="javax.faces.ViewState"><![CDATA[-6787707308863219150:1739487982767304712]]></update><extension id="org.richfaces.extension"><render>form:out</render></extension></changes></partial-response>
info [08:23:15.832]: Listing content of response changes element:
Element update for id=a4jStatusPanel
<update id="a4jStatusPanel"><![CDATA[<span id="a4jStatusPanel"><span id="a4jStatus"><span style="display:none" class="rf-st-start"><span style="color: red;">WORKING</span></span><span style="display:none" class="rf-st-error"><span style="color: red;">ERROR</span></span><span class="rf-st-stop"></span><script type="text/javascript">new RichFaces.ui.Status("a4jStatus",{"onstop":function(event){updateLog('[RESTORE_VIEW 1, APPLY_REQUEST_VALUES 2, PROCESS_VALIDATIONS 3, UPDATE_MODEL_VALUES 4, INVOKE_APPLICATION 5, RENDER_RESPONSE 6]')}} )</script></span></span>]]></update>
Element update for id=phasesPanel
<update id="phasesPanel"><![CDATA[<div id="phasesPanel"><span id="requestTime">16:23:15.782</span> <ul class="phases-list"> <li>RESTORE_VIEW 1</li> <li>APPLY_REQUEST_VALUES 2</li> <li>PROCESS_VALIDATIONS 3</li> <li>UPDATE_MODEL_VALUES 4</li> <li>INVOKE_APPLICATION 5</li> <li>RENDER_RESPONSE 6</li> </ul></div>]]></update>
Element update for id=form:out
<update id="form:out"><![CDATA[<span id="form:out">Hello John!</span>]]></update>
Element update for id=afterForm:attributes:panel
<update id="afterForm:attributes:panel"><![CDATA[<div id="afterForm:attributes:panel"><table id="afterForm:attributes:attributes" class="attributes"> <tbody> <tr> <td class="attributes-first-column"><label id="afterForm:attributes:levelLabel" for="afterForm:attributes:levelInput" style="margin-right: 5px;">level</label><img src="/metamer/resources/images/help.png" alt="help for attribute level" height="18px;" style="vertical-align: middle;" title=" Sets the logging level, can be one of 'debug', 'info', 'warn', 'error'. " class="attribute-help" /></td> <td class=" attributes-second-column"><select id="afterForm:attributes:levelInput" name="afterForm:attributes:levelInput" size="1" style="width: 100%" onchange="submit()">	<option value="">null</option> <option value="debug" selected="selected">debug</option> <option value="error">error</option> <option value="info">info</option> <option value="warn">warn</option> </select></td> <td class=" attributes-first-column"><label id="afterForm:attributes:modeLabel" for="afterForm:attributes:modeInput" style="margin-right: 5px;">mode</label><img src="/metamer/resources/images/help.png" alt="help for attribute mode" height="18px;" style="vertical-align: middle;" title=" Determines how the log appears on the page, can be one of: &quot;inline&quot;, &quot;popup&quot;. When set to &quot;popup&quot;, the popup window is opened by pressing the key combination Ctrl + Shift + L " class="attribute-help" /></td> <td class=" attributes-second-column"><table id="afterForm:attributes:modeInput"> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:0" value="" onchange="submit()" /><label for="afterForm:attributes:modeInput:0"> null</label></td> </tr> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:1" value="console" onchange="submit()" /><label for="afterForm:attributes:modeInput:1"> console</label></td> </tr> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:2" value="inline" onchange="submit()" /><label for="afterForm:attributes:modeInput:2"> inline</label></td> </tr> <tr> <td> <input type="radio" name="afterForm:attributes:modeInput" id="afterForm:attributes:modeInput:3" value="popup" onchange="submit()" /><label for="afterForm:attributes:modeInput:3"> popup</label></td> </tr> </table></td> </tr> <tr> <td class="attributes-first-column"><label id="afterForm:attributes:renderedLabel" for="afterForm:attributes:renderedInput" style="margin-right: 5px;">rendered</label><img src="/metamer/resources/images/help.png" alt="help for attribute rendered" height="18px;" style="vertical-align: middle;" title=" Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true. " class="attribute-help" /></td> <td class=" attributes-second-column"><table id="afterForm:attributes:renderedInput"> <tr> <td> <input type="radio" name="afterForm:attributes:renderedInput" id="afterForm:attributes:renderedInput:0" value="null" onchange="submit()" /><label for="afterForm:attributes:renderedInput:0"> null</label></td> <td> <input type="radio" checked="checked" name="afterForm:attributes:renderedInput" id="afterForm:attributes:renderedInput:1" value="true" onchange="submit()" /><label for="afterForm:attributes:renderedInput:1"> true</label></td> <td> <input type="radio" name="afterForm:attributes:renderedInput" id="afterForm:attributes:renderedInput:2" value="false" onchange="submit()" /><label for="afterForm:attributes:renderedInput:2"> false</label></td> </tr> </table></td> <td class=" attributes-first-column"><label id="afterForm:attributes:styleLabel" for="afterForm:attributes:styleInput" style="margin-right: 5px;">style</label><img src="/metamer/resources/images/help.png" alt="help for attribute style" height="18px;" style="vertical-align: middle;" title=" CSS style(s) to be applied when this component is rendered. " class="attribute-help" /></td> <td class=" attributes-second-column"><input id="afterForm:attributes:styleInput" type="text" name="afterForm:attributes:styleInput" style="width: 200px;" onchange="submit()" /></td> </tr> <tr> <td class="attributes-first-column"><label id="afterForm:attributes:styleClassLabel" for="afterForm:attributes:styleClassInput" style="margin-right: 5px;">styleClass</label><img src="/metamer/resources/images/help.png" alt="help for attribute styleClass" height="18px;" style="vertical-align: middle;" title=" Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through as the &quot;class&quot; attribute on generated markup. " class="attribute-help" /></td> <td class=" attributes-second-column"><input id="afterForm:attributes:styleClassInput" type="text" name="afterForm:attributes:styleClassInput" style="width: 200px;" onchange="submit()" /></td> </tr> </tbody> </table> </div>]]></update>
Element update for id=javax.faces.ViewState
<update id="javax.faces.ViewState"><![CDATA[-6787707308863219150:1739487982767304712]]></update>
Element extension for id=org.richfaces.extension
<extension id="org.richfaces.extension"><render>form:out</render></extension>
debug[08:23:15.863]: richfaces.queue: ajax submit successfull
debug[08:23:15.864]: richfaces.queue: Nothing to submit
debug[08:23:15.866]: RESTORE_VIEW 1
debug[08:23:15.866]: APPLY_REQUEST_VALUES 2
debug[08:23:15.866]: PROCESS_VALIDATIONS 3
debug[08:23:15.866]: UPDATE_MODEL_VALUES 4
debug[08:23:15.867]: INVOKE_APPLICATION 5
debug[08:23:15.867]: RENDER_RESPONSE 6
info [08:23:15.867]: Received 'success' event from <input id=form:submitButton ...>
info [08:23:15.868]: Received 'complete' event from <input id=form:submitButton ...>
{code}

However, when the _mode_ is changed to _console_, _\[object Object]_ is printed instead.
                
> a4j:log - should print partial-response value in a level=debug, but prints [Object] instead
> -------------------------------------------------------------------------------------------
>
>                 Key: RF-13138
>                 URL: https://issues.jboss.org/browse/RF-13138
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.3.3
>            Reporter: Lukáš Fryč
>             Fix For: 5.0.0.Alpha1
>
>
> {code}
> RichFaces: New request added to queue. Queue requestGroupingId changed to form:j_idt9 log.js.jsf?ln=org.richfaces:160
> RichFaces: Queue will wait 0ms before submit log.js.jsf?ln=org.richfaces:160
> RichFaces: richfaces.queue: will submit request NOW log.js.jsf?ln=org.richfaces:160
> RichFaces: Received 'begin' event from <input id=form:j_idt9 ...> log.js.jsf?ln=org.richfaces:160
> RichFaces: Received 'beforedomupdate' event from <input id=form:j_idt9 ...> log.js.jsf?ln=org.richfaces:160
> RichFaces: [object Object] log.js.jsf?ln=org.richfaces:160
> RichFaces: [object Object] log.js.jsf?ln=org.richfaces:160
> RichFaces: richfaces.queue: ajax submit error: During update: form:surnameMsg not found log.js.jsf?ln=org.richfaces:160
> RichFaces: richfaces.queue: Nothing to submit log.js.jsf?ln=org.richfaces:160
> RichFaces: Received 'error at malformedXML' event from <input id=form:j_idt9 ...> log.js.jsf?ln=org.richfaces:160
> RichFaces: [status=200] During update: form:surnameMsg not found log.js.jsf?ln=org.richfaces:160
> RichFaces: Received 'complete' event from <input id=form:j_idt9 ...> 
> {code}
> The issue is caused by the fact that richfaces.log suppose to accept text messages but this [formatPartialResponse|https://github.com/richfaces/richfaces/blob/5.0.0.Alpha1/framework/src/main/resources/META-INF/resources/richfaces-jsf-log.js#L98] generated jQuery object, which is in turn printed as {{[Object]}}.

--
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



More information about the richfaces-issues mailing list