Question

Greetings:

Is there anyway to make an apex report table cell (or even the entire report itself) conditionally read-only in Apex 3.2? I don't see the "read-only" box anywhere in the options; tried searching everywhere.

Thanks in advance!

Was it helpful?

Solution

Since the whole tabform is to be made read-only for particular users, you can do this at rendering time rather than using Javascript. However, you would need 2 copies of each column:

  1. Column to be displayed for an authorised user, not readonly
  2. Identical column to be displayed for a non-authorised user, with Element Attributes set to readonly=readonly

Authorisation schemes can be used to control which columns are displayed to the user.

I was hoping to find a way to do this with a single column and a dynamic value for Element Attributes, but I couldn't get it to work.

OTHER TIPS

OK, I had an error in concept. I wanted to make a tabular form read-only. That's why I couldn't see the "read-only" box. If you open the source for the generated page, each column has given an id with the following naming convention:

id="f02_0001"

This table cell is in column 2, row 1. So, you can use JavaScript to loop through a column and modify it's properties. In this example, I use jQuery:

var payments = $("[id^='f08_']"); // get all cells for column 8

// loop through items
$.each(payments, function(){
   alert($('#'+this.id).val());       
   // make whatever changes you want to this.id, such as make read-only
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top