[jira] [Comment Edited] (MYFACES-4629) Manual AJAX request does not process TabView correctly

2023-11-07 Thread Thomas Andraschko (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17783682#comment-17783682
 ] 

Thomas Andraschko edited comment on MYFACES-4629 at 11/7/23 4:19 PM:
-

also added a small test for it, that its only processed once:

https://github.com/apache/myfaces/commit/0ebef69316193230cd305c44fd9c2ffe2ea8aa3f


was (Author: tandraschko):
also added a small test for it, that its only processed once

> Manual AJAX request does not process TabView correctly
> --
>
> Key: MYFACES-4629
> URL: https://issues.apache.org/jira/browse/MYFACES-4629
> Project: MyFaces Core
>  Issue Type: Bug
>  Components: General
>Affects Versions: 4.0.0, 4.0.1
>Reporter: Manuel K
>Priority: Major
> Attachments: pf-tabview.zip
>
>
> When manually calling PrimeFaces.ajax.Request.handle the validationFailed 
> argument is not sent to the client.
> For more details and a reproducer please see 
> https://github.com/orgs/primefaces/discussions/123



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (MYFACES-4629) Manual AJAX request does not process TabView correctly

2023-11-07 Thread Thomas Andraschko (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17783619#comment-17783619
 ] 

Thomas Andraschko edited comment on MYFACES-4629 at 11/7/23 12:53 PM:
--

What happens is that MyFaces always processes AJAX source and execute id's, 
which is tested above
Mojarra only processes the AJAX execute

so Mojarra directly invokes "form:input", whereas MyFaces invokes "form" and 
the form actually processes its child directly

our behavior is documented here: 
https://github.com/apache/myfaces/blob/816d4ae3b3d677752a33569231507a0cd7130c6b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java#L220
the second hint is here: 
https://github.com/apache/myfaces/blob/816d4ae3b3d677752a33569231507a0cd7130c6b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java#L732

so what happens in MF internally:
- we process `form`
- we know that the second id is a child of `form`, so we ignore it
- we rely on it that form process its childs

and here we go: PrimeFaces UITabPanel skips its children

i think the MyFaces behavior is good and we need to check if we can fix it in 
PF or not



was (Author: tandraschko):
What happens is that MyFaces always processes AJAX source and execute id's, 
which is tested above
Mojarra only processes the AJAX execute

our behavior is documented here: 
https://github.com/apache/myfaces/blob/816d4ae3b3d677752a33569231507a0cd7130c6b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java#L220
the second hint is here: 
https://github.com/apache/myfaces/blob/816d4ae3b3d677752a33569231507a0cd7130c6b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java#L732

so what happens in MF internally:
- we process `form`
- we know that the second id is a child of `form`, so we ignore it
- we rely on it that form process its childs

and here we go: PrimeFaces UITabPanel skips its children

i think the MyFaces behavior is good and we need to check if we can fix it in 
PF or not


> Manual AJAX request does not process TabView correctly
> --
>
> Key: MYFACES-4629
> URL: https://issues.apache.org/jira/browse/MYFACES-4629
> Project: MyFaces Core
>  Issue Type: Bug
>  Components: General
>Affects Versions: 4.0.0, 4.0.1
>Reporter: Manuel K
>Priority: Major
> Attachments: pf-tabview.zip
>
>
> When manually calling PrimeFaces.ajax.Request.handle the validationFailed 
> argument is not sent to the client.
> For more details and a reproducer please see 
> https://github.com/orgs/primefaces/discussions/123



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (MYFACES-4629) Manual AJAX request does not process TabView correctly

2023-11-07 Thread Thomas Andraschko (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17783613#comment-17783613
 ] 

Thomas Andraschko edited comment on MYFACES-4629 at 11/7/23 12:47 PM:
--

ok, i dont know if its a bug or not but this testcase show the issue:

