You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Bart Kummel (JIRA)" <de...@myfaces.apache.org> on 2009/03/06 16:49:56 UTC

[jira] Created: (TRINIDAD-1417) partialTriggers does not take String value

partialTriggers does not take String value
------------------------------------------

                 Key: TRINIDAD-1417
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1417
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components, Facelets
    Affects Versions: 1.2.10-core
         Environment: Facelets 1.1.14, Trinidad 1.2.10, MyFaces core 1.2.4, Glassfish v2
            Reporter: Bart Kummel


When using the partialTriggers attribute, it does not take a literal String (even if it only contains a single id). The only way to get partialTriggers to work is to use a EL expression that returns a String[]. When using a literal string, I get the following exception:
java.lang.IllegalArgumentException: Cannot convert selectedReaction of type class java.lang.String to class [Ljava.lang.String;

I see some relation with bug #TRINIDAD-60.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TRINIDAD-1417) partialTriggers does not take String value

Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Robinson reopened TRINIDAD-1417:
---------------------------------------

      Assignee:     (was: Matthias Weßendorf)

Re-opening but will change it from a bug to a wish item as I believe it would be very useful to convert String to String[] at the component level instead of the tag level so that EL that points to a string or a string with EL in it will also be split into an array.

> partialTriggers does not take String value
> ------------------------------------------
>
>                 Key: TRINIDAD-1417
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1417
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components, Facelets
>    Affects Versions: 1.2.10-core
>         Environment: Facelets 1.1.14, Trinidad 1.2.10, MyFaces core 1.2.4, Glassfish v2
>            Reporter: Bart Kummel
>
> When using the partialTriggers attribute, it does not take a literal String (even if it only contains a single id). The only way to get partialTriggers to work is to use a EL expression that returns a String[]. When using a literal string, I get the following exception:
> java.lang.IllegalArgumentException: Cannot convert selectedReaction of type class java.lang.String to class [Ljava.lang.String;
> I see some relation with bug #TRINIDAD-60.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TRINIDAD-1417) partialTriggers does not take String value

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1417.
------------------------------------------

    Resolution: Invalid
      Assignee: Matthias Weßendorf

the partialTriggers contract requires a String[], see here for instance:
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_inputText.html

However, as typing in a static array is hard in JSP(X)/XHTML, there is a convenience for the JSPX author,
to use a list of Strings that are separated by a space (" ") -> partialTriggers="foo bar mycontrol"

> partialTriggers does not take String value
> ------------------------------------------
>
>                 Key: TRINIDAD-1417
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1417
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components, Facelets
>    Affects Versions: 1.2.10-core
>         Environment: Facelets 1.1.14, Trinidad 1.2.10, MyFaces core 1.2.4, Glassfish v2
>            Reporter: Bart Kummel
>            Assignee: Matthias Weßendorf
>
> When using the partialTriggers attribute, it does not take a literal String (even if it only contains a single id). The only way to get partialTriggers to work is to use a EL expression that returns a String[]. When using a literal string, I get the following exception:
> java.lang.IllegalArgumentException: Cannot convert selectedReaction of type class java.lang.String to class [Ljava.lang.String;
> I see some relation with bug #TRINIDAD-60.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1417) partialTriggers does not take String value

Posted by "Bart Kummel (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679625#action_12679625 ] 

Bart Kummel commented on TRINIDAD-1417:
---------------------------------------

As a work around, you can use an EL expression, as mentioned. To make this a bit easier, you could register a Facelets function:

The function:
package com.company.my

public class FaceletsFunctions
    public static String[] getStringArray(String string) {
    	return string.split(" ");
    }
}

my.taglib.xml:

  <function>
    <function-name>getStringArray</function-name>
    <function-class>com.company.my.FaceletsFunctions</function-class>
    <function-signature>java.lang.String[] getStringArray(java.lang.String)</function-signature>
  </function>

Usage:

partialTriggers="#{my:getStringArray('selectedReaction')}"



> partialTriggers does not take String value
> ------------------------------------------
>
>                 Key: TRINIDAD-1417
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1417
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components, Facelets
>    Affects Versions: 1.2.10-core
>         Environment: Facelets 1.1.14, Trinidad 1.2.10, MyFaces core 1.2.4, Glassfish v2
>            Reporter: Bart Kummel
>
> When using the partialTriggers attribute, it does not take a literal String (even if it only contains a single id). The only way to get partialTriggers to work is to use a EL expression that returns a String[]. When using a literal string, I get the following exception:
> java.lang.IllegalArgumentException: Cannot convert selectedReaction of type class java.lang.String to class [Ljava.lang.String;
> I see some relation with bug #TRINIDAD-60.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.