Dynamic create of attributes

Hello friends Can I create the attributes Dymanically and assign Values to it.
Ster

Not sure whether you have seen this document earlier..
If not look at this document & from page number 31 for dynamic field creation & binding.
[Dynamic Data biding|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/72d7ac11-0501-0010-63a2-cc6960569926]
Also [look at this thread|Dynamic Layout in BSP;
Raja

Similar Messages

  • How to set a value to a dynamically created node/attribute?

    Hi,
    I dynamically created attributes using the following method,
    IWDNodeInfo cbOptions = wdContext.getNodeInfo().addChild("cbOpt"+count, null, true, true, false, false, false, true, null, null, null);
    cbOptions.addAttribute("opt"+critEle.getQuest_Critid(), "ddic:com.sap.dictionary.string");
    How do i assign a  value to it now, since the node/attribute cannot be accessed via wdcontext?
    On a side note, it seems really troublesome if i need to use a checkbox grp(s) dynamically. I actually need to dynamically create a seperate node + attribute for each checkbox grp i have. Is there any better way to do this?
    Thanx in advance

    Hi
    Steps:
    1) Create the  action click is done statically (you cannot create action dyanmically)
    2) binding the  action click to checkbox dynamically 
    code
    public static void wdDoModifyView(IPrivateDynamicProgrammingView wdThis, IPrivateDynamicProgrammingView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
         if(firstTime){
                      IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
              IWDCheckBox checkBox=(IWDCheckBox)view.createElement(IWDCheckBox.class,"ck");
              IWDAction act=wdThis.wdCreateAction(IPrivateDynamicProgrammingView.WDActionEventHandler.CLICK,"");
              checkBox.setOnToggle(act);
              con.addChild(checkBox);
        //@@end
    Thanks and Regards,
    Arun

  • Dynamically created "alt" attribute not displaying

    Hi, I have created a details page for our company product, which is diplayed dynamically. I have on this page a dynamic image as well thats pulled from my database. As with any image on the web, I want to set the alt attribute, but of course this has to be dynamic as well. I have done this it seems, as I view my source code from a browser, I can see that the alt has a value there and that it is the correct value. My question is, why doesnt this display when I mouse over the image? Is there something I am forgetting to add? Is this attribute deprecated? here is my code for the alt cfoutput:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    <cfoutput>
              <table align="center">
                <tr>
                  <td><cfif rsDetails.image1 NEQ "">
                      <a href="images/#rsDetails.image1#" target="_blank"><img src="images/#rsDetails.image1#" alt="#rsDetails.item#" /></a>
                    </cfif></td>
                </tr>
              </table>
            </cfoutput>
    Here is the source code from the browser that shows there is an alt value:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    <table align="center">
        <tr>
           <td>
             <a href="images/60K19DL.jpg" target="_blank"><img src="images/60K19DL.jpg" alt="60K19/DL" /></a>
           </td>
        </tr>
    </table>
    I hope this is easy to understand without going into lengthy detail. Thanks for any help!

    Ok I understand what you're saying now. lol I did try my code without the <a> tag but still didn't work. SO thats kinda weird.
    However, until you pointed it out, I didn't realize his site didn't have the mouse tips in firefox or that other browsers didn't support it, so I guess its not that important after all...the tips I mean.
    I hate IE too! but unfortunately when dealing with an online wholesale site, I must use and develop for IE.
    Anyway, thanks for the help! I may try the title attribute, but I think as long as I have the alt for SEO then I am fine.

  • Adding f:Attribute dynamically to a dynamically created Button

    Hi ,
    I am trying to dynamically create a CommandButton and attach a f:Attribute to the same. But somehow I am not able to get hold of the correct API to do the same -
    >RichCommandButton button=new RichCommandButton();
    >button.setText("Ok");
    >AttributeTag attr=new AttributeTag();
    >attr.setValue("DC_OPERATION_BINDING", "bindings.DENY");
    >button.getChildren().add(attr);
    The issue is that the add method expects a UIComponent and attr is of type com.sun.faces.taglib.jsf_core.AttributeTag

    gues u can use it like
    button.getAttributes().put(DC_OPERATION_BINDING", "bindings.DENY");
    {code}
    http://docs.oracle.com/cd/E17802_01/j2ee/j2ee/javaserverfaces/1.2/docs/api/javax/faces/component/UIComponent.html#getAttributes%28%29                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Attribute Binding dynamically created fails validation

    Hello.
    In my taskflow I need to create both an Attribute Binding and a UIComponent (RichInputText), this is the code:
    DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding it = ADFUtils.findIterator("MyViewIterator");
    JUCtrlAttrsBinding nb = JUCtrlAttrsBinding.createAttributeBinding((JUFormBinding)dcBindings,null, "MyView", null, "MyViewIterator", "MyNewField");
    dcBindings.addControlBinding("MyNewField", nb);
    Then I create the RichInputText in a PanelFormLayout with his validator:
    *ValidatorTag.BindingValidator vb = new ValidatorTag.BindingValidator(null,JSFUtils.getValueExpression("#{bindings.MyNewField.validator}"));*
    *((UIXEditableValue)newRichInputText).addValidator(vb);*
    The problem is on the validator.
    I see the new InputText in my page and the value is right, but when I submit the field I see this error:
    "Unable to resolve a Validator instance using either validatorId '' or binding '#{bindings.MyNewField.validator}'."
    If I create the Attribute Binding at design time (in my PageDef) and I create dynamically the UIComponent with the validator, there is no problem!!!
    Why with the dynamic creation of the Attribute Binding, the validator doesn't works (the others bindings properties work perfectly) ?

    Use
    Checkbox.bindChecked("<<ValueAttributeName>>);
    or
    Checkbox.bindChecked("<<.ValueNode.ValueAttributeName>>);
    if the the attribute is inside a valuenode.
    Regards, Anilkumar

  • How to add a table (dynamic created) into a model attribute

    i have dynamically created an internal table. Generally i use model-binding in a stateful MVC-Application.
    Is there a possibiltity to transfer the dynamic table to a model. As far as i know generic attributes are not allowed in the modell class.
    Every hint welcome
    thx in advance

    By some miracle I do have this finally working.  I will warn you up front that the code is not the cleanest (I have stuff copied in from all over the place.  I probably have lots of unused variable references - but I am running out of time to clean it up further).  Also I don't have all the logic to support all your different possible dynamic structure types.  I always use SFLIGHT as my dyanmic structure.  Therefore you will have to adapt the coding to lookup the actual structure type in use.
    So I have a model that has an structure ITAB type ref to data.  In my Model initialization I go ahead and dynamically redfine this to my specific type:
    METHOD init.
      SELECT SINGLE * FROM sflight INTO CORRESPONDING FIELDS OF isflight.
      DATA: struct_type TYPE REF TO cl_abap_structdescr,
        tabletype TYPE REF TO cl_abap_tabledescr.
      struct_type ?= cl_abap_structdescr=>describe_by_name( 'SFLIGHT' ).
      CREATE DATA me->itab TYPE HANDLE struct_type.
    ENDMETHOD.
    Then in my View I have the following:
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="phtmlb" prefix="phtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
          <phtmlb:matrix width="100%" >
            <%
      field-symbols: <wa> type any.
      assign model->itab->* to <wa>.
    *  append initial line to <wa_itab> assigning <Wa>.
      data: descriptor type ref to CL_ABAP_STRUCTDESCR.
      descriptor ?= CL_ABAP_STRUCTDESCR=>describe_by_data( <wa> ).
      data: flddescr type DDFIELDS.
      flddescr = descriptor->GET_DDIC_FIELD_LIST( ).
      field-symbols: <wa_field> like line of flddescr.
      data: label type ref to cl_htmlb_label.
      data: input type ref to CL_HTMLB_INPUTFIELD.
      data: binding_string type string.
      "Loop through each field in the structure Definition
      loop at flddescr assigning <Wa_field>.
      clear label.
      clear input.
      concatenate '//model/itab.'
      <wa_field>-FIELDNAME
      into binding_string.
      label ?= cl_htmlb_label=>factory( _for = binding_string ).
      input ?= cl_htmlb_inputfield=>factory( _value = binding_string ).
            %>
            <phtmlb:matrixCell row    = "+1"
                               vAlign = "TOP" />
            <bsp:bee bee="<%= label %>" />
            <phtmlb:matrixCell col    = "+1"
                               vAlign = "TOP" />
            <bsp:bee bee="<%= input %>" />
            <%
      endloop.
            %>
          </phtmlb:matrix>
         <htmlb:button  id="Test" onClick="Test" text="Submit"/>
        </htmlb:form>
      </htmlb:page>
    The key to making this work are custom getter/setters.  In your model class, you can copy from the template methods (Like GETM_S_XYZ for the metadata structure method).  Copy them and remove the _ on the front of the name.  Then change XYZ to the name of the attribute you are binding for.  The following are my custom methods. 
    method get_m_s_itab .
    * uses ****************************************************************
    * data ****************************************************************
    * code ****************************************************************
    * method is supposed to return either info about a specific component
    * of a structure (component is not initial -> return ref to
    * if_bsp_metadata_simple) or the complete structure
    * (component is initial -> return ref to if_bsp_metadata_struct)
      data: l_attribute_ref type ref to data,
               l_attr_ref  type ref to data,
               l_exception     type ref to cx_root,
               l_ex            type ref to cx_sy_conversion_error,
               l_ex_bsp        type ref to cx_bsp_conversion_exception,
               l_ex2           type ref to cx_bsp_t100_exception,
               l_type          type i,
               l_index         type i,
               l_name          type string,
               l_component     type string,
               l_getter        type string.
      data: l_field_ref     type ref to data,
            l_dfies_wa      type dfies,
            rtti            type ref to cl_abap_elemdescr.
      data: crap type string,
              rest type string,
              t_index(10) type c.
      split attribute_path at '[' into crap rest.
      split rest           at ']' into t_index crap.
    ****Dummy Object to avoid dumps
      create object metadata type cl_bsp_metadata_simple
        exporting info = l_dfies_wa.
      call method if_bsp_model_util~disassemble_path
        exporting
          path      = attribute_path
        importing
          name      = l_name
          index     = l_index
          component = l_component
          type      = l_type.
      data: l_dataref type string.
    ****Dynamically determine your actual structure - for this demo
    ****I just hardcode SFLIGHT
      concatenate 'SFLIGHT-' l_component into l_dataref.
      data: field type ref to data.
    ****Create a data object of the specified type
      try.
          create data field type (l_dataref).
        catch cx_sy_create_data_error.
          exit.
      endtry.
      rtti ?= cl_abap_typedescr=>describe_by_data_ref( field ).
      l_dfies_wa = rtti->get_ddic_field( ).
      clear metadata.
      create object metadata type cl_bsp_metadata_simple
        exporting info = l_dfies_wa.
    endmethod.
    method get_s_itab .
    * uses ****************************************************************
    * data ****************************************************************
    * code ****************************************************************
    * get the given value of the component of the struct, e.g.
    *  field-symbols: <l_comp> type any.
    *  assign component component of structure XYZ to <l_comp>.
    *  value = <l_comp>.
      data: l_attr_ref  type ref to data,
              l_field_ref type ref to data.
      data: l_attribute_ref type ref to data,
            l_exception     type ref to cx_root,
            l_ex            type ref to cx_sy_conversion_error,
            l_ex2           type ref to cx_bsp_t100_exception,
            l_type          type i,
            l_index         type i,
            l_name          type string,
            l_component     type string,
            l_getter        type string,
            rtti            type ref to cl_abap_elemdescr.
      field-symbols: <o_data> type any,
                     <n_data> type any.
    *Test
    call method if_bsp_model_util~disassemble_path
        exporting
          path      = attribute_path
        importing
          name      = l_name
          index     = l_index
          component = l_component
          type      = l_type.
    * get a field reference for the assignment
      field-symbols: <wa> type any,
                     <l_comp> type any.
      assign me->itab->* to <wa>.
      assign component l_component of structure <wa> to <l_comp>.
      get reference of <l_comp> into l_field_ref.
    ****Dynamically determine your actual structure - for this demo
    ****I just hardcode SFLIGHT
      data: l_dataref type string.
      concatenate 'SFLIGHT-' l_component into l_dataref.
      data: field type ref to data.
    ****Create a data object of the specified type
      try.
          create data field type (l_dataref).
        catch cx_sy_create_data_error.
          exit.
      endtry.
      assign l_field_ref->* to <o_data>.
      assign field->*       to <n_data>.
      move <o_data> to <n_data>.
    * call conversion routine
      try.
          value = if_bsp_model_util~convert_to_string(
            data_ref           = field
            attribute_path     = attribute_path
            no_conversion_exit = 0 ).
        catch cx_sy_conversion_error into l_ex.
          me->errors->add_message_from_exception(
              condition = attribute_path
              exception = l_ex
              dummy     = value ).
        catch cx_bsp_t100_exception into l_ex2.
          me->errors->add_message_from_t100(
            condition = attribute_path
            msgid     = l_ex2->msgid
            msgno     = l_ex2->msgno
            msgty     = l_ex2->msgty
            p1        = l_ex2->msgv1
            p2        = l_ex2->msgv2
            p3        = l_ex2->msgv3
            p4        = l_ex2->msgv4
            dummy     = value ).
      endtry.
    endmethod.
    method set_s_itab .
    * uses ****************************************************************
    * data ****************************************************************
    * code ****************************************************************
    * assign the given value to the component of the struct, e.g.
    *  field-symbols: <l_comp> type any.
    *  assign component component of structure XYZ to <l_comp>.
    *  <l_comp> = value.
      data: l_attr_ref  type ref to data,
               l_field_ref type ref to data.
      data: l_attribute_ref type ref to data,
            l_exception     type ref to cx_root,
            l_ex            type ref to cx_sy_conversion_error,
            l_ex_bsp        type ref to cx_bsp_conversion_exception,
            l_ex2           type ref to cx_bsp_t100_exception,
            l_type          type i,
            l_index         type i,
            l_name          type string,
            l_component     type string,
            l_getter        type string,
            rtti            type ref to cl_abap_elemdescr.
      field-symbols: <o_data> type any,
                     <n_data> type any.
    *Test
      call method if_bsp_model_util~disassemble_path
        exporting
          path      = attribute_path
        importing
          name      = l_name
          index     = l_index
          component = l_component
          type      = l_type.
    * get a field reference for the assignment
      field-symbols: <wa> type any,
                     <l_comp> type any.
      assign me->itab->* to <wa>.
      assign component l_component of structure <wa> to <l_comp>.
      get reference of <l_comp> into l_field_ref.
    ****Dynamically determine your actual structure - for this demo
    ****I just hardcode SFLIGHT
      data: l_dataref type string.
      concatenate 'SFLIGHT-' l_component into l_dataref.
      data: field type ref to data.
    ****Create a data object of the specified type
      try.
          create data field type (l_dataref).
        catch cx_sy_create_data_error.
          exit.
      endtry.
      assign field->*       to <n_data>.
      move <l_comp> to <n_data>.
    * call conversion routine
      try.
          if_bsp_model_util~convert_from_string(
                               data_ref           = field
                               value              = value
                               attribute_path     = attribute_path
                               use_bsp_exceptions = abap_true
                               no_conversion_exit = 0 ).
        catch cx_sy_conversion_error into l_ex.
          me->errors->add_message_from_exception(
              condition = attribute_path
              exception = l_ex
              dummy     = value ).
        catch cx_bsp_conversion_exception into l_ex_bsp.
          me->errors->add_message_from_exception(
              condition = attribute_path
              exception = l_ex_bsp
              dummy     = value ).
        catch cx_bsp_t100_exception into l_ex2.
          me->errors->add_message_from_t100(
            condition = attribute_path
            msgid     = l_ex2->msgid
            msgno     = l_ex2->msgno
            msgty     = l_ex2->msgty
            p1        = l_ex2->msgv1
            p2        = l_ex2->msgv2
            p3        = l_ex2->msgv3
            p4        = l_ex2->msgv4
            dummy     = value ).
      endtry.
      if <n_data> is initial.
        clear <l_comp>.
      else.
        move <n_data> to <l_comp>.
      endif.
    endmethod.
    I know that is a LOT of nasty code without too much explanation.  I'm afriad there isn't time right now to expand on how it works too much.  Between my day job and trying to finish the BSP book, there just isn't much time left.  Like I said before there is a very large section in the book on this topic that hopefully explains it.  The book will be out in December or early January - but perhaps I will get some time before then to write up something on SDN about this.

  • Dynamically create document type Item Attribute using WF_ENGINE.AddItem API

    Hi
    Is WF_ENGINE.AddItem API , supported to create document type Item attributes dynamically ? If yes how do we set the display name of the attribute. If no then is there is any other method to dynamically create document tyoe item attribute?
    Thanks

    Hi,
    If the document is stored on a file system, then I would replace the message body with a PL/SQL document which includes links to the files as straightforward URLs. There would be no need to include them in the Workflow in any way. For example, I recently worked with a client where all the (file) attachments made within eBusiness Suite were then migrated into Oracle Universal Content Management and the attachment was replaced with a URL to the new document. Any notifications now just reference the URL link to the document within the document management system in an HTML notification. While the processing is going on, the user is given the list of files that exist as attachments, but no links because the document is being processed by the management system.
    If the attachments are going to be stored in Workflow as documents, you won't be able to change the display name though - display name is set for the attribute on the message, not for each specific notification. Changing the value of the display name for the message would impact all notifications that use that message, which isn't what you want.
    What you need is to dynamically build the notification (either using PL/SQL or OA Framework) and include a list of attachments in the notification. This may be a direct link to the document (either in a document management system or on a file system somewhere) that you can render as a URL, or a link to code that can retrieve the document from the database and serve that to the user. This is not a straightforward piece of work.
    If this is purely internal, you might be better off having a custom form / screen which displays the different documents, and link to that from the notification. Or you could link to a standard form for the transaction and have the users pick up the attachments directly from the transaction.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • How to access a dynamic created attribute in a context node?

    <i>Hello,</i>
    <i>who could help? I can't set a value for a dynamically created attribute which is bind to a table.</i>
    <i>My context of the view looks as follow (is defined in NetWeaver):</i>
      - Context
         - Availability (Node)
             - vctxService (Attribute)
             - vctxServiceDesc (Attribute)
             - ... (further predefined attributes)
             - ... (some have to be set dynamically as follows)
    <i>Then I have added attributes dynamically in the wdDoModifyView(...) - method, as follows:</i>
    for (int i = 0; i < max; i++) {
       // some code to dynamically create table columns
       // adding attributes dynamically
       IWDAttributeInfo attrInfo =       wdContext.nodeAvailability().getNodeInfo().      addAttribute("vctxAvailability_" + i, "ddic:com.sap.dictionary.string");
       tv.bindText(attrInfo); // bind to TextView in table
    <i>In the method onPlugFrom... I tried to set the values for the attributes "vctxAvailability_ + i" as follows:</i>
    for (int i = 0; i < max; i++) {
       IAvailabilityElement newAvailNodeElement =     wdContext.createAvailabilityElement();
       // some values will be set for the
       // predefined attributes of AvailabilityNode
       // newAvailNodeElement.set...( value );
       // newAvailNodeElement.setVctxService( xy.getServ() );
       // now the values of dynamically created and added
       // attributes in AvailabilityNode will be added
       // THIS DOESN'T WORK
       newAvailNodeElement.setAttributeValue    ("vctxAvailability_" + i, "value" + i);
    <i>It would be great if someone could help me.
    Thanks in advance.
    Kind regards,
    Carsten</i>

    Carsten,
    Here is a sample code that creates context attributes dynamically and also sets values:
    //Creates a node
    IWDNodeInfo nodeInfo = wdContext.wdGetAPI().getRootNodeInfo().addChild("TestNode", null, true, true, false, true, false, true, null, null, null);
    //If you want to bind the node to a model node then the
    //second argument to the above method should be the
    //model class.
    //Creates an attribute under the node just created.
    IWDAttributeInfo testAttrib = wdContext.wdGetAPI().getRootNodeInfo().getChild("TestNode").addAttribute("testAttrib", "ddic:com.sap.dictionary.string");
    IWDNodeElement testNode = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION).getCurrentElement();
    IWDNode testNode2 = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION);
    //Now you can bind testNode with the Model Node
    //You can also set a value to the newly created attribute
    testNode.setAttributeValue("testAttrib", new String("Value"));
    Hope this helps.
    Shakeel

  • Modify dynamically created attributes.

    Hi,
    I have created dynamically many check boxes based on a sql query result.
    I have created also a dynamic node with many attributes to make the binding to my check_boxes.
    I want know to acces my check_boxes to perform action : check, uncheck ...
    how can i proceed?
    Thanks.

    Hi ,
    try getting the IF_WD_CONTEXT_NODE_INFO instance for the node.
    DATA : lo_node_info TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
    my_node->GET_NODE_INFO().
    IF_WD_CONTEXT_NODE_INFO has a method GET_ATTRIBUTES().
    Which returns a table of type WDR_CONTEXT_ATTR_INFO_MAP.
    The line type of this table is WDR_CONTEXT_ATTRIBUTE_INFO.
    This structure has fields like name and all the properties of the attribute.
    Check if this method could help you out.
    Although I cannot guarantee if this method works for dynamic nodes and attributes.
    But worth a try.
    Thanks,
    Aditya.

  • ABAP OBJECTS: Dynamic Create object

    Hi folks!
    I have a problem... I need to create a dynamic type object with:
    <b>DATA: my_instance TYPE REF TO class1.
    CREATE OBJECT my_instance TYPE (class2).</b>
    <i>* where class1 is a superclass of class2.</i>
    When I do:
    <b>my_instance ?= m_parent.</b>
    <i>* where m_parent is an instance of class1</i>
    My problem is when I want to access to an attribute of the class2, the compiler says that it cannot find the attribute <i>(this is OK, because the attribute is only in the class2).</i>
    My question:
    Is there anyway to access to an atribute of second class when is not in the first class? (i don't want to create the attribute as an attribute of the first class).
    Thanx!!!!

    Hi David,
    When you do the debugging, you are dealing with run-time - i.e., the program is now running and you are just interrupting it at each statement to examine the program state. You will reach the point where the object is already created. That is why you can see all those attributes. But when you comiple, the program is not yet <i>running</i>, so the attributes will be unknown because of the dynamic type specification.
    I think you will have to redesign the program logic. As i had already said in my earlier post, it is not proper to have the attributes specified statically while the class itself is specified dynamically.
    Your situation is somewhat similar to -
    DATA ITAB TYPE TABLE OF SPFLI.
    PERFORM TEST TABLES ITAB.
    FORM TEST TABLES ITAB.
      LOOP AT ITAB.
        WRITE: / ITAB-CARRID.
      ENDLOOP.
    ENDFORM.
    Hope the point is clear.
    Regards,
    Anand Mandalika.

  • Adding AJAX support for dynamically created panelGrid components

    Hi everyone!
    I would like to ask help from anyone who may have encountered similar problem before...
    I have a panelGrid whose component is dynamically created by the backing bean. Here is my JSF code:
    <h:panelGrid styleClass="panelGrid"
              rowClasses="tsPanelGridRowClass" columns="8" cellpadding="0"
              cellspacing="2" bgcolor="transparent" style="margin-left: 10px"
              id="revCenterItemPanelGrid"
              binding="#{pc_Touchscreen_pull_select_item.revCenterItemPanelGrid}">
    </h:panelGrid>And here is the code for backing bean that adds content inside the panelGrid:
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("1");
    index.setValue(String.valueOf(1));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);On click of a button...
    <a4j:commandButton value="Update"
              styleClass="commandExButtonPou2" id="button1" reRender="revCenterItemPanelGrid"
              actionListener="#{pc_Touchscreen_pull_select_item.doSortActionListener2}">
              <f:attribute name="order" value="2"></f:attribute>
              <f:attribute name="toggleState" value="off"></f:attribute>
    </a4j:commandButton>the backing bean is supposed to update the value of the outputText
    doSortActionListener2() {
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("2");
    index.setValue(String.valueOf(2));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);
    }However, update doesn't seem to work. I have been successful in adding ajax support to a panelGrid that is not dynamically created but not for this one.
    Has anyone encountered this error before? Any ideas?
    Thanks in advance!

    Hi everyone!
    I would like to ask help from anyone who may have encountered similar problem before...
    I have a panelGrid whose component is dynamically created by the backing bean. Here is my JSF code:
    <h:panelGrid styleClass="panelGrid"
              rowClasses="tsPanelGridRowClass" columns="8" cellpadding="0"
              cellspacing="2" bgcolor="transparent" style="margin-left: 10px"
              id="revCenterItemPanelGrid"
              binding="#{pc_Touchscreen_pull_select_item.revCenterItemPanelGrid}">
    </h:panelGrid>And here is the code for backing bean that adds content inside the panelGrid:
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("1");
    index.setValue(String.valueOf(1));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);On click of a button...
    <a4j:commandButton value="Update"
              styleClass="commandExButtonPou2" id="button1" reRender="revCenterItemPanelGrid"
              actionListener="#{pc_Touchscreen_pull_select_item.doSortActionListener2}">
              <f:attribute name="order" value="2"></f:attribute>
              <f:attribute name="toggleState" value="off"></f:attribute>
    </a4j:commandButton>the backing bean is supposed to update the value of the outputText
    doSortActionListener2() {
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("2");
    index.setValue(String.valueOf(2));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);
    }However, update doesn't seem to work. I have been successful in adding ajax support to a panelGrid that is not dynamically created but not for this one.
    Has anyone encountered this error before? Any ideas?
    Thanks in advance!

  • How get context value form a dynamic created node

    Hi all,
    I have build my own dynamic view. In this view I use also a dynamic created Node. When I have more rows in my Node I see every row with context of the last row of the dynamic Node.
    this is the source I use.
    for (int x = 0; x < dynTabNode.size(); x++)
      dynTabNode.setLeadSelection(x);
      IWDGroup group = (IWDGroup)view.getElement("Group_name");
      IWDAttributeInfo aiName = wdContext.getChildNode("DayNode", IWDNode.LEAD_SELECTION).getNodeInfo().getAttribute("Name");
      IWDCaption name = (IWDCaption) view.createElement(IWDCaption.class, null);
      name.bindText(aiName);
      group.addChild(name);
      for (int i = 8; i < 18; i++)
        int teller = i * 100;
        IWDGroup group1 = (IWDGroup)view.getElement("hour" + teller);
        for (int z = 0; z < 12; z++)
          IWDImage image = (IWDImage) view.createElement(IWDImage.class, "Image" + teller + "_" + x);
          image.setWidth("10");
          image.setHeight("24px");
          image.setBorder(0);
          IWDAttributeInfo att = dynTabNode.getNodeInfo().getAttribute("hour" + teller);
          image.bindSource(att);
          group1.addChild(image);
          teller = teller + 5;
    How can I read my Node row for row?
    Richard
    Edited by: Armin Reichert on Jul 28, 2008 5:03 PM

    The reason is that all these Caption UI elements are bound against the same context attribute. At runtime this will be resolved to the attribute value of the lead-selected node element. In this example you can fix this by not binding the "text" property but setting it to the attribute value of the iterated node element:
    for (int x = 0; x < dynTabNode.size(); x++)
      dynTabNode.setLeadSelection(x);
      IWDGroup group = (IWDGroup)view.getElement("Group_name");
      IWDCaption name = (IWDCaption) view.createElement(IWDCaption.class, null);
      IWDNode dayNode = wdContext.getChildNode("DayNode", IWDNode.LEAD_SELECTION);
      String text = (String) dayNode.getElementAt(x).getAttributeValue("Name");
      name.setText(text);
      IWDAttributeInfo aiName = dayNode.getNodeInfo().getAttribute("Name");
      name.bindText(aiName);
      group.addChild(name);
    (I assume here that the node "DayNode" has the same size as dynTabNode. No idea if this assumption is correct)
    But this would not help for editable elements where you need to bind the edited property.
    Armin

  • Dynamic creating SAPBobsCOM objects using reflection

    Hi All,
    I'm writing a tool (C#) for SBO for exporting object (oItems, oBanks etc.) to XML files. And I have a problem how to dynamically create object by it's string description. I'm trying to create it using System.Reflection, but cant't find right way to create it.
    It must be like that, but it doesn't work:
               Type  sboObject = System.Type.GetType("SAPbobsCOM.Items, Interop.SAPbobsCOM", true, true);
               object ibaseObject = Activator.CreateInstance(sboObject);
    Any ideas?)

    Hi
    I've writen this code for instantiating DI API objects using .NET reflection
            private object getObjectBo(int tipo) //tipo: integer representing the object type
                object o = null;
                try
                    Type tipoComp = kernel.Company.GetType(); //Type SAPbobsCOM.Company
                    MethodInfo info = tipoComp.GetMethod("GetBusinessObject");
                    object[] parametros = new object[1]; //Parameters of GetBusinessObject
                    object tipoObj = Enum.ToObject(typeof(SAPbobsCOM.BoObjectTypes), tipo);
                    parametros[0] = tipoObj;
                    o = info.Invoke(kernel.Company, parametros);  //Calling GetBusinessObject           
                catch (Exception ex)
                    kernel.Application.MessageBox(ex.Message, 0, "", "", "");
                return o;
    The object returned is COM object (not managed code) then we can't use .NET reflection directly for exploring its methods and attributes .. I think we should use C++ and IDispatch interface, but i don't know how do this yet.
    Hope it helps.
    Regards

  • Dynamically Create Repeater Element in ActionScript

    Hi,
    I'm trying to dynamically create a repeater control with an
    image and a label control. I can do it directly in the MXML file
    but when I try and covert it into ActionScript it's not working.
    Can anyone see what the problem is with my code?
    public function GetPalettes():void{
    removeChild(document.FrontPage);
    Palettes.method = "GET";
    params = {"method": "GetPalettes", "BodyPartNo":
    document.PalettesMenu.selectedItem.@partNo};
    Palettes.cancel();
    Palettes.send(params);
    var VerticalBox:VBox = new VBox();
    VerticalBox.x = 10;
    VerticalBox.y = 10;
    VerticalBox.id = "VerticalBox";
    var PaletteRepeater:Repeater = new Repeater();
    PaletteRepeater.dataProvider =
    "{Palettes.lastResult.Palette}";
    PaletteRepeater.startingIndex = 0;
    PaletteRepeater.id = "PaletteRepeater";
    var PaletteImage:Image = new Image();
    PaletteImage.setStyle("HorizontalAlign", "left");
    PaletteImage.source = "
    http://localhost/Flex/Personalised%20Palettes-debug/{PaletteRepeater.currentItem.@PictureS rc}Med.png";
    PaletteImage.useHandCursor = true;
    PaletteImage.buttonMode = true;
    PaletteImage.mouseChildren = false;
    PaletteImage.id = "PaletteImage";
    var PaletteDescription:Label = new Label();
    PaletteDescription.text =
    "{PaletteRepeater.currentItem.@Description}";
    PaletteDescription.id = "PaletteDescription";
    document.MainPage.addChild(VerticalBox);
    VerticalBox.addChild(PaletteRepeater);
    PaletteRepeater.addChild(PaletteImage);
    PaletteRepeater.addChild(PaletteDescription);
    Thanks

    "katychapman85" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hey Amy,
    >
    > I've put a thread up about this but thought I'd ask you
    as well as you've
    > been
    > a great help to me so far.
    >
    > I have this function:
    > public function GetOptions(Menu:int):void{
    > document.MenuOptions.url =
    > "
    http://localhost/Flex/Personalised%20Palettes-debug/MenuOptions.php?Menu=";
    > document.MenuOptions.url += Menu;
    > document.MenuOptions.send();
    > }
    >
    > What I'm trying to do is when a user clicks on a Radio
    button this
    > function is
    > called and the number of the Menu required is sent to
    the function.
    >
    > I've added this Event Listener to my Radio Button:
    >
    >
    document.RadioButtons2.addEventListener(MouseEvent.CLICK,
    > function():void{GetOptions(2);});
    >
    > However, it's not working. Everything I've read suggests
    using an
    > anonymous
    > function in the Event Listener to pass the menu
    parameter but for some
    > reason
    > it's not working.
    What version of Flex are you using? The Help for Flex 3 has
    this to say:
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=events_05.html
    Defining event listeners inline
    The simplest method of defining event handlers in Flex
    applications is to
    point to a handler function in the component's MXML tag. To
    do this, you add
    any of the component's events as a tag attribute followed by
    an ActionScript
    statement or function call.
    You add an event handler inline using the following syntax:
    <mx:tag_name event_name="handler_function"/>
    For example, to listen for a Button control's click event,
    you add a
    statement in the <mx:Button> tag's click attribute. If
    you add a function,
    you define that function in an ActionScript block. The
    following example
    defines the submitForm() function as the handler for the
    Button control's
    click event:
    <mx:Script><![CDATA[
    function submitForm():void {
    // Do something.
    ]]></mx:Script>
    <mx:Button label="Submit" click="submitForm();"/>
    Event handlers can include any valid ActionScript code,
    including code that
    calls global functions or sets a component property to the
    return value. The
    following example calls the trace() global function:
    <mx:Button label="Get Ver" click="trace('The button was
    clicked');"/>
    There is one special parameter that you can pass in an inline
    event handler
    definition: the event parameter. If you add the event keyword
    as a
    parameter, Flex passes the Event object and inside the
    handler function, you
    can then access all the properties of the Event object.
    The following example passes the Event object to the
    submitForm() handler
    function and specifies it as type MouseEvent:
    <?xml version="1.0"?>
    <!-- events/MouseEventHandler.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import mx.controls.Alert;
    private function myEventHandler(event:MouseEvent):void {
    // Do something with the MouseEvent object.
    Alert.show("An event of type '" + event.type + "'
    occurred.");
    ]]></mx:Script>
    <mx:Button id="b1" label="Click Me"
    click="myEventHandler(event)"/>
    </mx:Application>
    It is best practice to include the event keyword when you
    define all inline
    event listeners and to specify the most stringent Event
    object type in the
    resulting listener function (for example, specify MouseEvent
    instead of
    Event).
    You can use the Event object to access a reference to the
    target object (the
    object that dispatched the event), the type of event (for
    example, click),
    or other relevant properties, such as the row number and
    value in a
    list-based control. You can also use the Event object to
    access methods and
    properties of the target component, or the component that
    dispatched the
    event.
    Although you will most often pass the entire Event object to
    an event
    listener, you can just pass individual properties, as the
    following example
    shows:
    <?xml version="1.0"?>
    <!-- events/PropertyHandler.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import mx.controls.Alert;
    private function myEventHandler(s:String):void {
    Alert.show("Current Target: " + s);
    ]]></mx:Script>
    <mx:Button id="b1" label="Click Me"
    click="myEventHandler(event.currentTarget.id)"/>
    </mx:Application>
    Registering an event listener inline provides less
    flexibility than using
    the addEventListener() method to register event listeners.
    The drawbacks are
    that you cannot set the useCapture or priority properties on
    the Event
    object and that you cannot remove the listener once you add
    it.
    don't see anything in there about anonymous functions...?

  • How to delete Dynamically created input field UI Element

    Hi all,
              I want to delete dynamically created input field and label.
    Is there any method please tell.
    Thanks in advance
    Hemalatha

    Hi,
    In the WDEVENT parameter of the action handler you can find the event id.
    ***Variables
      DATA:
        lv_selected  type string.          "Selected tab value
    ***Structure and internal table for the Events and messages
      DATA:
        lt_events type WDR_EVENT_PARAMETER_LIST,
        ls_events type WDR_EVENT_PARAMETER.
    ***Field symbols
      field-symbols: <fs_value> type any.   "Attribute value in events table
    ***Move the event table to lt_events
      lt_events = wdevent->parameters.
      read table  lt_events into ls_events with key name = 'SAVE'.  "Button Id
      if sy-subrc eq 0.
        assign ls_events-value->* to <fs_value>.
        if sy-subrc eq 0.
          lv_selected  = <fs_value>.
        endif.                 "IF sy-subrc eq 0.
      endif.                 "IF sy-subrc eq 0.
    Regards,
    Lekha.

Maybe you are looking for

  • Document attachment in SAP

    Hello Everybody , We are hainvg SAP on DB2 and AS/400 I have a quesetion regarding attachmenet done in SAP . 1. Where the documents are stored in SAP ? 2. Are all documents are stored in single file or database table ? 3. How can we delete them ? Tha

  • How can I see the windows 8 contacts in outlook 2013 with groups preserved

    I an see my windows 8 contacts. they are all nice and some are broken down into groups. (I double clicked an old .wab and they imported nicely into windows 8, preserving groups) now how can I see this same structure as an email lists with groups in o

  • 6120c delay when answering a call with bluetooth h...

    Hi, I have a Nokia 6120 classic and a Jabra BT2010 headset. When using the headset, every time I answer a call I have a 3 second delay until I can hear anything. During these 3 seconds I hear 3 beeps: one the moment I answer the phone, a second one a

  • 2 Filled Sonnet Fusion 500P enclosures; RAID 0/1, or RAID 5?

    I currently have a Sonnet Fusion 500P loaded with 5 WD 500GB RE2 drives; all running individually and not RAIDed; this box is connected to a Sonnet Tempo E2P in my MacPro. I'm interested in getting a 2nd identical enclosure and drives, and creating a

  • I am having difficulty printing from photoshop.

    I set it to "photoshop controls colors", but get a warning, "ColorSync color matching may produce different results than printer color management. Either Photoshop color management or printer color management is recommended." Then the picture prints