{code:java}
@Test
public void test() {

ArrayList clientIds = new ArrayList<>();
clientIds.add("form:input");
clientIds.add("form");

PartialVisitContext visitContext = new 
PartialVisitContext(facesContext, clientIds,
EnumSet.of(VisitHint.EXECUTE_LIFECYCLE, 
VisitHint.SKIP_UNRENDERED));

UIViewRoot viewRoot = new UIViewRoot();

HtmlForm form = new HtmlForm();
form.setId("form");
viewRoot.getChildren().add(form);

HtmlInputText inputText = new HtmlInputText();
inputText.setId("input");
form.getChildren().add(inputText);

final List visitedComponents = new ArrayList<>();

viewRoot.visitTree(visitContext, (VisitContext context, UIComponent 
target) -> {
visitedComponents.add(target);

// Same as PhaseAwareVisitCallback:
// Return VisitResult.REJECT as processDecodes/Validators/Updates 
already traverse sub tree
return VisitResult.REJECT;
});

// 1 or 2 visitedComponents?
}
{code}



was (Author: tandraschko):
ok, i dont know if its a bug or not but this testcase show the issue:

```java
@Test
public void test() {

ArrayList clientIds = new ArrayList<>();
clientIds.add("form:input");
clientIds.add("form");

PartialVisitContext visitContext = new 
PartialVisitContext(facesContext, clientIds,
EnumSet.of(VisitHint.EXECUTE_LIFECYCLE, 
VisitHint.SKIP_UNRENDERED));

UIViewRoot viewRoot = new UIViewRoot();

HtmlForm form = new HtmlForm();
form.setId("form");
viewRoot.getChildren().add(form);

HtmlInputText inputText = new HtmlInputText();
inputText.setId("input");
form.getChildren().add(inputText);

final List visitedComponents = new ArrayList<>();

viewRoot.visitTree(visitContext, (VisitContext context, UIComponent 
target) -> {
visitedComponents.add(target);

// Same as PhaseAwareVisitCallback:
// Return VisitResult.REJECT as processDecodes/Validators/Updates 
already traverse sub tree
return VisitResult.REJECT;
});

// 1 or 2 visitedComponents?
}
```

> Manual AJAX request does not process TabView correctly
> --
>
> Key: MYFACES-4629
> URL: https://issues.apache.org/jira/browse/MYFACES-4629
> Project: MyFaces Core
>  Issue Type: Bug
>  Components: General
>Affects Versions: 4.0.0, 4.0.1
>Reporter: Manuel K
>Priority: Major
> Attachments: pf-tabview.zip
>
>
> When manually calling PrimeFaces.ajax.Request.handle the validationFailed 
> argument is not sent to the client.
> For more details and a reproducer please see 
> https://github.com/orgs/primefaces/discussions/123



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (MYFACES-4629) Manual AJAX request does not process TabView correctly

2023-10-30 Thread Thomas Andraschko (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17770711#comment-17770711
 ] 

Thomas Andraschko edited comment on MYFACES-4629 at 10/30/23 9:25 AM:
--

Just some notes if:
If you check PartialViewContext#processPartialExecute it contains the tabView 
Id - but the UITabPanel#process is only invoked for PhaseId#RENDER_RESPONSE, 
not for validating and so on. Thats the bug.

So something between is the reason, you may debug it. Another class involved 
is: PartialVisitContext



was (Author: tandraschko):
Just some notes if:
If you check PartialViewContext#processPartialExecute it contains the tabView 
Id - but the UITabPanel#process is only invoked for PhaseId#RENDER_RESPONSE, 
not for validating and so on. Thats the bug.

So something between is the reason, you may debug it. Another class involved 
is: PartialVisitContext

It MIGHT MAYBE even by design: you set the TabView as AJAX source but only 
UIComand components or f:ajax can trigger this; so a plain TabView actually not 
- but not sure if we have something.

> Manual AJAX request does not process TabView correctly
> --
>
> Key: MYFACES-4629
> URL: https://issues.apache.org/jira/browse/MYFACES-4629
> Project: MyFaces Core
>  Issue Type: Bug
>  Components: General
>Affects Versions: 4.0.0, 4.0.1
>Reporter: Manuel K
>Priority: Critical
> Attachments: pf-tabview.zip
>
>
> When manually calling PrimeFaces.ajax.Request.handle the validationFailed 
> argument is not sent to the client.
> For more details and a reproducer please see 
> https://github.com/orgs/primefaces/discussions/123



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (MYFACES-4629) Manual AJAX request does not process TabView correctly

