on 05-13-2005 5:08 PM
Hello Experts-
I have a view that contains a table which is bound to a model. The model contains many fields one of which is a URL.
I want to display the text of some of the fields in the table and that is working fine.
Now, I want to add a button to the table which is enabled or disabled based upon whether the URL contains a value. What is the best way for me to do this?
I can return a boolean flag from the ABAP code which this model corresponds to, but I would like a cleaner method where I can do this on the WebDynpro side.
Thanks,
- Vik.
Hi Vik,
1. Create a value node "vnLink" under the model output node with cardinality 1..1
2. Create a value attribute "vaEnable" under the vnLink of type boolean.
3. Write a supply function for the value node.
4. In the supply function check whether the link URL is blank set "vaEnable" as "false" otherwise set the value as "true".
5. Bind the vaEnable to enable property of the button.
Hope this solves your problem. If you require any further help, reply back.
Regards,
Santhosh.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santhosh-
I followed the WebLog and your instructions exactly.
I am getting this error:
com.sap.tc.webdynpro.progmodel.context.ContextException: Node(PTSResultView.EEt_T01): no child node 'ButtonAttributes' at index -1
I am not even checking for any conditions in my supply function but just the value for the boolean attribute. Despite that I am getting this error. Do you have any ideas?
Thanks,
- Vik.
Hi Vik,
Is your code looks something similar to the below one???
IPrivateCO_ComponentName.IVnLinkElement linkElement = node.createVnLinkElement();
node.bind(linkElement);
if(parentElement.getURL().trim().equals("")){
linkElement.setVaEnable(false);
}else{
linkElement.setVaEnable(true);
}
If not could you post the code which you wrote in the supplyfuntion, by seeing the code I might be in a better position to help you.
Regards,
Santhosh.C
Thank you Santhosh and Naga.
I figured out what the problem was here.
I added the next context element in the controller.
Then I mapped that revised controller context to the view context.
In that process of remapping somehow the 'dataSource' of the table got removed. To fix this, all I did was set the property of the table and it worked.
Thanks again,
- Vik.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.