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

Salvo Isaja commented on RF-13093:
----------------------------------

Here is a workaround that works on RichFaces 4.3.x and JSF 2.1 (tested on 
RichFaces 4.3.4 on GlassFish 3.1.2.2 with Mojarra 2.1.23).
Include the following JavaScript after the standard jsf.js:

{code}
var origJsfAjaxResponse = jsf.ajax.response;
jsf.ajax.response = function response(request, context) {
    var xml = request.responseXML;
    var pr = xml.getElementsByTagName("partial-response")[0];
    if (pr.children.length === 0) {
        $(pr).append('<changes><update 
id="javax.faces.ViewState">stateless</update></changes>');
    }
    return origJsfAjaxResponse(request, context);
};
{code}

If an empty partial-response is received, it just adds an update of the 
stateless ViewState as it would happen with non-transient views. I've tested it 
as is, but I suppose the "name" attribute would be more appropriate than "id", 
depending on how the JSF implementations lays out the ViewState hidden.
This is not specific to rich:extendedDataTable but works around any case the 
server returns an empty partial-response.
                
> extendedDataTable column resizing and reordering not working on transient 
> (stateless) views
> -------------------------------------------------------------------------------------------
>
>                 Key: RF-13093
>                 URL: https://issues.jboss.org/browse/RF-13093
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-tables
>    Affects Versions: 4.3.2
>         Environment: GlassFish 3.1.2.2 with Mojarra 2.1.23
>            Reporter: Salvo Isaja
>              Labels: jsf22
>             Fix For: 5.0.0.Alpha2
>
>
> When turning on transient (stateless) views in recent Mojarra versions (as 
> per JSF 2.2 specification, to my best understanding), using request scoped 
> backing beans, javax.faces.ViewState becomes the constant "stateless". Column 
> resizing and reordering in extendedDataTable causes an Ajax request to the 
> server, but in this case an invalid response is sent, containing only:
> {code:xml}
> <?xml version='1.0' encoding='UTF-8'?>
> <partial-response></partial-response>
> {code}
> This causes an exception in {{jsf.js}} because the partial-response element 
> has no children and no further JavaScript processing happens in the view 
> until the page is reloaded. In the non-transient view case, I see a 
> {{change}} element updating only the ViewState is returned, instead.
> Other features seem to work pretty well in stateless mode, by the way.
> Thanks

--
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
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to