on 06-30-2008 10:05 PM
Hello,
I have a requirement in the ESS Banks application where I need to remove a particular Payment Method option from the DropDownByKey field....is it possible to loop thrugh the values and delete that particular option ...I tried using the WDDropDownListBoxSize but don't know exactly how to use it..
Any help would be highy appreciated.
I think you can iterate through the node which is binded to DDByKey element, and delete the particular element containing specified value.
revert back if you have further doubts
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shikhil,
As nikhil pointed, you can not delete value from model node;
But you can use an attribute node; copy the model node to the newly created node and bind that with the UI element (DropdownByKey);
From the node that is binded with the UI element, you may be able to delete the data.
Try this.
Regards
Vinod V
Hi Shikhil,
You can try the following:
IModifiableSimpleValueSet ValueSet = wdContext().node<nodeName>().getNodeInfo().getAttribute(IPublic<ComponentName>.I<NodeName>Element.<ATTRIBUTE_NAME>).getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
valueSet.remove(<key>);
Regards,
Gopal
Hello Gopal,
Thanks for the reply...I tried the line of code you specified but then I get the following Exception :
com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(DetailView.SelectedInfotype.Zlsch): must not modify the datatype of a mapped attribute
at com.sap.tc.webdynpro.progmodel.context.MappedAttributeInfo.getModifiableSimpleType(MappedAttributeInfo.java:117)
at com.sap.xss.hr.per.us.bank.detail.DetailView.wdDoModifyView(DetailView.java:186)
at com.sap.xss.hr.per.us.bank.detail.wdp.InternalDetailView.wdDoModifyView(InternalDetailView.java:704)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
... 29 more
Please help.
Hi Shikhil,
That is because the attribute that you are trying to manipulate with is in some node of view which in itself is mapped to a node in Component Controller. So you have to manipulate the attribute which is in Component Controller. You cannot get ModifiiableSet of an attribute in view if it is mapped to some attribute of controller.
That is why when you are trying to get valueSet in the code, you are getting such error. This is the reason why I had specified the code as IPublic<ComponentName>. I<NodeName>Element.<ATTRIBUTE_NAME> instead of
IPrivate<ViewName>.
I<NodeName>Element.<ATTRIBUTE_NAME>
Regards,
Gopal
Hi Shikhil,
And one more thing I want to add. If possible do not manipulate the Node data in wdModifyView. This method is more specifically used for dynamic UI generation. According to Phase model philosophy (which I am not well versed with), the manipulation of node data, if possible, must not be done in wdModifyView.
Regards,
Gopal
Hi Shikhil,
I was wrong in one aspect. Please modify the code as follows:
IModifiableSimpleValueSet valueSet =
wdThis.wdGet<ComponentController().
wdGetContext().node<nodeName>().
getNodeInfo().
getAttribute(IPublic<ComponentName>.I<NodeName>Element.<ATTRIBUTE_NAME>).
getModifiableSimpleType().
getSVServices().
getModifiableSimpleValueSet();
valueSet.remove(<key>);
Instead of accessing Context node of View, you must access Context node of Component controller to get the ModifiableSet reason for which I had already discussed in previous messages. Sorry for providing incorrect code earlier.
Regards,
Gopal
Hi,
Why dont you go for the option that Nikhil suggested. Just copy the model node to the value node of the same structure. Removing the element from the value node is also very simple task.
Also at later point of time if it is required to execute the model again it would not effect your value node values at all.
I hope this will help.
thanks & regards,
Manoj
Hi,
Hope the following link will help you.
http://help.sap.com/saphelp_nw70/helpdata/EN/95/93fe1e71a2e44691b1f041e67f71aa/frameset.htm
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hii,
Can u please tell me how the values have been populated in dropdown? thru simpletypes or dynamically generated??...then u can delete it accordingly......
Thanks,
parama.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.