on 07-02-2007 4:11 PM
Hi,
I m having a button say 'lock', when i press lock it should trigger some action as well in place of lock there should be another button with the test 'unlock'. when u press unlock it should call another action and in place of unlock it should replace with previous button 'lock'.
how to do this.
Hi renushree,
You need to handle this using meta data.I will write teh steps that you need to follow.
1.Create a node lock in your context.
1.a Add attribute VISIBLE of type WDY_BOOLEAN.
put the default value as 'X' .so that it will be visible in your first load
2.Create a node unlock in your context
2.a Add an attribute VISIBLE of type WDY_BOOLEAN.
Give deafult value space.
3. Create two buttons with LOCK and UNLOCK and bind their visible properties bound to teh attributes from node LOCK and UNLOCk respectively.
4. Add your code in your LOCK and UNLOCK actions .
In LOCK action , set VISIBLE attribute of the node LOCK to space and set VISIBLE attribute of the UNLOCK node to 'X'
This will enable your UNLOCK button and hide LOCK button.
In UNLOCK action , set VISIBLE attribute of the node UNLOCK to space and set VISIBLE attribute of the LOCK node to 'X'
This will enable your LOCK button and hide UNLOCK button.
Thanks
Anzy
Award points for useful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
On click of LOCK action.
Data: lo_lock type ref to if_wd_context_node,
lo_unlock type ref to if_wd_context_node.
lo_lock = wd_context->get_child_node( 'LOCK' ).
lo_unlock = wd_context->get_child_node( 'UNLOCK' ).
CALL METHOD lo_unlock ->SET_ATTRIBUTE
EXPORTING
VALUE = 'VISIBLE'
NAME = 'X'
.
CALL METHOD lo_lock ->SET_ATTRIBUTE
EXPORTING
VALUE = 'VISIBLE'
NAME = ' '
.
On click of UNLOCK action.
Data: lo_lock type ref to if_wd_context_node,
lo_unlock type ref to if_wd_context_node.
lo_lock = wd_context->get_child_node( 'LOCK' ).
lo_unlock = wd_context->get_child_node( 'UNLOCK' ).
CALL METHOD lo_unlock ->SET_ATTRIBUTE
EXPORTING
VALUE = 'VISIBLE'
NAME = ' '
.
CALL METHOD lo_lock ->SET_ATTRIBUTE
EXPORTING
VALUE = 'VISIBLE'
NAME = ' X'
.
This will work for you.Put teh code in the respective button actions.
Thanks
Anzy
<B>Award points for useful posts.
Hi
There was unwanted space after lo_unlock ...Please correct like below...
Data: lo_lock type ref to if_wd_context_node,
lo_unlock type ref to if_wd_context_node.
lo_lock = wd_context->get_child_node( 'LOCK' ).
lo_unlock = wd_context->get_child_node( 'UNLOCK' ).
CALL METHOD lo_unlock->SET_ATTRIBUTE
EXPORTING VALUE = 'VISIBLE'
NAME = 'X' .
CALL METHOD lo_lock->SET_ATTRIBUTE
EXPORTING VALUE = 'VISIBLE'
NAME = ' ' .
Its working in my editor.
Thanks
Anzy
Award points if this solves your issue
Hi Anzy
I m really very thankfull for ur replies, but still my problem not got resolved.
i hav done the same thing which u mentioned.
its executing also. but when i pressed 'lock' button its throughing an error "could not find attribute 'x' ". i commented the line
CALL METHOD lo_unlock->SET_ATTRIBUTE EXPORTING VALUE = 'VISIBLE'
NAME = 'X' .
now also getting te smae error "could not find the attribute ' ' "
what does it mean
why i m getting this problem
hi
Remove all the unneccasery space and format the code like this...
CALL METHOD lo_unlock->SET_ATTRIBUTE
EXPORTING
VALUE = 'X'
NAME = 'VISIBLE' .
This has to work , you have created a node in the context with name UNLOCK and with attribute VISIBLE , right ? The code is syntactically correct now .
Please check again
Anzy
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.