Creating an HtmlCommandLink in a Custom Component

Hi,
A simplified version of my problem is as follows: I have created a custom component that delegates to a renderer. Within the renderer I create an instance of the HtmlCommandLink class to which I want to assign an action with the setAction method. However, when I try doing this with the line:
link.setAction(Util.createConstantMethodBinding("success"));
The page renders but the link does not work.
or:
MethodBinding vb = context.getApplication().createMethodBinding("success", null);
link.setAction(vb);
I get an exception.
I have set the navigation rule in my faces-config file for "success".
I am new to JSF and so I might be doing something stupid or missing the point somehow but I want to be able to create HtmlCommandLinks within a custom class rather than from a tag on the page.
Any help appreciated,
Barney

can you please post your exception as well as your JSP page.
Thanks
-Jayashri

Similar Messages

  • HtmlCommandLink in a custom component

    Hi everybody,
    seems like I got stuck with this Problem here: I am trying to create HtmlCommandLink within my custom component that points to a method via method binding. My code looks as follows:
    ResponseWriter writer = context.getResponseWriter();
    HtmlForm htmlForm = new HtmlForm();
    htmlForm.encodeBegin(getFacesContext());
    HtmlCommandLink htmlCommandLink = new HtmlCommandLink();
    htmlCommandLink.setParent(htmlForm);
    MethodBinding methodBinding = getFacesContext().getApplication().createMethodBinding("#{TestAction.defaultAction}", null);
    htmlCommandLink.setAction(methodBinding);
    htmlCommandLink.encodeBegin(getFacesContext());
    writer.write("Link");
    htmlCommandLink.encodeEnd(getFacesContext());
    htmlForm.encodeEnd(getFacesContext());
    The Link is created in the page and I can click on it but the method is not invoked. I can invoke it in the code manually which means the reference to the method is working. Am I missing something here?
    Any help appreciated
    Florian

    thanks for your help, and i change the code as :
    @Override
         public void encodeBegin(FacesContext context) throws IOException {
              if (context == null) {
                   throw new NullPointerException();
              ResponseWriter writer = context.getResponseWriter();
              ExpressionFactory expressionFactory = context.getCurrentInstance().getApplication().getExpressionFactory();
              ELContext elContext = context.getCurrentInstance().getELContext();
              MethodExpression actionExpression = expressionFactory.createMethodExpression(elContext,
                        "#{UserManager.actionLoad}",null, new Class[] {ActionEvent.class});
              UIParameter parameter = (UIParameter)context.getCurrentInstance().getApplication().createComponent(UIParameter.COMPONENT_TYPE);
              parameter.setId("addId");
              parameter.setTransient(false);
              parameter.setName("id2");
              parameter.setValue(34);
              HtmlCommandLink link = (HtmlCommandLink) context.getApplication().createComponent(HtmlCommandLink.COMPONENT_TYPE);
              HtmlForm form = new HtmlForm();
              form.setId("pageForm");
              link.setTransient(true);
              link.setValue("Create");
              link.setActionExpression(actionExpression);
              link.getChildren().add(parameter);
              this.getParent().getChildren().add(link);
              form.encodeBegin(context);
              link.encodeBegin(context);
              link.encodeEnd(context);
              form.encodeEnd(context);
    I can click on it but the method is not invoked.
    Any help appreciated.

  • HtmlCommandLink generation within custom component

    Hey everybody, I had a previous post similar to this, but after solving the one problem I was having another one arose that I'm not sure how to fix either. I've been scouring google and the forums for a definite answer on this to no avail. So, here's my problem again:
    I've created a menuBar component that consists of images, tomahawk swap images, and command links. I use the component this way in my pages:
    <or:menuBar pageClass="#{menuBarBean.PAGECLASS_HOME}" msg="foo!" />In my renderer for this component, I have set up HtmlCommandLinks which are supposed to invoke navigation methods in my MenuBarBean. However, when you click on one of the links, it seems as if the MethodBinding is never invoked, because the page just refreshes and never goes into the corresponding backing bean method. Strangely enough, if you provide an erroneous method name for the method binding such as "#{menuBarBean.FakeMethod}", faces doesn't even give a warning.
    All the piping seems to be working for the tag and the component.. meaning the "pageClass" and "msg" attributes get set and rendered properly on the menuBar. Also the thing renders correctly, but I have a feeling that I'm not setting the MethodBinding correctly for the "Action" property of the CommandLink, or I'm not setting it in the right place. Here's an abbreviated version of the code behind the component:
    In my 'MenuBar.java' class:
    public void setHomeBinding(MethodBinding mb)
    { homeBinding = mb; }
    public MethodBinding getHomeBinding()
    { return homeBinding; }There is also code in this class for stat management that saves and restores the values of the menuBar. I found that if I didn't do this, the "msg" attribute was cleared on refresh.
    In the 'setProperties' method of my 'MenuBarTag.java' class:
    MethodBinding mb = getFacesContext().getApplication().createMethodBinding("#{menuBarBean.gotoHome}", null);
    menuBar.setHomeBinding(mb);In the 'encodeEnd' method of 'MenuBarRenderer.java' (Here's where I create the link and set the Action to the MethodBinding)
    // If is this class, show a selected tab
    if(menuBar.getPageClass().equals(MenuBarBean.PAGECLASS_HOME))
         HtmlGraphicImage homeButton = (HtmlGraphicImage)application.createComponent(HtmlGraphicImage.COMPONENT_TYPE);
         homeButton.setUrl(IMG_HOME_SRC_SELECTED);
         menuBar.getChildren().add(homeButton);
    // else Render the button
    else
         HtmlSwapImage homeSwapImg = (HtmlSwapImage)application.createComponent(HtmlSwapImage.COMPONENT_TYPE);
         homeSwapImg.setUrl(IMG_HOME_SRC_IDLE);
         homeSwapImg.setSwapImageUrl(IMG_HOME_SRC_OVER);
         homeSwapImg.setStyleClass("menuBarButton");
         HtmlCommandLink homeButton = (HtmlCommandLink)application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
         homeButton.setAction(menuBar.getHomeBinding());
         homeButton.setId("homeButton");
         homeButton.getChildren().add(homeSwapImg);
         menuBar.getChildren().add(homeButton);
    menuBar.getChildren().add(spacer);
    RendererUtils.renderChildren(facesContext, menuBar);
    menuBar.getChildren().removeAll(menuBar.getChildren());And finally, in my MenuBar backing bean 'MenuBarBean.java'
    public String gotoHome()
    { return("goto-home"); }
    public String getPAGECLASS_HOME()
    { return PAGECLASS_HOME; }So that's pretty much it. Like I said, the thing appears to be rendered correctly and looks like I want it to look. Unfortunately, the buttons don't do anything because I guess I'm not creating the HtmlCommandLinks properly, or I'm just leaving something out. Does anybody have any idea as to why the links aren't working based the on the above code? There are no exceptions being thrown or any warnings coming up in the console at all, so unfortunately there's no more information I can give you of what's happening within the framework.

    I really don't know what the problem is, but I'm willing to take a few wild guesses. At least this post should give you a few things to try...
    I found funny things start happening with CommandLinks when they are attached as children to any component except UIViewRoot. I don't know why. I would suggest you do not add the commandLink as a child of menuBar. Try just adding it to UIViewRoot. Maybe it'll work. Another option might be to try and find a creative way to use outputLink.
    When I ran into problems with my CommandLink, I eventually found a way to do it with outputLink instead. However, that was far from an ideal solution.
    Another guess would be to make sure you menuBarBean is in Session scope.
    Try surrounding everything in the encodeEnd method in a try-catch block and see if you are throwing any exceptions.
    Also, maybe moving the code from encodeEnd to encodeBegin might make a difference. It's worth a try.
    And lastly, always make sure you have an h:messages tag on your JSP. There may be messages there that can shed some light on the situation.
    Sorry I can't give you a more definitive answer! Hope this helps though.
    CowKing

  • Problem with attributes in custom component

    Hi All,
    I am creating a simple jsf PanelGrid custom component....in that component I am adding two new attributes....
    when I use that tag in my jsf application it is rendering fine in the client side....but the parent class that is PanelGrid component's attributes are not inheriting to my custom panelgrid....
    can any one tell me how can I use the attributes of the super class PanelGrid??
    Thanks...

    Have you configured the attributes in the tag library descriptor?

  • Border with custom component

    Hi,
    How can i create a border with a custom component,
    e.g. e JCheckBox?
    regards
    Olek

    Re,
    Hm i have found a solution...
    http://www.javalobby.org/java/forums/t33048.html
    but this is a custom implementation.
    Is there a way to implement this via the legacy classes?
    Olek

  • 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

  • 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

  • How to create custom component in CRM 2007

    Hi.
    I am new for the CRM 2007 Web UI.
    Here we have CRM_UI_FRAME.
    Like this so many Components are there.
    I want how to create our own component.
    I created it as follows.
    Open the Transaction code bsp_wd_cmpwb.
    Provide Z Name in the Component.
    Zcomponent
    Press Create button.
    Go to Run Time Repository.
    Press Change Mode.
    Create a MODEL as ALL.
    GO to Browser Component Structre.
    Select View.
    Provide View name.
    Create the View.
    Go to view Layout.
    Provide the code like this.
    <%@page language="abap"%>
    <%@ extension name="htmlb" prefix="htmlb"%>
    <%@ extension name="xhtmlb" prefix="xhtmlb"%>
    <%@ extension name="crm_bsp_ic" prefix="crmic"%>
    <%@ extension name="bsp" prefix="bsp"%>
    <cthmlb:overviewFormConfig/>
    Create the context under the context.
    Go to Configuration tab.
    Assigne the Attributes to the Screen.
    GO to the Run Time Repository.
    press change mode.
    Assigne the view name to the Window.
    Save it.
    Test the Componet. But it is not diaply anything on the screen.
    How i will get the data into the web UI.
    Can anybody expalin about this one to me with screen shorts if possible.
    I want add some fields into the web UI. Provide some values into that. Capture the values.
    Navigate the data from one screen to another screen. How it is possible. I did not understand. 
    If i am changing any screens in the pre define component it shows dump.
    So, now i need Custom component with adding of the fields.
    Please give me proper information regarding this one.
    Thank You.
    Krishna. B.

    Hi,
    Try put the htmlb to show a field:
    <thtmlb:label design="LABEL" for="//<context>/<field>" text="<field>"/>
    <thtmlb:inputField  id="<field>" maxlength="31" size="20" value="//<context>/<field>"/>
    In order to get value, you can write a simple code in the event_handler:
    LR_BOL                      type ref to IF_BOL_BO_PROPERTY_ACCESS
    LR_BOL = ME->TYPED_CONTEXT-><context>->COLLECTION_WRAPPER->get_current()
    var1 = LR_BOL->GET_PROPERTY_AS_STRING('FIELD').
    take a look at lr_bol methods so that you can see the set and get methods.
    Regards,
    Renato.

  • 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

  • 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.

  • Where to create root BOL in custom component - best practice

    Hi Experts,
    I have created a BOL class to insert values into a ZTable.
    I have created a custom component/views for the BOL. Now how will the create method in the BOL will be called. In which method of the component controller or view controller do I create the BOL root..
    I want to use the following code.
    CALL METHOD SUPER->WD_CREATE_CONTEXT
    DATA:
      lref_substitute           TYPE REF TO if_bol_bo_property_access,
      lv_index                  TYPE i,
      lref_bol_entity           TYPE REF TO cl_crm_bol_entity,
      lrf_cuco                  TYPE REF TO cl_gs_mcat_mcat_impl,
      lref_bol_core             TYPE REF TO cl_crm_bol_core,
      lv_object_name            TYPE crmt_ext_obj_name VALUE cl_crm_catego_genil=>gc_ob_schema,
      lv_create_param               TYPE crmt_name_value_pair_tab,
      lv_number                     TYPE int4 VALUE 1,
      lref_new_substitute       TYPE REF TO if_bol_entity_col,
      lr_tx                     TYPE REF TO if_bol_transaction_context
    lref_bol_core = cl_crm_bol_core=>Get_instance( abap_true ).
    lv_object_name = 'ZHRUS_D2'.
    TRY.
        CALL METHOD lref_bol_core->root_create
          EXPORTING
            iv_object_name  = lv_object_name
            iv_create_param = lv_create_param
            iv_number       = lv_number
          RECEIVING
            rv_result       = lref_new_substitute.
      CATCH cx_crm_unsupported_object .
    ENDTRY.
    CHECK lref_new_substitute IS BOUND.
    lref_substitute ?= lref_new_substitute->get_first( ).
    CHECK lref_substitute IS BOUND.
    me->typed_context->zhrus->collection_wrapper->clear( ).
    me->typed_context->zhrus->collection_wrapper->add( iv_entity = lref_substitute ).
    I give the code in various methods and it all works fine. But what is the best way to create the root node.
    Regards,
    Abdullah Ismail

    Hi Abdullah,
    I use something like this to create a root entity in the BOL Core. In this case, a standard entity: BTOrder.
    *- Data dictionary
    DATA lr_core         TYPE REF TO cl_crm_bol_core.
    DATA lr_fac          TYPE REF TO cl_crm_bol_entity_factory.
    DATA lt_params       TYPE crmt_name_value_pair_tab.
    DATA lr_ent          TYPE REF TO cl_crm_bol_entity.
    FIELD-SYMBOLS <line> TYPE crmt_name_value_pair.
    *- Get the core instance and factory
    lr_core = cl_crm_bol_core=>get_instance( ).
    lr_fac = lr_core->get_entity_factory( 'BTOrder' ).
    *- get supported parameters for this object
    lt_params = lr_fac->get_parameter_table( ).
    *- Set the process Type
    READ TABLE lt_params ASSIGNING <line> WITH KEY name = 'PROCESS_TYPE'.
    <line>-value = '0010'.
    *- Create the BOL entity, based on parameters
    lr_ent = lr_fac->create( lt_params ).
    lr_ent = lr_ent->get_related_entity( 'BTOrderHeader' ).
    *- Lock order
    CHECK lr_ent->lock( ) = abap_true.
    It is an alternative way. Check if it helps you creating your Z-Object in the BOL root
    Kind regards,
    Garcia
    Edited by: Bruno Garcia on May 12, 2011 12:15 PM

  • 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 ())

  • 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

Maybe you are looking for

  • I have to register every time I open a CS6 program

    The just started last week. When ever I open CS6 the Adobe app manager opens and wants me to register it yet again. This often happens when I am not on the internet so have to pick the Trial button to work. What has changed and why do I have to keep

  • Label issue, if I gave like Novalue it is printing only is Novalue .

    Hi, i gave in graph label like <Novalue> in graph but its printing in report like Novalue>. it is ignoring <. I want to display completely <Novalue> in graph label. i.e <Label><xsl:value-of select="xdoxslt:ifelse(current-group()/ssReCode!='',ssReCode

  • Starting Managed Server using Node Manager Command Line

    Hi, I've configured the Node Manager and it is connected to the Admin Server without problem. Now I wanted to start the Managed Server through the console but it is failing and my guess is the command line used syntax is not correct. My question is,

  • Getting music back after formatting computer

    I am a music teacher and use iTunes for all my recorded music. Over the summer, my school upgraded our computers to WIndows 7. Is there a way to get my music back? I spent a ton of money on all of it and would hate for it to all be gone... I have it

  • Implementing your own SSL provider

    Hello, Im working on a new TLS/SSL implementations. I got all the classes(i.e. sslsocket, etc) ready. The problem i have is that i cant get my socketfactory using SSLFactory.getDefault, because when i do it an exception lang.runtime.exception:export