on 11-11-2008 4:58 AM
I am using a table having 5 fields. i am displaying the data in the table with all the fields as inputfields. When i click a button, the rows having the data should become disable and the rows which doesn,t have the records should be in enable mode only.
Can we achieve this functionality ?
Hi Manjunath,
As per the snapshots that you have sent me I think that before the user presses on the u201CFreeze/Releaseu201D button he should for sure have pressed on u201CSave Entriesu201D. Right? So while you are writing these entries to your context you can do something. Take another Boolean attribute in your context node & set its value to X if the user has made an entry into the tableu2019s row. Now when you press on the Freeze button get your context data & say like loop at it_data where lv_flag = u2018Xu2019. So now you would get all those records only where the user has made some entries. Now change the context attribute which you have used for binding to your tables readOnly property. You should have only the desired rows set to readOnly & the rest would remain as enabled.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manjunath,
Thatu2019s what I had suggested the solution foru2026 I will try to put it down again. Take 2 Boolean attributes at your context level:
1) Would be a flag to know whether the user has entered any data in this particular row (Lets say flag1). By default set it to false so that it would mean that for the 1st time the entire table being displayed would have the flag1u2019s value as u2018 u2018.
2) Would be a variable for using to bind to the table columnu2019s readOnly property (Lets say flag2) By default have this value to false so that the entire column would be in editable mode by default.
Say suppose you want to make all the working days for which the user has made entries you should bind the cell editors readOnly property of all those columns to flag1.
When the user enters some data into a row and presses on the save then change the flag1 value for that particular row to X. (So this changes should get reflected on the context nodes data) So for example the user has entered data for first 2 rows then flag1 would be X for both these rows in the context node.
Now when the user presses on the Freeze button just get your entire contexts data & loop through only those records where you have flag1 = u2018Xu2019
Loop at it_data into wa_data where wa_data-flag1 = u2018Xu2019.
Wa_data-flag2 = u2018Xu2019.
Modify it_data from wa_data transporting flag2.
Endloop.
So now you would only set the readOnly value for the rows where flag1 = u2018Xu2019 (i.e., where the user has made his entries). The rest of the rows would still continue to have the default value defined at context level u2018 u2018 and so would remain as editable. I hope that you have understood what I intended to say.
Regards,
Uday
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.