2023-09-30 Thread Thomas Andraschko (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17770711#comment-17770711
 ] 

Thomas Andraschko edited comment on MYFACES-4629 at 9/30/23 1:33 PM:
-

Just some notes if:
If you check PartialViewContext#processPartialExecute it contains the tabView 
Id - but the UITabPanel#process is only invoked for PhaseId#RENDER_RESPONSE, 
not for validating and so on. Thats the bug.

So something between is the reason, you may debug it. Another class involved 
is: PartialVisitContext

It MIGHT MAYBE even by design: you set the TabView as AJAX source but only 
UIComand components or f:ajax can trigger this; so a plain TabView actually not 
- but not sure if we have something.


was (Author: tandraschko):
Just some notes if:
If you check PartialViewContext#processPartialExecute it contains the tabView 
Id - but the UITabPanel#process is only invoked for rendering, not for 
validating and so on. Thats the bug.

So something between is the reason, you may debug it. Another class involved 
is: PartialVisitContext

It MIGHT MAYBE even by design: you set the TabView as AJAX source but only 
UIComand components or f:ajax can trigger this; so a plain TabView actually not 
- but not sure if we have something.

> Manual AJAX request does not process TabView correctly
> --
>
> Key: MYFACES-4629
> URL: https://issues.apache.org/jira/browse/MYFACES-4629
> Project: MyFaces Core
>  Issue Type: Bug
>  Components: General
>Affects Versions: 4.0.0, 4.0.1
>Reporter: Manuel K
>Priority: Critical
> Attachments: pf-tabview.zip
>
>
> When manually calling PrimeFaces.ajax.Request.handle the validationFailed 
> argument is not sent to the client.
> For more details and a reproducer please see 
> https://github.com/orgs/primefaces/discussions/123



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (MYFACES-4629) Manual AJAX request does not process TabView correctly

2023-09-30 Thread Thomas Andraschko (Jira)


[ 
https://issues.apache.org/jira/browse/MYFACES-4629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17770711#comment-17770711
 ] 

Thomas Andraschko edited comment on MYFACES-4629 at 9/30/23 1:33 PM:
-

Just some notes if:
If you check PartialViewContext#processPartialExecute it contains the tabView 
Id - but the UITabPanel#process is only invoked for rendering, not for 
validating and so on. Thats the bug.

So something between is the reason, you may debug it. Another class involved 
is: PartialVisitContext

It MIGHT MAYBE even by design: you set the TabView as AJAX source but only 
UIComand components or f:ajax can trigger this; so a plain TabView actually not 
- but not sure if we have something.


was (Author: tandraschko):
Just some notes if:
If you check PartialViewContext#processPartialExecute it contains the tabView 
Id - but the UITabPanel#process is only invoked for rendering, not for 
validating and so on

So something between is the reason, you may debug it. Another class involved 
is: PartialVisitContext

It MIGHT MAYBE even by design: you set the TabView as AJAX source but only 
UIComand components or f:ajax can trigger this; so a plain TabView actually not 
- but not sure if we have something.

> Manual AJAX request does not process TabView correctly
> --
>
> Key: MYFACES-4629
> URL: https://issues.apache.org/jira/browse/MYFACES-4629
> Project: MyFaces Core
>  Issue Type: Bug
>  Components: General
>Affects Versions: 4.0.0, 4.0.1
>Reporter: Manuel K
>Priority: Critical
> Attachments: pf-tabview.zip
>
>
> When manually calling PrimeFaces.ajax.Request.handle the validationFailed 
> argument is not sent to the client.
> For more details and a reproducer please see 
> https://github.com/orgs/primefaces/discussions/123



--
This message was sent by Atlassian Jira
(v8.20.10#820010)