+ Start a Discussion
admintrmpadmintrmp 

outputPanel outputting wrong data

My outputPanel is parsing the wrong information as below:

 

 

<script type="text/javascript">
		        function toggleCancelItems(blDisplay) {
		        	if ( !blDisplay ) {
		        		jc('{!$Component.notificationSection.notificationSectionItem}').hide();
		        		jc('{!$Component.notificationSection.event_cancelledemails}').hide();
		        		jc('{!$Component.cancelNoteSection.cancelNoteSectionItem}').hide();
		        		jc('{!$Component.cancelNoteSection.event_cancelNotes}').hide();
		        	} else {
		        		jc('{!$Component.notificationSection.notificationSectionItem}').show();
		        		jc('{!$Component.notificationSection.event_cancelledemails}').show();
		        		jc('{!$Component.cancelNoteSection.cancelNoteSectionItem}').show();
		        		jc('{!$Component.cancelNoteSection.event_cancelNotes}').show();
		        	}
		        }
		        <apex:outputPanel layout="none" rendered="{!newEvent.IsCancelled__c==false}">toggleCancelItems(false);</apex:outputPanel>
		        </script>

 

 

 

is apparently equal to:

 

 

<script type="text/javascript">
          function toggleCancelItems(blDisplay) {
           if ( !blDisplay ) {
            jc('j_id0:j_id112:j_id113:j_id193:notificationSection:notificationSectionItem').hide();
            jc('j_id0:j_id112:j_id113:j_id193:notificationSection:event_cancelledemails').hide();
            jc('j_id0:j_id112:j_id113:j_id193:cancelNoteSection:cancelNoteSectionItem').hide();
            jc('j_id0:j_id112:j_id113:j_id193:cancelNoteSection:event_cancelNotes').hide();
           } else {
            jc('j_id0:j_id112:j_id113:j_id193:notificationSection:notificationSectionItem').show();
            jc('j_id0:j_id112:j_id113:j_id193:notificationSection:event_cancelledemails').show();
            jc('j_id0:j_id112:j_id113:j_id193:cancelNoteSection:cancelNoteSectionItem').show();
            jc('j_id0:j_id112:j_id113:j_id193:cancelNoteSection:event_cancelNotes').show();
           }
          }</td></tr><tr><td class="data2Col  first " colSpan="2">toggleCancelItems(false);</td></tr><tr><td class="data2Col  first " colSpan="2">
          </script>

 

I specifically told it NOT to parse HTML.

 

 

admintrmpadmintrmp

And before anyone says, I've used the code below for a workaround:

 

 

toggleCancelItems({!IF(newEvent.IsCancelled__c, 'true', 'false')});

 

But it's still not the point. It's a soundly bug.

 

XactiumBenXactiumBen

As far as I understand it using outputPanels always render as HTML content so you shouldn't be using these inside javascript functions.

admintrmpadmintrmp

I've used outputPanel in various other places previously with no HTML processed. layout="none" is meant to get rid of the HTML.