on 06-25-2007 10:36 AM
My requirement is create the dropdown list and when i select the value from the list,have to display table values according to that selected value.
For this i have seen the demo example WDR_TEST_EVENTS provided by SAP.
I have created layout with one dropdownboxbyidx , one Table and
context with node dropdown1 and child node table1 with attributes and also with the corresponding supply functions.
when i test this application initially am getting the values when i select the another value in dropdown , it is not changing the values in the table and also it is giving error as' Access via null object reference not possible'
any one can help me to resolve this problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neelima,
I would really suggest that you write appropriate code in OnSelect Method of DropDownBox instead of using a Supply function. Depending on the selected value, you can do a conditional select on the table to fill the corresponding values into the child node thru data binding.
Thanks & Regards,
Phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
write the code of supply function in the onselect and it should work fine...also don forget to bind the table
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi neelima,
instead of a supply function why dont you fill the value in ONSELECT method of the dropdown?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
could you pls provide the code of you on_select action handler?
Cheers,
Sascha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why do you use this class?
What do you want to do? User selects en entry and you update a table with elements regarding the selected value?
Then you have to get the selected element via the lead selection or by using the wdevent object passed to the action handler.
Then read the selected value from the element, perform a selection and add the result to the node of table that should display the result.
Cheers,
Sascha
I am getting the values in the listbox but when i select the perticular value in list, table is not changing as per selected value. that means Filltable1 supply function is not working.
code for the Filltable1 supply function:
data:
lt_attributes type standard table of if_mainview=>element_table1,
wa_attributes like line of lt_attributes,
carrid type s_carr_id,
lt_scarplan type cl_wd_flight_model=>tt_scarplan.
field-symbols:
<scarplan> like line of lt_scarplan.
parent_element->get_attribute( exporting name = 'CARRID' importing value = carrid ).
cl_wd_flight_model=>get_scarplan_by_carrid( exporting i_carrid = carrid importing et_scarplan = lt_scarplan ).
loop at lt_scarplan assigning <scarplan>.
move-corresponding <scarplan> to wa_attributes.
insert wa_attributes into table lt_attributes.
endloop.
node->bind_elements( lt_attributes ).
when i click anthor value in list , it's giving error as ' Access via null object reference is not possible'.
My concern is i want to display table data according to selected value.
The supply function will be called only when the table is filled for the first time. If you want it to be called every time when the drop down changes, do a node->invalidate( ) in the on_select event. Then it will be forced to be called again.
Check this , this is exactly the same problem that you are facing. Please award points for helpful answers.
Regards,
Nithya
Hi.
supply methods are normally only called once during initialization depending of
your context structure. So when you select another element the supply method will not be called again.
One exception: If you would declare the node, that contains the data for the table, as subnode of the node that contains the elements for the drop down and you declare this node as singleton the supply method is called each time you select an element of the parent node.
So you should use a method to fill it which you call in the action handler.
Cheers,
Sascha
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.