on 07-19-2011 2:43 PM
Hi ,
I have a table with 5 columns in view. I need to set one of the column's 'STATE' property mandatory dynamically based on selection of radio button .I was successfull in setting the mandatory Star ' * ' mark dynamically for that column. But the problem is when am trying to save the table data , it go to short dump saying that 'COULD NOT FIND THE ATTTRIBUTE 'CLOUMN NAME'.when am removing the bindig of the 'STATE' property , am able to save the data of the column.
i have two separate nodes for the data of table and 'STATE' attribute in the view context.
Please do the needful and thanks in advance.
Cheers,
sravan.
Hello Sravan.
you need to tell us what exactly you are doing while saving the data. Are you deleting any context elements? do you have any context attribute by name 'COLUMN_NAMe' ?
BR, Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Saravanan,
Thank you for your reply.
Am not deleting any context attribute.
Am calling the cl_wd_dynamic_tool=>check_mandatory_attr_on_view in 'WDDOBEFOREACTION' method of the view to check mandatory field entry before click on SAVE button.
After executing this method its going for shotdump.
- sravan.
Seems to be issue with the cl_wd_dynamic_tool=>check_mandatory_attr_on_view method. its trying to get the column attribute value from the context element of STATE attribute.
other option would be to set the STATE property of the TABLE_CELL_EDITOR dynamically via the code instead of biniding the attribute.
if the user selects the radio button, then in the WDDOMODIFYVIEW, access the CODE cell editor and set the STATE property to REQUIRED. this should solve your problem.
BR, Saravanan
Edited by: Saraa_n on Jul 20, 2011 1:50 PM
Hi,
Before calling the cl_wd_dynamic_tool=>check_mandatory_attr_on_view method, am able to set the 'Required' State ie., ' * ' mark for the 'CODE' column. Then why this method is not working for madatory check mark columns. If i remove the context binding of the 'STATE' property atttribute and i manually change the state of the 'CODE' column to 'required' then it is working fine.
Am using two different views. Radio button selection on one view and table display in another view.
--sravan.
This has nothing to do with two views.
As I already mentioned, the problem is in the cl_wd_dynamic_tool=>check_mandatory_attr_on_view.
Since you have bound the STATE property to a context attribute in different node (different from table context node), the method assumes that Value of the column CODE also belongs to the same context node of STATE attribute. So it tries to read the value of CODE from STATE attribute's context which wont available. this is the reason for hte dump.
so for the STATE property, if you bind attribute from different context then calling this method will dump. solution would be not bind any attribute to STATE property and set the STATE property value dynamically iin the code by access in the TABLE_CELL_EDITOR in modify view method.
BR, Saravanan
Hello Sravan,
Its very simple. I assume you have two views ( one view containing the radio button and other containing the table ).
in the WDDOMODIFYVIEW of the second view you have write the following logic
1. check whether the radio button is selected (to set the table column as 'required')
2. if its selected then change the state of the CELL_EDITOR. CELL_EDITOR is nothing but the input enabled ui element within the TableColumn UI element
data lo_input type ref to cl_wd_input_field. "if your cell editor is other than input field then you need to use corresponding ui element class
"TABLE_TEMP_EDITOR is the ID of the cell editor in the table column
lo_input ?= view->get_element( 'TABLE_TEMP_EDITOR' ).
lo_input->set_state( '01' ). "01 is for REquired and 00 is for Normal
wd_this->mv_set_required = abap_false.
thats it.. you are done.
BR, Saravanan
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.