Custom component and non-primitive types of attributes

Dear programmers
I try to develope a custom UI component that one of its attribute is an ArrayList. For example:
<productFile:Matrix images="#{MyBean.imagesArray}"/>Unfortuanetly I get the following exception:
[Unable to convert string &#39;#{MyBean.imagesArray}&#39; to class java.util.ArrayList for attribute images: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager]: org.apache.jasper.JasperException: Unable to convert string '#{MyBean.imagesArray}' to class java.util.ArrayList for attribute images: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
The attribute images is an ArrayList in the custom component.
I have also specifieded it as an ArrayList in the tld file:
<tag>
       <name>Matrix</name>
       <tag-class>org.sii.productfilejsf.tags.MatrixTag</tag-class>
       <body-content>JSP</body-content>
       <attribute>
            <name>images</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
            <type>java.util.ArrayList</type>
       </attribute>
  </tag>Does anyone has an idea what can be the problem?
How can I convert the expression?

so how will I be able to convert it?Only your converter knows it.
By the way, is your Matrix component fully completed including its children components?
If yes, you should know how to implement a converter, or its equivalent code for them.
For example, in the <h:dataTable> component, if its value attribute points an array of object,
then it is automatically converted to an appropriate DataModel used by its column children.
We may need to see your MyBean bean and related code set, if we have enough time.

Similar Messages

  • Conversion error with non-primitive types

    I'm wondering if anyone else is seeing this problem or has a potential solution.
    The problem, in a nutshell:
    I have beans that use non-primitive types (Float instead of float) in the getters and setters. However I keep getting conversion error problems. If I switch to primitive types, I don't get conversion errors. The built-in FloatConverter says (in the documentation at least) that it supports both primitives and boxed types. This was all working in EA4, though. I am discovering this problem as I migrate from EA4 to 1.0.
    The code is pretty straightforward:
    public class Bean implements Serializable {
    public float getProp() {...}
    public void setProp(float) {...}
    public Float getPropOld() {...}
    public void setPropOld(Float) {...}
    <!-- works -->
    <h:inputText id="floatinput" value="#{BeanInstance.prop}"/>
    <!-- doesn't work -->
    <h:inputText id="floatinputold" value="#{BeanInstance.propOld}"/>
    Any ideas? I have tried explicitly calling the FloatConverter but that gave the same problems.

    Okay, I figured out my problem.
    The JSF spec implies that f:convertNumber may be used inside an h:inputText tag. The early versions of Core JSF go further and show f:convertNumber being used inside an h:inputText tag in one of the examples. (Chapter 7, conversions).
    However, this has been the source of my problem. When using f:convertNumber, the converter would automatically determine the data type without regard to the data type in the backing bean. Hence, it would try to pass Longs or Doubles to the bean instead of Floats.
    I believe this may be an issue in the 1.0 FR release.

  • Is  Creating a Custom Component and Custom UIComponent are same in Flex ??

    Hi ,
    I am getting confusion in the terminology of words  with respect to Custom  Components .
    Please let me know whether  Creating a Custom Component and Custom UIComponent are same in Flex ??
    Because i have created some  Custom Components based on Form Container based on my business screens .
    Does they both Custom Component and Custom UIComponent mean the same ??
    Please tell me .
    Thanks in advance

    There seems to be a little confusion here. Think of it this way:
    A basic UIComponent by itself is not visible; you can add something you can see to it to make a visual custom component. For example, a ComboBox component is a UIComponent with a ComboBox added to it.
    The UIComponent is the lightest weight component available from which you can create other components. I use it as the base for custom components that the user cannot see, like a data manager.
    HTH,
    Carlos

  • JAX-RPC and non-primitive data types

    Hello all!
    I am using JWSDP v1.3 and i have a problem using non-primitive data types as return types for my operations.
    Consider the helloservice example of the JWSDP1.3 tutorial. Now suppose that instead of having the simple operation sayHello() that returns a String, we execute a query on a database, get some ResultSetMetaData and we want these Metadata to be the return type of our operation. I.e. have the operation
    public ResultSetMetaData sayHello()
    instead of the
    public String sayHello()
    of the tutorial.
    When trying to build the service i get the following error which is normal, because ResultSetMetaData is not a supported JAX-RPC type.
    run-wscompile: [echo] Running wscompile: [echo] C:\jwsdp\apache-ant\../jaxrpc/bin/wscompile.bat -define -d build - nd build -classpath build config-interface.xml -model build/model. gz [exec] error: invalid type for JAX-RPC structure: java.sql.ResultSetMetaData [exec] Result: 1
    Is there any way to define an operation like this? Can i specify somehow ResultSetMetaData as a supported-type?
    I hope someone can give me some advice on it, because i have lost one evening trying to figure it out myself :)
    Regards,
    Kostas

    Courtesy links to crossposts so people don't waste their time answering a question which has already been answered
    http://forum.java.sun.com/thread.jsp?thread=482875&forum=59&message=2253704
    http://forum.java.sun.com/thread.jsp?thread=482873&forum=331&message=2253699

  • Custom component and custom event problem

    hello , i have a strange problem since one week , is that i can't handle the events becoming from my custom component , here is my code :
    Event Class :
    package events
         import flash.events.Event;
         public class Ev extends Event
              public static const UPDATE:String="update";
              public var data:String;
              public function Ev(type:String,data:String)
                   super(type);
                   this.data=data;
              override public function clone():Event
                   return new Ev(type,data);
    MXML component :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
         <fx:Metadata>
              [Event(name="onMenuChange",type="events.Ev")]
         </fx:Metadata>
         <fx:Script>
              <![CDATA[
                   import events.Ev;
                   import mx.events.IndexChangedEvent;
                   protected function accordion1_changeHandler(event:IndexChangedEvent):void
                        dispatchEvent(new Ev(Ev.UPDATE,event.newIndex.toString()));
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Placer ici les éléments non visuels (services et objets de valeur, par exemple). -->
         </fx:Declarations>
         <mx:Accordion width="200" height="200" change="accordion1_changeHandler(event)">
              <s:NavigatorContent label="Menu 1" width="100%" height="100%">
              </s:NavigatorContent>
              <s:NavigatorContent label="Menu 2" width="100%" height="100%">
              </s:NavigatorContent>
              <s:NavigatorContent label="Menu 3" width="100%" height="100%">
              </s:NavigatorContent>
         </mx:Accordion>
    </mx:VBox>
    the main container :
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
         <fx:Script>
              <![CDATA[
                   import events.Ev;
                   import mx.controls.Alert;
                   protected function comp1_onMenuChangeHandler(event:Ev):void
                        Alert.show(event.data,"notice");
              ]]>
         </fx:Script>
         <local:Comp onMenuChange="comp1_onMenuChangeHandler(event)"/>
    </s:Application>
    any help will be welcome !

    hi,
    Not sure why your custom event is not working, I tend not to worry about 'custom' events unless I need to transfer a lot of information.
    Here is a way to 'simplify' event management.
    I just declare a new event in the meta data and then send it to notify that a change has been made. Although the parent can find the index value easily enough I also use two-way bind the navigators index so that it is directly available for the application to manipulate/read .
    http://gumbo.flashhub.net/events/  source included
    David.

  • A Custom Component and the JSP source that get's generated

    I'm writing a Custom Component library and I'm at a point where I need to understand how the JSP source that gets generate when my component is dragged from the palete is created and how it relates to the properties I define in the Metadata files.
    In particular I have a component that is an extension of the DataTable component and I'd like to control what get's dropped onto the page when the user drags over my component.
    Don

    See the "Building and Customizing JavaServer Faces Technology Components" technology theme page at http://developers.sun.com/prodtech/javatools/jscreator/reference/themes/buildingjsf/index.html. The Hands-On Examples and "Design-Time API User Guide (pdf)" linked from that page should help.

  • How to get an event both in custom component and into its instance

    I have a custom component that extends a Jtree
    I want to know when a node is clicked both , into my component and after into the component sited into Jpanel
    now, I can only detect it into the component, but I dont know how to detect it at the component I have in my Jpanel
    I have 'addTreeSelectionListener' in both places ...
    xxxxx.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
    public void valueChanged(javax.swing.event.TreeSelectionEvent e) { .....
    Any help ?
    Thanks

    tonnot wrote:
    Thank you.
    I think that a good answer can be ' Revise your code, because there must be a problem' Well, that's the life of a programmer. If you want to post an SSCCE, I'm sure somebody can help if you get stuck.
    And ...
    Why are you extending JTree? I'd bet you shouldn't be.Why not ? ....
    Why SUN develop the 'extends' functionality ? You should use extends if you're changing the behavior of an existing class. An example of this is extending JPanel and overriding the paintComponent() method to do some custom painting.
    You should not use extends if you just need an instance of an existing class. An example of this is extending JFrame instead of simply creating a JFrame instance.
    Without seeing your code, I can't be sure you're misusing extends. But many people do.
    Here's an example.
    Bad:
    public class MyProgram extends JFrame{
       public MyProgram(){
          setSize(200, 200);
          setVisible(true);
       public static void main(String [] args){
          new MyProgram();
    }Better:
    public class MyProgram{
       public MyProgram(){
          JFrame frame = new JFrame();
          frame.setSize(200, 200);
          frame.setVisible(true);
       public static void main(String [] args){
          new MyProgram();
    }

  • Shared data in custom component and FPM_FORM_UIBB

    Hi all,
    is it possible to share data between a form UIBB and a custom building block context. It probably can be done with shared classes, but is it possible to use the shared data interface and how?
    kind regards,
    Pieter

    >
    Pieter Troost wrote:
    > Hi all,
    >
    > is it possible to share data between a form UIBB and a custom building block context. It probably can be done with shared classes, but is it possible to use the shared data interface and how?
    >
    > kind regards,
    >
    > Pieter
    Hi Pieter,
    As you already said , it is possible by shared classes, i am afraid that it is not possible  to have the Shared Component, interface to get worked the way you would like to have.

  • Managed Default versus Managed Custom Folder, and Default Folder Type Options

    I am looking to create some new managed folders needed for company retention policy.
    It seems pretty forward to create the folder: 
    New-ManagedFolder -Name "[Name Here]" -DefaultFolderType Inbox -Comment "[comments here]" -MustDisplayComment $true
    However I have noticed there seems to be two types of folders: Managed Custom and Managed Default. What exactly is the difference.
    Also what different default folder type options are there, and what is the different between them?

    I actually am using retention tags and retention policies for the existing folders (inbox, deleted, junk/spam, conversation history). Which takes care of most of our actual messages.
    However most of the space in a users mail box is take by docs scanned to their emails. These docs are almost instantly moved to file servers, and other databases but sit in the mailboxes for ever. So I was hoping to create a default folder and deploy rules
    so that all the scanned items are automatically moved to that folder where they can be deleted per a retention policy tag.
    I'm not married to this method but it did seem reasonable in terms of not leaving things to the users to sort items, and would love a better way to accomplish it.
    The retention policy says we will keep communications for a maximum x years for users excluding certain document types (junk/spam, voice mails, Instant messages, Scanned docs) and any thing older will be automatically removed, the special documents
    will have significantly shorted life spans (1 to 8 weeks). 

  • Is it possible to display the content of complex mutlidimensional datastructures (e.g. std::vectors (dim = 2) of (non-primitive) types) in Xcode debugger?

    Hi,
    First, let me say that I like Xcode and coding in OS X. However, there is something I miss:
    Let me demonstrate what i mean:
    This is the representation of a 2D-Vector in Xcode Debugging environment:
    v          'std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >'          [{...}]
    0          'std::vector<int, std::allocator<int> >'          [{...}]
    1          'std::vector<int, std::allocator<int> >'          [{...}]
    2          'std::vector<int, std::allocator<int> >'          [{...}]
    3          'std::vector<int, std::allocator<int> >'          [{...}]
    4          'std::vector<int, std::allocator<int> >'          [{...}]
    5          'std::vector<int, std::allocator<int> >'          [{...}]
    6          'std::vector<int, std::allocator<int> >'          [{...}]
    7          'std::vector<int, std::allocator<int> >'          [{...}]
    8          'std::vector<int, std::allocator<int> >'          [{...}]
    So, the above representation is what I would call bad (even useless).
    The problem is that the current Linux Kernel (3.1.1) has some problems with the new MBA 2011 (which is really sad) so I can not show you the representation of a 2D-Vector in Qt-Creator for Linux right now (I'm not sure if the Qt-Creator for OS X could display the content properly, since I've never tried it). But you can believe me, that the represantation would look something like the one in Eclipse (which would be a good representation).
    So my question: is there a "fix" for this?

    What you want is a custom data formatter. I would give you some links, but my iPad wants to convert them into the documentation viewer.
    You aren't going to find much help with C++ debugging. While Apple's Clang has made great improvements in C++ support compared to GCC, C++ is really not something that Mac or iOS programmers typically use. The Cocoa containers and objects are so much more versatile. You kind of have to have a masochist streak and a 7 year development schedule to use C++. C++ is experiencing a bit of a resurgence, especially in defense markets. For a long time, compilers had such poor support for C++ that it just wasn't possible. After simplifying the language a little, compilers can now compile and link C++. Consultants have realized they can provide C++ services and burn though billable hours better than any other language on the market. Independent developer, however, don't have those schedules and budgets so they tend to use NSArray. Xcode supports it better in the debugg and, chances are, you don't need to debug it anyway. There are a number of matrix classes built on Cocoa.

  • Primitive v/s Non-primitive data type

    Hi,
    I am new to java. What is the difference between primitive and non-primitive data type?

    hi Anand,
    there are hundred thousands of object in the Data Dictionary, so 15 won't harm much On the other hand, if you build up an ALV list based on this table, than it is good that you have these texts there with translations, etc.
    hope this helps
    ec

  • EncodeBegin and encodeEnd, or getChildren.add in a custom component?

    which is considered a better practice in JSF custom composite components?

    just insert the script tags in the custom component and place
    your actionscript within those script tags. So in your case just
    insert the following script tags above the image control...
    <mx:Script>
    <![CDATA[
    // actionscript goes here
    ]]>
    </mx:Script>
    - Tony

  • Custom Tag and Attribute Not Found

    Hi,
    I've been getting an error with the following code in a JSP called cardDeclined.jsp...
    <gwps:log level="ERROR" message="<%= request.getAttribute("errorMessage") %>" />gwps:log is a custom tag and errorMessage is a request attribute set in a servlet that includes my JSP. When I execute the program, I get a message from the servlet container (Tomcat 3.2.3) stating that "attribute 'errorMessage' has no value".
    I wrote some test code that dumps out "errorMessage"; that seemed to work. The JSP request object has a value for "errorMessage." So, I now use the following workaround...
    <% String message = (String)request.getAttribute("errorMessage"); %>
    <gwps:log level="ERROR" message="<%= message %>" />I'm looking for a reference describing how request and session variables can be passed to the custom tag
    Thanks,
    CW

    I think you might be having a problem with the quotes. Try this instead:
    <gwps:log level="ERROR" message='<%= request.getAttribute("errorMessage") %>' />
    Notice the single quotes around the scriptlet.

  • JSF Custom component for table pagination and sorting

    hi
    i want such a custom component that render a table and table has the features of pagination and column sorting.
    any one know from where i can get such a custom component.
    (if this component is available with source then it would be more help full for me)
    thnks & regards,
    Haroon
    Message was edited by:
    HaroonAnwarPADHYAR

    I know two companies that offer JSF component for table pagination and sorting and AJAX based :
    http://www.teamdev.com/quipukit/demo/datatable/DataTable_filteringAndPaging.jsf
    http://java.samples.infragistics.com/NetAdvantage/JSF/2006.1/
    The problem? They are not open source..
    And I am too looking forward on this subject, because I want to develop my own custom component and add some features. If someone has any tips, references or samples of their own, it would be really appreciated.
    Thank you.
    Paul

  • How to handle value change events of select list in custom component?

    My HelloUIComp code...How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...
    public class HelloUIComp extends UIComponentBase {
        public static final String account="custom.account";
        public static final String RENDERER_TYPE = null;
        HtmlCommandButton button = createButton();
        //HtmlSelectOneMenu select=createSelect();
        public void processDecodes(FacesContext context) {
             Calling the lifecycle method "processDecodes" on the
             internal button is absolutely critical to create action events
             button.processDecodes(context);
             super.processDecodes(context);
        private HtmlCommandButton createButton() {
             FacesContext context = FacesContext.getCurrentInstance();
             HtmlCommandButton newButton = new HtmlCommandButton();
             newButton.setId("Add");
             newButton.setValue("Add");
             newButton.setType("submit");
             //newButton.setOnclick("return func_1(this,event);");
             MethodBinding binding = context.getApplication().createMethodBinding("#{pc_MyProjectView.go}", null);
             newButton.setAction(binding);
                  newButton.setParent(this);
             return newButton;
      /*  private HtmlSelectOneMenu createSelect()
             HtmlSelectOneMenu selectCategory=createSelect();
             return selectCategory;
         public void encodeBegin(FacesContext context) throws IOException {
              String style = (String)getAttributes().get("style");
              String startdate = (String)getAttributes().get("startdate");
              String enddate = (String)getAttributes().get("enddate");
              //String add=(String)getAttributes().get("add");
              ResponseWriter writer = context.getResponseWriter();
             writer.startElement("table", this);
            writer.writeAttribute("border","2","2");
            writer.startElement("tbody", this);
            writer.startElement("tr", this);
            writer.startElement("td", this);
            writer.writeText("Account Category", null);
            writer.endElement("td");
              writer.startElement("td", this);
              writer.writeText("Reg-No", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("Account-No", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("Start-Date", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("End-Date", null);
              writer.endElement("td");
              writer.endElement("tr");
              writer.startElement("tr",this);          
              writer.startElement("td", this);
              writer.startElement("select", this);
            if (style!=null)
                   writer.writeAttribute("style", style, null);
            writer.writeAttribute("name","category","category");
            writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              //to access data
              Account accountObj;
              AccountData accountDataobj;
              List listOfAccounts;
              int noOfAccounts;
              accountDataobj=new AccountData();
              listOfAccounts=accountDataobj.getAccounts();
              noOfAccounts=listOfAccounts.size();
              for(int i=0;i<noOfAccounts;i++)
              writer.startElement("option", this);     
              accountObj=(Account) listOfAccounts.get(i);
              writer.writeText(accountObj.getCategory(), null);
              writer.endElement("option");
              //System.out.println(accountObj.getRegNo());
              //System.out.println(accountObj.getAccountNo());
              writer.endElement("select");
              writer.endElement("td");
            writer.startElement("td", this);
              writer.startElement("select", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("name","regno","regno");
              writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              for(int i=0;i<noOfAccounts;i++)
              accountObj=(Account) listOfAccounts.get(i);     
              writer.startElement("option", this);
              writer.writeText(""+accountObj.getRegNo(), null);
              writer.endElement("option");
              writer.endElement("select");
              writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("select", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("name","accno","accno");
              writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              for(int i=0;i<noOfAccounts;i++)
              accountObj=(Account) listOfAccounts.get(i);
              writer.startElement("option", this);
              writer.writeText(accountObj.getAccountNo(), null);
              writer.endElement("option");
              //writer.startElement("option", this);
              //writer.writeText("00200155", null);
              //writer.endElement("option");
              writer.endElement("select");
              writer.endElement("td");
              writer.startElement("td", this);
              button.encodeBegin(context);
             button.encodeChildren(context);
             button.encodeEnd(context);
            writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("input", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("type","text","text");
              writer.writeAttribute("name","startdate","startdate");
              writer.writeAttribute("value",startdate,startdate);
              writer.writeAttribute("readonly", "","");
              //writer.endElement("input");
              writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("input", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("type","text","text");
              writer.writeAttribute("name","enddate","enddate");
              writer.writeAttribute("value",enddate,enddate);
              writer.writeAttribute("readonly", "","");
              writer.endElement("td");
              writer.endElement("tr");
              writer.endElement("tbody");
              writer.endElement("table");
         public String getFamily() {
              return "HelloFamily";
         }

    NewEclipseCoder wrote:
    How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...Two ways:
    1) submit the form to the server and render the desired textbox depending on the option.
    or
    2) render all textboxes and use Javascript/DOM to display/hide them depending on the option.

Maybe you are looking for

  • Is it possible to get the handle of a HTML UI element in JSPDynpage?

    Hi Experts, I am new to Portal Development and my current requirement is as follows: User is provided an option to upload a file to KM from the JSP for which i used a HTMLB fileupload UI element. I was able to upload the file to the KM. But the clien

  • How to disable menu items through c# in adobe x standard. I didn't find the required APIs.

    Hi We are working on a desktop application on C# which uses Adobe Express 5.0. to view the PDF files. Recently we had an issue reported that PDFs created in Adobe 9 are not opening up. So we decided to upgrade to Acrobat Adobe X Standard. Now the iss

  • Trying to create a rotating word cloud

    I'm trying to simulate one of the 3D word clouds you see popping up around the net these days. Here's an example (to the right in the header): http://tarasnovak.com/blog/2009/01/12/wordle-beautiful-and-compact-word-cloud-generator/ What I've done so

  • How can I set 'menu' to return to 2nd menu scene selections?

    I have a two page menu. 1. Title page. 2. Scene Selections page. Once we are on the 2nd page, I want the viewer to be able to return to this page when returning from viewing a selection. There is a button on Page 2 to get them back to the main menu i

  • ESS/MSS Configuration Help

    Hi Friends, Can anyone help me with some reference documents for ESS/MSS configuration and integration of ABAP report/Infotypes on ESS portal. Regards, Ameet