primefaces-extensions: Sheet: error in JSON

Describe the bug

I have a problem with Sheet that I cannot write replicator for, because it happens only on full site. When changing other form elements would cause the sheet to be shown and filled the sheet “table” does not appear at all (there’s only header with my custom buttons visible). In the JS console there’s this error logged: image Before I spotted this I was going like crazy replacing all null-possible calls with safe method from bean, but it didn’t help (I was thinking some NPE was breaking the sheet).

What I see in the json response from when the sheet should appear is indeed a JSON with one [[ and two ]], so maybe something somewhere is produced incorrectly. I think I can’t show everything publicly but here are crucial parts:

<?xml version='1.0' encoding='UTF-8'?>
<partial-response>...,data:[[" ",...
...,""</script></td></tr></tbody></table>
</form>]]></update><update id="j_id1:jakarta.faces.ViewState:0"><![CDATA[-4105232086132405834:-3327090845627537063]]></update></changes></partial-response>

I think the bug is in the fact that data array of arrays isn’t closed at all. It’s actually cut off like there would be a size limit, which isn’t enough for my sheet.

,errors:"{}",data:[[" "," ","\-3000.00","24000.00","",
...
""],["18","17:30 \- 18:00","",
...
,"","",""</script>

It should end with 24:00, but it manages to reach only 18:00 and is then cut off. What controls that limit?

Reproducer

No response

Expected behavior

Sheet renders correctly.

PrimeFaces Extensions version

14.0.7.1

JSF implementation

Mojarra

JSF version

4.0

Browser(s)

Firefox 132.0.1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 40 (10 by maintainers)

Most upvoted comments

Thanks I just sent this note to another user who had reported this issue on Undertow and JSON as well he will try it tomorrow as well.

lol comment in https://github.com/undertow-io/undertow/blob/main/servlet/src/main/java/io/undertow/servlet/spec/ServletPrintWriter.java:

        //for some known charset we get optimistic and hope that
        //only ascii will be output
        //in this case we can avoid creating the encoder altogether