Skip to Content
avatar image
Former Member

Removing attributes from node

Hi,

Im creating a node and its attributes dynamically and binding it to a table to show a table dynamically. The problem is that when i load a new item, i have to rebuild the node and table because it might have different columns. The node allways has 3 fixed columns (id, name, description) so first i have to remove all of the attributes except the id, name and description. Same for the table columns. Can anyone tell me how to remove attributes from a node or how to differently solve my problem? All i see is how to remove an element but is a data right, not the model?

Much thanks,

Hugo Hendriks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 18, 2006 at 09:21 AM

    Hi,

    Use this

    wdContext.getContext().reset(false);

    This will remove all the context created dynamically

    Check this,

    how-to-delete-dynamically-created-attribute

    how-to-remove-node-attributes-dynamically

    Regards,

    Vijayakhanna Raman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2006 at 09:29 AM

    Hi,

    I had a similar situation, where 2 table columns were always present, and the name and type of other columns were only available runtime.

    I simply deleted all data (invalidate()) and recreated the context from scratch after each model execution that impacts the table structure.

    Otherwise, use the API to find the right methods for deleting Nodes and Elements.

    https://media.sdn.sap.com/javadocs/NW04/SPS15/wd/index.html

    Good luck,

    Roelof

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Hugo,

      Try it this way:

      wdContext.<node>.getContext().reset(true);

      This should remove only the attributes of the specified node.

      Regards,

      Christoph