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.

Similar Messages

  • 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

  • How to delete dynamically created attribute

    Hi,
      I am creating table dynamically according to no of columns. first time its displaying correctly, second time once i changed the no of columns its throwing error message like:
    com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(DynamicView.TableNode): duplicate name for attribute name0.
    Everytime before creating table i tried  following commands.
    table.removeAllColumns();
    but still i am getting error.
    Help me out in this....
    Regards
    Suresh KB

    hi suresh
    table.removeAllColumns();
    will remove all the columns from the view.
    but when u create the context attributes they are already existing. So it is giving the duplicate context exception.
    To solve this problem, first delete all the attributes created dynamically. using below code.
    wdcontext.node<urnode>().reset(<b>False</b>).
    it will delete all the attrbutes created at runtime.
    to delete attrbutes created at designtime use.
    wdcontext.node<urnode>().reset(<b>True</b>).
    Regards
    Brahmanandam.A
    collections created at design time will be preserved.  All dynamically
    added nodes and attributes are destroyed from the metadata.<p>
    Calling reset(true) is functionally equivalent to calling reset().<p>

  • How to bind dynamically created attributes

    Hi all,
    i hv created an appl where all the attributes hv been created dynamically..
    wdContext.getNodeInfo().addAttribute("From","ddic:com.sap.dictionary.string");
        wdContext.getNodeInfo().addAttribute("To","ddic:com.sap.dictionary.string");
        wdContext.getNodeInfo().addAttribute("Subject","ddic:com.sap.dictionary.string");
        wdContext.getNodeInfo().addAttribute("Message","ddic:com.sap.dictionary.string");
    bt nw i am nt able to retrieve those.
    For ex: if i hv to set the from field to null ,hw to do so?
    (   As we used  to get it:
      wdcontext.currentContextElement().setFrom(" ");
    Plz help.
    Thanks and Regards,
    Ankita
    Edited by: Ankita Padhi on Jul 14, 2008 8:48 AM

    Hi,
    here i m giving code for your reference of a dynamic checkbox:
    IWDCheckBox checkBox =
    (IWDCheckBox) view.createElement(IWDCheckBox.class,
                                  "checkBox" + count);
    IWDMatrixHeadData checkHeadData =
    (IWDMatrixHeadData) checkBox.createLayoutData(
                                  IWDMatrixHeadData.class);
    IWDAttributeInfo attrInfo;
    info=               wdContext.nodeCheckBox().getNodeInfo().addAttribute(
         "Check" + count,          "ddic:com.sap.dictionary.boolean");
                        checkHeadData.setVAlign(WDCellVAlign.TOP);
    checkHeadData.setWidth("6%");
    checkHeadData.setColSpan(1);
    this line used to bind the context to the element:-
    checkBox.bindChecked(info);
    checkBox.setEnabled(true);
    TitleRow.addChild(checkBox);
    Hope this may help you.
    Regards,
    Deepak
    Edited by: Deepak Arora on Jul 14, 2008 9:09 AM

  • Reg  : Accessing dynamically created attribute

    Hi All,
             I had created a dynamic node ("demo") and added two attributes ("appid" & "apptext") to it. And also i created three elements for that node and binded the values. Now my dynamic node is having 3 records. I am creating link to action dynamically and binded a action called "onClick". Now in the output i am getting
    linktoaction1
    linktoaction2
    linktoaction3
    Now i am stuck with, when i am clicking either of these 3 linktoactions in runtime, i am able to get only the first record. May i know how to traverse through the node. i.e on clicking of linktoaction2 i want to fetch second records of the node and simillarly and linktoaction1 and linktoaction2. I used the following code in "onClick"
    IWDNode dynnode = wdContext.currentContextElement().node().getChildNode      ("demo",IWDNode.LEAD_SELECTION);
    IWDNodeElement ele = dynnode.getCurrentElement();
    String text = (String)ele.getAttributeValue("Apptext");
    wdComponentAPI.getMessageManager().reportSuccess(text);
    Thanks,
    Mugundhan.

    Hi Nikil,
    Ya i had assigned only one action for the three linktoactions. I am filling my dynamic node according to the number of records coming from the RFC. How can i pass the index value (i.e) how to identify that which action is being clicked. I am little confused. Thia is what i wrote in my coding,
    In Init method,
    IWDNodeInfo nodeInfo=wdContext.getNodeInfo().addChild("demo", null,true,true,
    true,false,false,true,null,null,null);
    nodeInfo.addAttribute("Applid", "com.sap.dictionary.string");
    nodeInfo.addAttribute("Apptext", "com.sap.dictionary.string");
    IWDNode node = wdContext.wdGetAPI().getRootNode().getChildNode("demo",IWDNode.NO_SELECTION);
      for(int i=0; i<wdContext.nodeEt_Mobileportal().size();i++)
         IWDNodeElement nodeElem = node.createElement();
         nodeElem.setAttributeValue("Applid", wdContext.nodeEt_data().getEt_dataElementAt(i).getApplid());
         nodeElem.setAttributeValue("Apptext", wdContext.nodeEt_data().getEt_dataElementAt(i).getApptext());
         node.addElement(nodeElem);
    In domodify method,
        if(firstTime)
           IWDTransparentContainer cont= (IWDTransparentContainer)view.getElement("menu");          
           for( int i=0; i<wdContext.nodeEt_Mobileportal().size(); i++)
           IWDLinkToAction link  = (IWDLinkToAction)view.createElement(IWDLinkToAction.class,"link"+i);
                  link.setText(wdContext.nodeEt_Mobileportal().getEt_MobileportalElementAt(i).getApptext());
           link.setOnAction(wdThis.wdGetGotoappAction());                    
           cont.addChild(link);
    Thanks,
    Mugundhan

  • 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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • 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

  • Script to modify the location attribute in an existing subnet registered on AD sites

    Could anyone help me to make an script to modify the location attribute in an existing subnet registered on AD sites and services.
    Using the script to create subnet, like this one below, occurs error because the subnet already exist:
     Set objRootDSE = GetObject("LDAP://RootDSE")
      strConfigurationNC = objRootDSE.Get("configurationNamingContext")
      strSiteObjectDN = strSiteObjectRDN & ",cn=Sites," & strConfigurationNC
      strSubnetsContainer = "LDAP://cn=Subnets,cn=Sites," & strConfigurationNC
      '-- Create Subnet --
      Set objSubnetsContainer = GetObject(strSubnetsContainer)
      Set objSubnet = objSubnetsContainer.***MODIFY/UPDATE***("subnet", strSubnetRDN)
      objSubnet.Put "siteObject", strSiteObjectDN
      objSubnet.Put "description", strDescription
      objSubnet.Put "location", strLocation
      objSubnet.SetInfo
    Thanks,

    Just get the subnet by name:
    subnet = "192.168.1.0\/24"
    Set objRootDSE = GetObject("LDAP://RootDSE")
    strConfigurationNC = objRootDSE.Get("configurationNamingContext")
    strSiteObjectDN = strSiteObjectRDN & ",cn=Sites," & strConfigurationNC
    strSubnet = "LDAP://CN=" & subnet & ",cn=Subnets,cn=Sites," & strConfigurationNC
    Set objSubnet = GetObject(strSubnet)
    objSubnet.Put "description", strDescription
    objSubnet.Put "location", strLocation
    objSubnet.SetInfo
    ¯\_(ツ)_/¯

  • Appending values to dynamically created fieldsymbol

    Hi ,
    I have a requirement to append values to dynamically created fieldsymbols
    from internal table   .
    I am using the following code but it dosnt work
    <F4> declared as line of <dyn_table>.
    loop at it_tab into wa_tab .( this contain the data to be appended to dyn fieldsymbol)
    loop at it_fieldcat into wa_fieldcat. ( this contains the fieldnames )
    case wa_final_fieldcat-FIELDNAME.
    when 'AAA'.
    v_field_name = 'AAA.
    when 'BBB'.
    v_field_name = 'BBB'.
    endcase.
    ASSIGN COMPONENT v_field_name of STRUCTURE wa_tab to <F4>.
    endloop.
    append <f4> to <dyn_table>
    ********************************************8
    But only get one value i.e field BBB  value appended to
    <dyn_table>.
    is there any way i can do the append to field symbol looping through internal
    table ?
    thanks
    raj

    i done it in alv so take the part you need .
    1) to create dynamic table  :  CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    also create dynamic fieldcatalog .
    2) you can pull data just one time from the DB to dynamic table
    so i take the data in regulare it table and in the and i put it
    in the dynamic table
    hope i help  , if you didnt understand some part  , say so  .
      DATA  : LT_FCAT   TYPE LVC_T_FCAT  ,
             lo_struct TYPE REF TO data,
               LV_STRUC_NAME TYPE TABNAME VALUE 'YMM_ST_TNUOT_MLY'.
    REFRESH ls_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          I_STRUCTURE_NAME       = LV_STRUC_NAME
          I_BYPASSING_BUFFER     = 'X'
        CHANGING
          CT_FIELDCAT            = IT_COLUM_HEADER
        EXCEPTIONS
          INCONSISTENT_INTERFACE = 1
          PROGRAM_ERROR          = 2
          OTHERS                 = 3.
      IF SY-SUBRC <> 0.
       MESSAGE e402(mo) WITH lv_struc_name.
        EXIT.
      ENDIF.
      DATA INDX(3) .
      IF G_COUNETR_NUMBER_OF_KOSTL > 0 .
        DO G_COUNETR_NUMBER_OF_KOSTL TIMES.
          INDX = SY-INDEX.
          SHIFT INDX LEFT DELETING LEADING SPACE.
          CONCATENATE 'KOSTL' INDX INTO LS_FCAT-FIELDNAME.
          LS_FCAT-INTTYPE    = 'I'.
          LS_FCAT-COL_POS =  27 +  SY-INDEX .
          CONCATENATE TEXT-028    INDX INTO LS_FCAT-COLTEXT.
          LS_FCAT-OUTPUTLEN = 10.
          APPEND LS_FCAT TO IT_COLUM_HEADER.
        ENDDO.
      ENDIF.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG           = IT_COLUM_HEADER
        IMPORTING
          EP_TABLE                  = GT_TABLE
        EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          OTHERS                    = 2.
      ASSIGN GT_TABLE->* TO <DYN_TABLE>.
    *--> Arbeitsbereich dynamisch erzeugen
      CREATE DATA LO_STRUCT LIKE LINE OF <DYN_TABLE>.
      ASSIGN LO_STRUCT->* TO <WA>.
      LOOP AT IT_COLUM_HEADER INTO LS_FCAT.
        IF LS_FCAT-FIELDNAME NE 'MANDT'.
          ADD 1 TO LS_FCAT-COL_POS.
          PERFORM TRANSLATE_HEADER.
          MODIFY IT_COLUM_HEADER FROM LS_FCAT.
        ENDIF.
      ENDLOOP.
    =============   assigning to dynamic table
    DATA  : FIELD(10)   ,
               INDX1(3) .
      DATA: WA_DREF TYPE REF TO DATA.
      DATA :  FS_SUM_GL LIKE LINE OF IT_YMM_ST_TNUOT_MLY.
      CREATE DATA LP_DATA LIKE LINE OF <DYN_TABLE>.
      ASSIGN LP_DATA->* TO <LS_LINE>.
      LOOP AT IT_YMM_ST_TNUOT_MLY.
        MOVE-CORRESPONDING IT_YMM_ST_TNUOT_MLY TO <LS_LINE>.
        INSERT <LS_LINE> INTO TABLE <DYN_TABLE>.
      ENDLOOP  .
      DATA L_COUNTER_ROLL TYPE I .
      LOOP AT <DYN_TABLE> INTO <LS_LINE> .
        MOVE-CORRESPONDING <LS_LINE> TO FS_SUM_GL.
        CLEAR : FIELD , INDX1 , L_COUNTER_ROLL .
        L_COUNTER_ROLL = 1 .
        LOOP AT IT_EKKN  WHERE EBELN = FS_SUM_GL-EBELN.
                        AND   EBELP = FS_SUM_GL-EBELP.
         IF SY-SUBRC  = 0  .
          INDX1 = L_COUNTER_ROLL.
          SHIFT INDX1 LEFT DELETING LEADING SPACE.
          CONCATENATE 'KOSTL'  INDX1 INTO FIELD .
          ASSIGN COMPONENT FIELD  OF STRUCTURE <LS_LINE> TO <FS1>.
          <FS1> = IT_EKKN-KOSTL .
          MODIFY <DYN_TABLE> INDEX SY-TABIX FROM  <LS_LINE> .
          L_COUNTER_ROLL = L_COUNTER_ROLL + 1 .
         ENDIF.
        ENDLOOP .
      ENDLOOP .

  • 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 creating properties

    Hi,
    I'm migrating my application from NW 7.0 to NW 7.11 CE.
    Previously I dynamically created properties from my application and they were automatically created as onlinemodifiable = true.
    When I migrated my project the properties were no longer created as modifiable.
    Can anybody point me to documentation or suggest a way to solve this issue?
    Here's my code creating the dynamic property:
              Configuration cfg = null;
              try {
                   cfg =
                        _cfgHandler.openSubConfiguration(
                             "application.global.properties",
                             ConfigurationHandler.WRITE_ACCESS);
              } catch (NameNotFoundException e) {
                   e.printStackTrace();
              } catch (ConfigurationLockedException e) {
                   e.printStackTrace();
              } catch (ConfigurationException e) {
                   e.printStackTrace();
              // get the property sheet
              PropertySheet ps = cfg.getPropertySheetInterface();
              // Create the property
              ps.createSecurePropertyEntry(propertyName, "", "");
              // commit the changes
              _cfgHandler.commit();
              cfg.close();
    Best Regards,
    Ran

    Hi,
    Probably this configuration can be done through NWA [check this|http://help.sap.com/saphelp_nwesrce/helpdata/en/18/5157425e060d53e10000000a155106/content.htm]
    Best Regards
    Satish Kumar

Maybe you are looking for

  • TS4002 how do you save email attachments on the ipad?

    how do you save email attachments on the ipad? particularly ebooks sent via email

  • "apple-+" does not increase font size in preview pane in mail.app 4.2

    i have letterbox http://harnly.net/2009/software/letterbox/letterbox-beta-4-for-snow-leopard/ installed on my machine. before the SL upgrade, i could hit cmd-+ and increase the font size of the message i am viewing. that was super convenient! i can't

  • How to add a time stamp to an array

     Currently the VI that I have attached has the capacity to log data from the set of 14 arrays. I currently have a tick counter hooked up. However, I would like to add a time stamp that will display the elapsed time in seconds from the begining of the

  • Sql command example in oracle 9

    Hi, I want to use oracle 9 select * from tab . And use the output to issue "desc XXX " for every row of output in select statement... How can I do it automatically ??? Any example ???

  • Trying to update to Mountain Lion from 10.6.8

    I currently am running all the tech requirements that are stated on apples requirement page, but when i click to buy it from the app store it says I am not compatible. Is there something I may be missing? I have 2 gigs of ram and I have 8 gigs of fre