Hello everyone,
I've coded a WDA which builds a UI dynamically. I'm adding attributes to a context node and removing them whenever the user clicks on a button.
I've realized that in this case all of the attributes assigned to the node are removed. In fact the standard method:
IF_WD_CONTEXT_NODE_INFO~REMOVE_ATTRIBUTE
contains the statement:
me->invalidate_nodes( )
which appears to invalidate all of the nodes and this is clearly not what I was expecting.
I just wanted to remove the selected attribute through the coding:
node_info->remove_attribute( name = lv_param3 ).
I honestly don't understand why the REMOVE_ATTRIBUTE has got this semantics, it doesn't make much sense to me.
How can I delete a certain attribute without invalidating all the other siblings?
Thank you!
I was expecting an alternative to this weird functionality...
Hello,
I hadnt used this before.
This seems to be standard behavior. I had a look at the documentation at https://cw.sdn.sap.com/cw/docs/DOC-30536.
REMOVE_ATTRIBUTE
A dynamic attribute can be deleted again using this method. All nodes (runtime instances are invalidated) that reference to this node info.
The reason for invalidating the nodes corresponding to the node info could be that all the existing instances would have the reference to the attribute which is getting deleted. That will be invalid information after the attribute is removed. So by invalidating the nodes, all the elements for those nodes will be removed. And we need to create the elements again.
Hope this helps!
Best Regards,
Srilatha
Add a comment