on 10-20-2010 3:15 PM
Hi All,
In my requirement, i have buttons in disable mode, when user select any record buttons are enabled. this is working fine, when user deselect that row i want to disable those buttons again. i tried this but not getting disable when deselect row.. can anyone help this...?
Thanks,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anurag and Tan
When select any row enableing is working, deselection also working. when deselect row disabling is not working, here i am using code...
IF lr_element->is_selected( ) is not initial.
get single attribute
lr_element->set_attribute(
EXPORTING
name = `SET_ENABLE`
value = ABAP_TRUE ).
else.
lr_element->set_attribute(
EXPORTING
name = `SET_ENABLE`
value = ABAP_FALSE ).
endif.
i set a breakpoint and checking, what i am observing is when both select and deselect a row it is executing only in if block, curson is not coming to else block... how can we slove this??
Thanks,
Venkat.
hi,Venkat.
From your description, your logic is very clear..I don't know how to track the problem.
You said your coding doesnot go the "Else" clause..So, only what i can see is you should check the method"r_element->is_selected( )", check how the method is executed and why it returns "No initial"..
In addition, in my opinion, you should think:
As you are now de-selecting the row, so in your mind you should know: whether your method "r_element->is_selected( )" is till use the "Non-de-selected" the element...
If it does, i think you should change.For example, you can then "get selected element" of the "Context node" to check whether the element is True de-selected...
Hope it can help a little.
Best wishes.
Hi Tang,
I again tried this, after enableing i am deselecting row using set selected. it is working fine for same row i.e. if iam selecting 2nd row buttons are enabled, if i deselect 2nd buttons are desabled, but after selecting 2nd row( buttons are enabled now) if i select any other row ex. 3rd row again disable that buttons. can u help me??
if lr_element->is_selected( ) = abap_true.
lo_el_context->set_attribute(
EXPORTING
name = `SET_ENABLE`
value = ABAP_TRUE ).
lr_element->set_selected( abap_false ).
else.
lo_el_context->set_attribute(
EXPORTING
name = `SET_ENABLE`
value = ABAP_FALSE ).
lr_element->set_selected( abap_true ).
endif.
Thanks,
venkat.
Have you tried to code in Modify View. (I am not sure abt it).
Alternatively you can make one more column in your table.
And make that column as Button.
Now OnLeadSelect method of the table, you can write logic to enable the button for the selected rows.
Hence the button will be enabled for the selected rows.
But the user has to click the button column number of times that they have selected the rows.
Regards,
S.Meganadhan
Hi Venkat,
You could declare an attribute of type wdy_boolean and bind it to enabled property of a button.
and you could pass value 'X' if a user has selected any row of a table and ' ' blank if there is no row selected.
you could use the method get_selected_elements( ) of if_wd_context_node, you would receive a table of type wdr_context_element_set. just check if the table is empty or not. if it is empty,,,that means no row is selected.
Regards
Anurag Chopra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.