Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketFacesListener should visit with SKIP_ITERATION #410

Closed
skybber opened this issue Nov 2, 2017 · 5 comments
Closed

SocketFacesListener should visit with SKIP_ITERATION #410

skybber opened this issue Nov 2, 2017 · 5 comments

Comments

@skybber
Copy link

skybber commented Nov 2, 2017

We have problem with SocketFacesListener which search for <o:connect> components before render view phase. In our case, when Components.forEachComponent iterates over data inside nested <ui:repeat> component, an exception is thrown inside repeat's getValue() method (our code). May be the iteration should be initialized with VisitHint.SKIP_ITERATION or the problem is on our side. Please, close this issue, if the visitor context must not have SKIP_ITERATION.

@BalusC
Copy link
Member

BalusC commented Nov 2, 2017

It looks like you're performing business logic in a getter method.

Can you confirm you understood everything of https://stackoverflow.com/q/2090033/157882?

@skybber
Copy link
Author

skybber commented Nov 2, 2017

Yes I do. In our case we had following structure (before socket):

<ui:fragment rendered="#{expr. evaluated to TRUE}">
    <ui:repeat value="#{fail}">
    <ui:repeat>
</ui:fragment>

when this structure is rendered, it does not fail since ui:fragment has rendered=false.

after socket addition:

<o:socket>
...
<ui:fragment rendered="#{expr. evaluated to TRUE}">
    <ui:repeat value="#{fail}">
    <ui:repeat>
</ui:fragment>

it starts to fail in pre-render since the render condition is not considered in visitor. I suppose the problem is on our side, but it looks weird for me that search for <o:connect> component iterates over data in iterable components. Unfortunately it is not possible to change this behaviour to easy fix all problems in our big project. The only way is to extend custom component as I did...

@BalusC
Copy link
Member

BalusC commented Nov 3, 2017

but it looks weird for me that search for <o:socket> component iterates over data in iterable components

Totally agree that. The <o:socket> itself isn't usable in iterable components as channel attribute is mandatory and must be unique and cannot be an EL expression.

@BalusC BalusC changed the title o:socket SocketFacesListener should visit with SKIP_ITERATION Nov 3, 2017
@BalusC BalusC closed this as completed in 6686be2 Nov 3, 2017
@BalusC
Copy link
Member

BalusC commented Nov 3, 2017

It's in today's latest 2.6.6-SNAPSHOT.

@skybber
Copy link
Author

skybber commented Nov 3, 2017

Good ! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants