And indeed, the items with a value appeared correctly with a gray background and non-enterable. But when I submitted the form, the value of the items appeared to be empty.
After half an hour of trying all kinds of things I, examining session state and going through the debug output, I finally found the solution:
– when an item is disabled it’s value is set to empty…
So the solution was not to use the attribute disable, but the attribute readonly in combination with the style “background-color:#CCCCCC”.
With this solution, the session state is retained.
Visually the result is the same, the only difference is that the cursor can be placed inside the item, but no changes to the content can be made.
Source Article from http://dickdral.blogspot.com/2011/07/retaining-session-state-with-disabled.html