function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kent ManningKent Manning 

Help with Visualforce Controller - Spring '12 changes

On our contact page we have an instrument / application section.  This is a tabbed visualforce page with 6 tabs. Each tab represents an instrument family. Within each tab, is a series of check boxes relating to the applications which can be done on that particular instrument.   So for example: our protein instrument would have applications like "western assays", "ELISA", "RNAi", etc. Another instrument - small animal imager would have applications like "western assays", "transcription factor assays" etc.  Note That the "western assay" appears on two different tabs, however the field "western assays" is a common field to both tabs.

 

Here is my problem.  Prior to Spring '12, it didn't matter if the western application check box was checked on protein reader tab or on the small animal imager tab, it would retain the fact that the box was checked.  Now after Spring '12, Salesforce changed the way vf evaluates which duplicate merge field becomes the winner. Now the behavior is whatever the state of the check box on tab 2 is the state retained on the save.  So if I check the westerns box on tab 1(protein reader) and I leave the westerns box unchecked on  tab 2( small animal imager) and save, the westerns box is not checked because tab 2 overwrites (wins) over tab 1.  

 

I need to write a code extension (and I have no idea where to begin) for this visualforce page that will control which value will be the winner upon saving the page. Does anyone have a suggestion (example code) on how I can control the duplicate check box fields so that if it gets check on tab 1, it stays checked and is not overwritten by the state of the check box on tab 2?  I envision this working similar to a radio button type of arrangement where when one button is selected all others are not selected.  I just don't know how to write the logic to do this.

 

Any suggestions or help would be appreciated.

 

Thanks

 

Kent

Starz26Starz26

eaisest way would be to write an javascript on the page that would be called onchange of each of the fields.

 

to call the function from the fields use: onchange="setValues(this.value); return false;"

 

it may be this.val, I would have to play with it as I do not wirte java all the time

 

the script would be something like:

 

<script>

 

function setValues(v){

 

 

var eleOne = document.getElementById('first');

var eleTwo = .........

 

eleOne.value = v;

eleTwo.value = v;

 

 

 

}

</script>

 

 

You will have to play with this as I said I do not write java all the time but this would set the value to be the same each time one of them is updated.