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>

Similar Messages

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

  • How to delete dynamically created nodes?

    Hello Colleagues,
    In our screen we have a push button which adds one node to the context when used. The node is having a few fields which are shown in the UI.
    So as you keep on pressing the button, additional rows will be appended on the screen.
    Now, I have added another button on each of these rows. On clicking of which it should remove the row (the node). So each time you press the button 'Add element', additional rows will be appended, and each row will have a button 'Remove Element'.
    But, the problem I am facing is in the implementation of 'Remove Element'.
    The button 'Remove Element' is mapped to an action. But since there are as many 'Remove Element' buttons as there are rows, how do I identify which node is to be deleted ?
    I have tried with get lead selection etc. but it didnt work.
    Is there any way we can find out which UI element has trigerred the deletion, in the code of 'onactionSOMETHING' ?
    Thanks
    Gagan

    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.

  • 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

  • How to delete Thr created functional module dynamically

    Hi All,
    How to delete Thr created functional module dynamically
    Regards,
    Lisa
    Message was edited by:
            Lisa Roy

    Hi,
    You can use the function module RS_FUNCTION_DELETE to do that.
    Make sure you are not deleting any standard FM's.
    Example
          call function 'RS_FUNCTION_DELETE'
               exporting
                    funcname          = 'ZFM_NAME" " Function modue name
                    suppress_popups   = 'X' " TO suppress any pop-ups that come when you delete
               exceptions
                    error_message     = 1
                    cancelled         = 2
                    function_released = 3
                    others            = 4.
    Regards,
    Sesh

  • 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 order created against notification

    hi gurus,
    Someone tell me how to delete order created against notification. & also PR created against it.
    Regards,
    Radhika

    Hello
    You can set the deletion flag only when the order is business completed - CLSD status (no open costs remaining on the order). Deletion flag is set to the order when you want to archive the order. Till the order has a CLSD status, the del flag setting in the menu will remain inactive.
    Any open PR created against the order is automatically set to deletion when the order is set to TECO - tech completed status.
    For your scenario:
    If you dont want to use the order and the order is with CRTD status - you can set the 'Do not Execute' flag. It will set the order to CLSD and NCMP (Not completed) status. this will also delete your PR
    In case your order is already released - you will have to set the CLSD status for your purpose
    Regards
    Kartik

  • How to delete objects created with new

    Hello,
    I am having a problem creating a behavior or script to delete new sprites created in channels. I have a behavior script that creates new sprites using the following (simplified) script:
    First, a Beginsprite creates a gChannel_list and assigns a beginning gChannel value. pSprite is used to establish the sprite that in the mousedown is clickon.
    on Beginsprite me 
      gChannel_List =[]
      gChannel = 70
      pSprite = sprite(Spritenum)
    end
    In the mousedown the gChannel is incremented and the newly created channel is added to the gChannel_list.
    on Mousedown me
      gChannel = gChannel + 1
      theChannel = addat(gChannel_List,gChannel)
      themember = pSprite.member
      channel(gChannel).makeScriptedSprite(themember, point(80,160))
      sprite(gChannel).width = thememberW
      sprite(gChannel).height = thememberH
      sprite(gChannel).rotation = theMemberR
      sprite(gChannel).moveablesprite = 1
      sprite(gChannel).ink = 36
    etc
    After creation of several sprites based on the the gChannel, the following globals, for example, are returned.
    -- Global Variables --
    gChannel_List = [71,72,73,74]
    gChannel = 74
    My problem is that I am unable to delete these created gchannel sprites with a lingo command. Deleting them from the list, for example, using deletat(gChannel,1), does nothing to remove them from the stage (they do disappear from the list). And while I can display their attributes such as width [n=getat(gChannel_list, x); put sprite(n).width], nothing seems to relate to deleting these gchannel sprites.
    How is it done?
    Hope this is enough information. If not, please let me know. I can provide whatever you might need. Please help.
    Rod

    Sean,
    DUH! Didn't even know that a 'removeScriptedSprite()' command existed! Very logical. It works perfectly. Thanks again so very much.
    Rod

  • How to delete Jobs created by T.Code SM36

    Hi,
    I am trying to delete Events created by T.code SM62.
    But this has some jobs which i created by T.Code SM36.
    How i Can delete these Jobs.
    Because i want stop my process chain triggered by this event.
    Regards,
    Anand Mehrotra.

    Hi Anand,
    Please go through the below procedure....
           1.      Select a job (or jobs) from the Select Background Jobs screen (Transaction SM37, or choose CCMS ® Jobs ® Maintenance, complete the description of the jobs you want to delete, then choose Execute to get to the Job Overview.)
           2.      In the Job Overview, mark the job or jobs you want to delete by checking the box to the left of the job name.
           3.      Choose Job ® Delete.
    Hope this helps you
    Thanks
    KP

  • How-to handle dynamically created AppModules with JUApplication, JUMetaobjectManager

    Hi,
    I've got a JClient App, where I want to dynamically create AppModules in the Context of the RootAppModule.
    How can I best do this??? The problem is that I can't really use the JUMetaObjectManager.createApplicationObject method and hence I can't use PanelBindings.....well I can't use the JClient Framework.
    Is there a way to elegantly manage this issue??
    Every solution would be very appreciated! thanks.

    Hi, first off, no need to determine what has been checked or not. If the checkbox is checked, on the post, the value will be submitted as part of the request. If the checkbox is not checked, it will not be submitted (it's value will be null). Depending on what you need, I have approached this a number of different ways. One way is to name all checkboxes the same name. If you need to distinguish between two rows in the form, then in the value field for the checkbox, use some type of distinguishing factor, for example,
    <input type=checkbox name=chkName value="1:abc">
    <input type=checkbox name=chkName value="1:def">
    Now, you only have to make one call on the Servlet/JSP receiving the form post, request.getParameterValues("chkName") which will return an array of the non-null Strings that were checked.

  • How do I dynamically  create a pdk:text / field?!!!!!!

    I have a form that is to let the user add multiple rows and I need to be able to dynamically create a text filed and assign the attributes maxlength, size, name,property, and also assign the onkeypress a java script function. the following code will get me a text box but none of the attributes work:
    function add_Row(TLBID)
    var tbody = document.getElementById(TLBID).getElementsByTagName("TBODY")[0];
    var row = document.createElement("TR");
    var tlbTD = document.createElement("TD");
    var txtelement = document.createElement("TEXTAREA");
    tlbTD.colSpan = 2;
    txtelement.cols="25";
    txtelement.rows="2";
    txtelement.name="newDCTResponseText";
    tlbTD.appendChild(txtelement);
    var tlbTD2 = document.createElement("TD");
    tlbTD2.valign="bottom";
    var txtelement2 = document.createElement("input");
    txtelement2.type="text";
    txtelement2.maxlength="5";
    txtelement2.size="2";
    txtelement2.name="dctqeBean";
    txtelement2.property="dctScoreTxtBox";
    txtelement2.onkeypress="do_validate()";
    tlbTD2.appendChild(txtelement2);
    row.appendChild(tlbTD);
    row.appendChild(tlbTD2);
    tbody.appendChild(row);
    }

    Hi Ray,
    Thanks for your response. I do not understand the explanation. Maybe it is because I did not explain what I need or maybe becasue I am new to TS. Here's what I'd like to do.
    Have a predefined list of IO names. Like:
    Nest1 
    K23    "DIO96/port0/line1"
    K24    "DIO96/port0/line2"
    Nest2
    K23    "DIO96/port1/line1"
    K24    "DIO96/port1/line2"
    I will have 2 nests(sockets) in my system running batch model. From what I understand I can have 1 sequence defined and TS that will execute 2 threads with 1 socket per thread. In this sequence I somehow need to pass to my VI the value of K23 which is different for socket1 and 2. I was thinking that I can somehow create the Property Name Dynamically. Sort of like that:
    RunState.Sequence.Parameters.GetPropertyObject("Nest%d",RunState.TestSockets.MyIndex+1).K23
    It would give the sequence running for socket 1 the value "DIO96/port0/line1" and "DIO96/port1/line1" for socket 2
    thanks
    J.

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

  • 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 do I dynamically create a hyperlink in Indesign with vb

    Hi, does anyone know how to create a dynamic link to Indesign with vb? I'm coding a catalog from Access database with images and would like to make an "Enlarge image" hyperlink while generating the page. Somehow I seem to have no luck in my code. Thanks for any suggestions.

    As simple as it sounds to create hyperlinks with VB into Indesign CS4 it really took time and effort to finally
    come up with the solution. With the kind help of  Max Dunn an old InDesign scripting bug with VB was discovered responsible for this. But if you split the job into two parts it can be done.
    First make the document without hyperlinks in VB by putting the URLs in script labels on each graphic frame. Then in Indesing run a post-processing script in JavaScript that iterates through the graphic frames, and for each, if it has a script label, set that as the URL for hyperlink.
    Here is how I did it in Indesign.
    var myDocument = app.documents.item(0);
    for(var myCounter = myDocument.rectangles.length-1; myCounter >= 0; myCounter --){
    alert(myCounter)
    var myRectangle = myDocument.rectangles.item(myCounter);
    var myLabel = myDocument.rectangles.item(myCounter).label;
    try{
    myHyperlinkURL = myDocument.hyperlinkURLDestinations.add(myLabel);
    myHyperlinkSource = myDocument.hyperlinkPageItemSources.add(myRectangle);
    myHyperlink=myDocument.hyperlinks.add(myHyperlinkSource,myHyperlinkURL);
    myHyperlink.visible=false;
    catch(myError){

  • How to handle dynamically created checkboxes in JSP???

    Hello everybody,
    In a JSP page I would like to create checkbox dynamically on every
    result line (detail line), then check in some of them and finally pass the checked lines to a JSP bean which will handle them on a submit button press.
    The problem are:
    - how to index every checkbox in jsp result line in jsp page in order to avoid solutions like this:
    <input type=checkbox" name="value1">
    <input type=checkbox" name="value2">
    etc
    - how to read every checkbox to find the checked ones
    Is there anobody who has any experience from case like this?
    Please, help me.
    Best regards,
    Danny

    Hi, first off, no need to determine what has been checked or not. If the checkbox is checked, on the post, the value will be submitted as part of the request. If the checkbox is not checked, it will not be submitted (it's value will be null). Depending on what you need, I have approached this a number of different ways. One way is to name all checkboxes the same name. If you need to distinguish between two rows in the form, then in the value field for the checkbox, use some type of distinguishing factor, for example,
    <input type=checkbox name=chkName value="1:abc">
    <input type=checkbox name=chkName value="1:def">
    Now, you only have to make one call on the Servlet/JSP receiving the form post, request.getParameterValues("chkName") which will return an array of the non-null Strings that were checked.

Maybe you are looking for