Create complex custom component

Hi everyone!
I'm trying to create my own custom component in JSF. However I have several questions :
- It is not mandatory to create a renderer class, right ? the component can draw itself ?
- How can I create a custom component which would have several "values" inside ? for example let us supppose I want to create a custom JSF component to enter a IBAN. The IBAN is divided into several parts : BBAN, country code, key, Bank adresse,... but any tutorial I've found explain how to create a input component with only one simple value (for example the classical "CreditCardInputComponent").
Josselin

Hi,
did you find a solution for your "composite" component problem?
I am also trying to create a custom component that contains several standard jsf components such as HtmlCommandLink and HtmlInputText.
I build all the standard components within my component programmatically using things like:
HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
Also at the beginning of the encodeBegin I clear all children from my custom component using getChildren().clear()
and rerender the component based on my new internal model which I updated during the previous decoding of my component.
As a simple jsf custom tag it works ok, however, I am facing deep problems with action events as soon as I use the component within a jsf HtmlDataTable tag.
Am I missing something here?
Any ideas? Help is really really appreciated. This different behavior in different contexts is slowly but constantly driving me nuts.
cheers
hans

Similar Messages

  • Creating a custom component in multisim using *.lib and *.olb files

    i have  *.lib and *.olb files for a pspice model. which file i have to you while creating a custom component in multisim.

    Hello,
    Thanks for your question. In order to create simulatable custom components in Multisim you need a SPICE model (Multisim can also understand PSpice Models). The file format for SPICE model can be different according to the manufacturer, for instance: *.cir, *.lib, *.llb. At the end of the day these files are text files that you can open with a text editor, therefore, you can simply copy and paste the model in Multisim.
    Here are two good resources on component creation:
    Component Creation 101
    Creating a Custom Component in NI Multisim
    When you reach the step where you need to enter the SPICE model, simply open the *.lib or *.olb file with a text editor, and copy and paste the model.
    Hope this helps.
    Fernando D.
    National Instruments

  • Creating a custom component

    I am creating a custom component that is based on Canvas.
    I am trying to add this component as a child of another
    component like that:
    myCanvas.addChild(myCustomComponent)
    addChild function expect ObjectDisplay in its argument and
    not a Class. I am little confused. If I am creating a component
    that base on Canvas isnt it inherited from ObjectDisplay?
    please help.

    I actually figure it out. Thank you!!!
    here is what I am trying to do.
    1. creating component_A based on Canvas
    2 in my Application I have Canvas_B
    I wanted to add component_A as a child to Canvas_B
    solution:
    Canvas_B.addChild(new component_A ())

  • Complex custom component

    I'm tring to create a custom component that implements browse control.
    the component is composed of a input box that holds the browse result a dialog with data table and a button that cause the dialog to open.
    I have some implementation issuses :
    1. the datatable needs to get it's input from the database, normally I would create a value binding to a managed bean but I don't know where to put it in this case. (there can be more then component in a page so managed bean won't work)
    2. when the browse button is pressed I need to change the dialog display property so it would appear. how can I get hold of it's backing bean in the decode() method ? getting it through the context.getViewRoot().getChildren();isn't good enough since the component hierarchy changes from one page to another.

    Hi,
    did you find a solution for your "composite" component problem?
    I am also trying to create a custom component that contains several standard jsf components such as HtmlCommandLink and HtmlInputText.
    I build all the standard components within my component programmatically using things like:
    HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
    Also at the beginning of the encodeBegin I clear all children from my custom component using getChildren().clear()
    and rerender the component based on my new internal model which I updated during the previous decoding of my component.
    As a simple jsf custom tag it works ok, however, I am facing deep problems with action events as soon as I use the component within a jsf HtmlDataTable tag.
    Am I missing something here?
    Any ideas? Help is really really appreciated. This different behavior in different contexts is slowly but constantly driving me nuts.
    cheers
    hans

  • Help,Help me!   I want to create  a custom component

    The first, I'm a chinese,my English is very poor.Maybe I make so many mistakes.so
    I say sorry for you.
    I want to create a custom component so I research the Java.awt.Component .but I don't understand that the class has a method-------dispatchEvent(AWTEvent e).I want to know what invoke this method and when invoke?
    thank u

    I believe ( believe mind you )
    that the method:
    public final void dispatchEvent(AWTEvent e)
    Dispatches an event to this component or one of its sub components. Calls processEvent before returning for 1.1-style events which have been enabled for
    the Component.
    Parameters: e - the event
    Is used to send an Event message to This component from another
    like :
    Say you have 'MyComponent1' sending Events to MyComponent2
    AWTEvent e = new AWTEvent( blah whatever.......);
    MyComponent2.dispatchEvent( e );
    and then the Event Handlers on MyComponent2 if any will recieve 'e'
    You Probably don't need to modify this behaviour
    I assume you are doing something like
    public class TestComponent extends Component
    private int MySpecialExtraValue;
      public TestComponent()
         super();  // like : new Component()
         MySpecialValue = 5;  // Just an example
      // Override a Method in Component just as an example.
    public String getName()
       String S = "I am a Custom Component";
        return S;
      //Another override example
      public void repaint()
         System.out.println("repaint() was called");
         super.repaint();  // use the original Component Method
         // blah do own stuff
    }Override any methods that you need to get the required behaviour that you want...
    I hope this is a help........

  • 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

  • Help with creating a custom component.

    Hi. I have created a really simple custom component called
    myComp. It is a simple Canvas 100 pixels x 100 pixels with an Image
    control component.
    <mx:Canvas>
    <mx:Image id="image1">
    </mx:Canvas>
    After instantiating the component in Main.mxml eg. var
    pic1:myComp = new myComp(); I am having a problem setting the
    source property of the Image component.
    "image1" is the id of mx:Image in the custom compoenent so I
    tried pic1.image1.source = "assets/ball.jpg" but I get a run time
    error "Error #1009: Cannot access a property or method of a null
    object reference".
    Don't really know what I am doing wrong.
    Any help please!

    In your custom component, try adding a bindable public var
    which contains the path to your image. Also, set the image.source
    to this var.
    In your main app, set the var within the <mx:> tags of
    the custom component. Since it is a public var, it will show up in
    the code hint. You can also now change the image var from the main
    app anytime you like using ActionScript code.

  • Creating a custom component is causing a strange scoping issue

    I am a fairly new user to Flash and Actionscript, but I have
    a fair amount of experience working with C and Java. I'm currently
    working with Actionscript 2 in Macromedia Studio 8. I was trying to
    create a new component for a project I am working on, and I
    followed the tutorial in the help and all testing works while I am
    in context of the flash document where I export the component from.
    However, I try testing my component in a new blank document and I
    get some strange behavior.
    I am able to create a component on the stage, and adjust the
    properties perfectly fine. However, when I test the file, the
    variables for colors go out of scope. That is, the adjustments I
    made to the component through the parameters panel, and saw updated
    on the stage aren't demonstrated at runtime. The Number variable I
    used however is preserved. I did some traces, and it appears that
    this is happening because at runtime in the new blank document, the
    variables in the onEnterFrame method go out of scope, where they
    weren't before.
    It seems really strange to me that I should be able to edit
    the color on stage but have it revert while it is running. My
    intuition says that if it wasn't going to work in the new document,
    that it shouldn't work in either case.
    Anyway, here is the code for the .as file, I hope I'm just
    doing something stupid.

    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

  • How to create a custom component in Integrator

    Hi everybody, I'm trying to develop a custom componente for Endeca Integrator, following this guide:
    http://www.cloveretl.com/blog/creating-your-own-component-in-cloveretl-step-by-step/
    but, even if I installed Plug-in Development Environment (PDE), I can't see plug-in options in File->New->Others section, so I can't follow guide steps.
    Is there any problem with my configuration of Integrator? Why can't I see plug-in development/deployment options anywhere in Integrator?
    Is there eventually another way to implement a custom component in Integrator?
    Thanks for your replies!

    No, it doesn't. It's like PDE has never been installed, but I try to reinstall it through "Help"->"Install new software" I receive an error because the plug-in is installed.

  • How do you create a Custom Component?

    I've made use of a few custom components available on the web
    (IE. a custom fire component from gskinner.com) which made me
    realize I haven't come across any way to make my own components. I
    don't have anything particular in mind at this time, but I can see
    it as an important tool in generating standard re-useable effects.
    Anyone know of the basic process?

    Dear Alberto,
    Check this post.
    Might help.
    PCD content of Netweaver 7.0 available in Netweaver 7.3
    Kind Regards
    /Ricardo Quintas

  • Huge pain Creating a Custom Component with lots of pins

    hello
    I am trying to create an ATmega 128 MCU in multisim that I plan on using to layout a pcb in utiliboard with. SInce this is just for pcb layout purposes I can care less about adding a spice model. I did the "component wizard" and selected "layout only (footprint)" I chose the TQFP-64 package and all is well. I get to step 4 where i "set pin parameters" and this is where I enter the names of the pins. The problem is that this takes a long long time. I thought there has to be some way to import the pin names from a spreadsheet but I couldnt find any way! The only way I can add them is by selecting each cell in excel and copying then going to multisim and selecting the next cell and pasting. I cannot copy and paste a whole column. This would take hours to do for a chip with over 100 pins. The next step "map pins" takes a long time too. I have to individually click between the cells. Is there any way to map everything at once using the same order?
    Also unrelated question. whats the difference between the "TQFP-64" and "TQFP-64L" in multisim? the look identical to me, not sure what the L suffix does.
    Thanks

    Hi smithman,
    It is not possible to import pin names from an excel spreadsheet at this time. I will pass on your concerns to R&D.
    The "TQFP-64" and "TQFP-64L" are quite different if you take a closer look at them. It depends on the manufacturer which one they use for their parts.
    Sorry I could not be of more help.
    Regards,
    Tayyab R,
    National Instruments.

  • Create a Custom Component With Custom Shape

    Hi all,
             I want to create a Component that should have a CustomShape.
             I will explain this in detail ,Suppose now we have a Button, Button will be having some Rectangular Shape, But in my Case i dont want this    Rectangula Shape, I will be giving x and y positons Depending on that positon It has to form a Component.
             Any Help is Greatly Appreciated.

    Even if you use transparent images, you will still end up with a rectangular bounding box.
    You can use programmatic drawing and get a shape that does not involve a rectangle:
    http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_6.html
    http://livedocs.adobe.com/flex/3/html/Drawing_Vector_Graphics_5.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=Drawing_Vector_Graphics_4.html
    If this post answers your question or helps, please mark it as such.

  • How do you reference a valueObject located in main to a custom component created in Catalyst?

    Hello,
    I have been working with the Catalyst Beta 2 / Flash Builder beta trying to create a photogallery and have hit a little bit of a snag, try as I might I can't seem to find the answer anywhere. I am still new to Flex so please excuse me if this is a basic question, I have been trying to understand more about Flex to make my designs in Catalyst better.
    I found this video on Adobe TV: http://tv.adobe.com/watch/rich-internet-applications-101/ria-stepbystep-16-binding-a-data- service-to-flash-builder-components/
    It's wonderful and I have the datalist I created in Catalyst working with the XML file I generated but I designed my little photogallery a bit diffrent, I created a Custom Component in Catalyst so that when you click an item on the DataList it pop's up a little screen with a larger photo in on it, rather then having an image in the main application. Now my problem seems to be that I can't refrence the valueObject I created with the wizard as it's in my Main.mxml file, is there a way to refrence it from my Custom Component so the larger image will display? Is there a way to let the component know which item on the dataList in the main application is selected and display the correct image?
    I should also say I really enjoy working with the Beta for both Flash Builder / Catalyst, thanks for the hard work!
    Thanks for the help,
    Chris

    I am afraid you cannot bind to static properties in Windows Store Apps. It is simply not supported.
    You could create a proxy class that exposes the static command property and bind to this property of an instance of the proxy object:
    http://stackoverflow.com/questions/14186175/bind-to-a-static-field-in-windows-8-xaml
    http://stackoverflow.com/questions/4708711/how-can-i-use-the-xstatic-extension-for-phone7-silverlight-apps
    You will of course have to create an instance of the proxy object. There is no way around this.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

  • Advice on creating a tricky custom component

    Hi,
    I'm working on creating a custom component which displays a image at the top of the canvas, and loops through a passed array collection, displaying each row of the array collection in a item renderer. So the component should look like this (see attached image).
    As you can see from this image the header is a image itself, this will differ every instance of the panel, there should be 3 of these panels on the page. Then each row of data is a item renderer displaying the data provided from a array collection of value object. If there are 4 items in this array collection then the panel should show 4 rows, if there are 2 row in the array then the panel will display 2 rows. Also the height of the panel will dynamically change depending on the number of rows to show.
    I was thinking of extending a Canvas component, and then passing in the image URL and trying to load and draw the image dynamically, then I was thinking of using the Drawing API to create the rectangle shape using the drawRoundRectComplex() of the graphics class.
    The problems I see with this is that I don't think the drawn rectangle shape can re-draw itself to show the change in height when more or less row of data need to be be displayed.
    Another option I have been thinking about is extending the Panel class to create my component, this may be better for handling the height resizing, but I'm not sure it can support the look of this component (the header image and the three rounded corners).
    Could anyone give me some advice on what would be the better option for creating this component.
    Thanks
    Stephen

  • I am not able to create a JMS connection from a custom component in UCM

    I am trying to create a custom component which makes a JMS connection and inserts messages in JMS Queue.
    THe JMS server is hosted on Weblogic Application Server.
    When the code runs I am getting the factory object and the queue object.
    But when I try to get a connection it throws an error as pasted below.
    WHen I googled the same error It has shown a simliar problem in TOmcat in sun thread
    It said two jar files xerces.jar and xml-apis.jar are obsolete.
    I replaced with the new version.
    still the same problem occurred
    Please help
    Pasting the code and exception here
    Code __________________________________________
    import java.util.Date;
    import java.util.Hashtable;
    import javax.jms.*;
    import javax.naming.*;
    import weblogic.jms.client.WLConnectionImpl;
    import weblogic.jms.extensions.*;
    import javax.rmi.PortableRemoteObject;
    public class SimpleProducer {
    public static void drive() {
    final int NUM_MSGS;
         NUM_MSGS = 93;
    Context jndiContext = null;
    Hashtable<String, String> ht;
              ht = new Hashtable<String, String>();
              ht.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
              ht.put(Context.PROVIDER_URL, "t3://punitp52975d:7001");
    try {
         jndiContext = new InitialContext(ht);
    } catch (NamingException e) {
    System.out.println("Could not create JNDI API context: " +
    e.toString());
    System.exit(1);
    ConnectionFactory connectionFactory = null;
    Destination dest = null;
    try {
                   Object home = jndiContext.lookup("CNFT"); // where iiopTestDS is jndi name for my DataSource.
    connectionFactory =(ConnectionFactory)PortableRemoteObject.narrow(home , ConnectionFactory.class);
         Object home1 = jndiContext.lookup("QUEUE2"); // where iiopTestDS is jndi name for my DataSource.
    dest =(Destination)PortableRemoteObject.narrow(home1 , Destination.class);
         /*connectionFactory = (ConnectionFactory) jndiContext.lookup(
    "CNFT");
    dest = (Destination) jndiContext.lookup("QUEUE2");
    System.out.println("connectionFactory,dest "+connectionFactory+dest);*/
    } catch (Exception e) {
    System.out.println("JNDI API lookup failed: " + e.toString());
    e.printStackTrace();
    System.exit(1);
    //WLConnectionImpl connection = null;
    WLConnection connection = null;
    WLMessageProducer producer = null;
    try {
                   System.out.println("Getting Connection "+(WLConnection) connectionFactory.createConnection());
    //connection = (WLConnection) connectionFactory.createConnection();
                   System.out.println("Connection created");
    WLSession session =
    (WLSession) connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    producer = (WLMessageProducer) session.createProducer(dest);
    WLMessage message = (WLMessage) session.createTextMessage();
    //TextMessage message = session.createTextMessage();
    for (int i = 91; i < NUM_MSGS; i++) {
    ((TextMessage) message).setText("This is message " + (i + 1));
    Long l = new Date().getTime();
    message.setLongProperty("ReleasedDate",l );
    System.out.println("Sending message: " + ((TextMessage) message).getText());
    producer.send(message);
    producer.send(session.createMessage());
    } catch (Exception e) {
    System.out.println("Exception occurred: " + e.toString());
    } catch (Throwable et) {
    System.out.println("Exception occurred: " + et.toString());
    et.printStackTrace();
    finally {
    if (connection != null) {
    try {
    connection.close();
    } catch (Exception e) {
                             System.out.println("*************Instantiating Producer***************");
    Exception_________________________________________________________________
    Exception occurred: java.lang.NoSuchMethodError: javax.xml.parsers.SAXParserFactory.getSchema()Ljavax/xml/validation/Schema;
    java.lang.NoSuchMethodError: javax.xml.parsers.SAXParserFactory.getSchema()Ljavax/xml/validation/Schema;
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.<init>(SAXParserImpl.java:124)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:115)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:143)
    at weblogic.xml.jaxp.WebLogicSAXParserFactory.<init>(WebLogicSAXParserFactory.java:62)
    at weblogic.rmi.internal.wls.WLSRMIEnvironment.getSAXParser(WLSRMIEnvironment.java:136)
    at weblogic.rmi.internal.DescriptorManager.getDescriptorAsMap(DescriptorManager.java:170)
    at weblogic.rmi.internal.DescriptorManager.getDescriptorAsMap(DescriptorManager.java:159)
    at weblogic.rmi.internal.DescriptorManager.createRuntimeDescriptor(DescriptorManager.java:104)
    at weblogic.rmi.internal.DescriptorManager.getBasicRuntimeDescriptor(DescriptorManager.java:85)
    at weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:51)
    at weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:37)
    at weblogic.rmi.internal.OIDManager.makeServerReference(OIDManager.java:194)
    at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:175)
    at weblogic.rmi.utils.io.RemoteObjectReplacer.replaceRemote(RemoteObjectReplacer.java:120)
    at weblogic.rmi.utils.io.RemoteObjectReplacer.replaceObject(RemoteObjectReplacer.java:103)
    at weblogic.rmi.extensions.server.ServerHelper.exportObject(ServerHelper.java:223)
    at weblogic.rmi.internal.OIDManager.initializeDGCServer(OIDManager.java:231)
    at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:144)
    at weblogic.rmi.utils.io.RemoteObjectReplacer.replaceRemote(RemoteObjectReplacer.java:120)
    at weblogic.rmi.utils.io.RemoteObjectReplacer.replaceObject(RemoteObjectReplacer.java:103)
    at weblogic.rmi.extensions.server.ServerHelper.exportObject(ServerHelper.java:223)
    at weblogic.corba.server.naming.ReferenceHelperImpl.exportObject(ReferenceHelperImpl.java:233)
    at weblogic.rmi.extensions.PortableRemoteObject.exportObject(PortableRemoteObject.java:34)
    at weblogic.messaging.dispatcher.DispatcherImpl.export(DispatcherImpl.java:85)

    This is probably related to this other issue http://www.adobeforums.com/webx/.59b7fbab/0.
    Jasmin

Maybe you are looking for

  • Enhancement suggestions

    Just got a new Apple TV. I wondered if I really need it as my TV (Samsung 6 series) already got music streaming and internet capabilities. While I succeeded to a) get music played from Itunes, b) viewing photos and b) watching Youtube videos (a + b w

  • How to link media to a project

    for some reasons imovie have lost the trace for media files in one of my projects. finally i found a solution!! Close imovie and go to the project file, back it up, and show package contents, inside open the project file, it should open in a property

  • Reason/ReWire--logic vocals out of synch (newbie)

    Hi I just set up logic. I have a song I did in reason, it plays fine with logic. However when I record a vocal in logic and play it back, it is out of synch. The vocals start a little before they are supposed to. Any suggestions on what is causing th

  • Will the new iPhone 4s be compatible with iMac version OSX 10.6.8, or will I need to upgrade the iMac operating system?

    Will the new iPhone 4s be compatible with my 5 or 6 year old iMac that I upgraded to Snow Leopard (10.6.8)? Or will I need to upgrade the operating system on the iMac?

  • Key constraints on REF

    Forigen Key constraints on nested table column: What can I do to prevent a REF stored in a nested table becoming dangling? I tried using a forigen key constraint on nested table column but failed with (ORA-30730: referential constraint not allowed on