[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-23 Thread Melloware (Jira)


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

Melloware commented on MYFACES-4560:


Will do!

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Assignee: Thomas Andraschko
>Priority: Major
> Fix For: 4.0.0-RC6
>
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-14 Thread Bernd Bohmann (Jira)


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

Bernd Bohmann commented on MYFACES-4560:


I have a simple test to verify the wrong behavior

 

 
{code:java}
@Test
public void testSelectListAsValue()
{
List values = new ArrayList<>();

values.add(new SelectItem("#1", "D1"));
values.add(new SelectItem("#2", "D2"));
values.add(new SelectItem("#3", "D3"));

UISelectItems selectItems = new UISelectItems();
selectItems.setValue(values);
selectItems.getAttributes().put("var", "item");
ValueExpression itemValue = new MockValueExpression("#{item.label}", 
Object.class);
ValueExpression itemLabel = new MockValueExpression("#{item.key}", 
Object.class);
ValueExpression itemDescription = new MockValueExpression("#{item.key}", 
Object.class);

selectItems.setValueExpression("itemValue", itemValue);
selectItems.setValueExpression("itemLabel", itemLabel);
selectItems.setValueExpression("itemDescription", itemLabel);
UISelectOne selectOne = new UISelectOne();
selectOne.getChildren().add(selectItems);

SelectItemsIterator iter = new SelectItemsIterator(selectOne, facesContext);
List options = new ArrayList<>();
List labels = new ArrayList<>();
List descriptions = new ArrayList<>();
while (iter.hasNext())
{
SelectItem next = iter.next();
options.add((String) next.getValue());
labels.add(next.getLabel());
descriptions.add(next.getDescription());
}
Assertions.assertAll(
() -> 
Assertions.assertEquals(values.stream().map(SelectItem::getLabel).collect(Collectors.toList()),
 options),
() -> 
Assertions.assertEquals(values.stream().map(SelectItem::getValue).collect(Collectors.toList()),
 labels),
() -> 
Assertions.assertEquals(values.stream().map(SelectItem::getValue).collect(Collectors.toList()),
 descriptions));
}{code}
 

 

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-14 Thread Melloware (Jira)


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

Melloware commented on MYFACES-4560:


Yes and that gets completely ignored and the underlying SelecItem `itemLabel` 
is used so the XHMTL there is completely ignored.

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-14 Thread Bernd Bohmann (Jira)


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

Bernd Bohmann commented on MYFACES-4560:


I think the description is not correct itemLabel for id="test1" is 
{code:java}
itemLabel="#{i.value} - #{i.label}"
{code}

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-14 Thread Melloware (Jira)


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

Melloware commented on MYFACES-4560:


Yep we opened a discussion on the Faces Spec page here: 
[https://github.com/jakartaee/faces/issues/1791]

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-14 Thread Bernd Bohmann (Jira)


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

Bernd Bohmann commented on MYFACES-4560:


Is this a myfaces problem?

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-14 Thread Thomas Andraschko (Jira)


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

Thomas Andraschko commented on MYFACES-4560:


In PF we added it directly when creating the SelectItems list (like MF 
SelectItemsUtil)
but maybe the better place is when rendering, would need to check it in detail

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-13 Thread Volodymyr Siedlecki (Jira)


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

Volodymyr Siedlecki commented on MYFACES-4560:
--

{color:#172b4d}itemLabel is should be a ValueExpression, but the example above 
is two: "#\{i.key} - #\{i.value}"{color}

{color:#172b4d}I'm not sure if this a valid problem for JSF since it's the EL 
code that handles parsing.  Unless I'm misunderstanding something...? {color}

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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


[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

2023-02-13 Thread Volodymyr Siedlecki (Jira)


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

Volodymyr Siedlecki commented on MYFACES-4560:
--

Problem looks to occur around here: 

[https://github.com/apache/myfaces/blob/4a996076a298b3767dab5e16fd312d5221e6b14a/api/src/main/java/jakarta/faces/component/_ComponentAttributesMap.java#L329]

Call originates here: 
[https://github.com/apache/myfaces/blob/89c747e85615e3f33265e664c8361789f38ea7db/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java#L82]

> Faces Issue #1791 SelectItems rendering
> ---
>
> Key: MYFACES-4560
> URL: https://issues.apache.org/jira/browse/MYFACES-4560
> Project: MyFaces Core
>  Issue Type: Improvement
>Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>Reporter: Melloware
>Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, 
> even if the backed data type is SelectItem. The default rendering should only 
> be done when the attribute is missing.
> Example:
> {code:java}
>         
>             
>                  itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             
>             
>                  itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             
>             
>                 
>             
>             
>                 
>             
>         {code}
> The issue is `id="test1"` the user is expecting it to render 
> `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the 
> underlying Java SelectItem value is rendered.



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