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
jeremy_rossjeremy_ross 

outputPanel mucks with its content

Anyone know why outputPanel reorders attributes in elements it contains?  Seems like the contents of the outputPanel should be opaque to it.  I wonder what else it does to its contents I'm not aware of. 

Jeremy
David VPDavid VP
You mean in the HTML it generates ?

I haven't noticed that it does that but what kind of problem does that create for you ?



David
jeremy_rossjeremy_ross
It hasn't caused me any problems (yet).  It's odd for an html templating system to modify the plain ol' html.  There must be some reason it's transforming html, and I'm curious to know what that to expect from it.
David VPDavid VP
Well, my guess is the following :

All these apex tags and visual components are actually being transformed (server-side) into Java classes (in the viewstate of the page) ... This is the way that JSF pages in Java work and I'm pretty sure that SFDC is using something very similar.

All attributes in the tags are just properties in these classes and an XML parser just goes over your VF page code (apex tags) to translate this into a server side object model (which then talks with your controller which probably also gets translated into a Java equivalent before running).

After doing a lot of clever stuff, depending on the user's interactions, these classes then get rendered into HTML again in the response to the browser but nowhere in the classes is there a need to keep the exact order of the attributes... hence why they appear in different order.


hmmm, I'm not explaining this very well am I ? Perhaps you could take a look at how JSF tags and components work.


Anyway : I hope your get what I mean. (and I'm not even sure if I'm right - perhaps a SFDC guru can confirm/deny this)


David
jeremy_rossjeremy_ross
I totally understand what you're saying.  Makes me think that html gets parsed into and stored as an abstract syntax tree.  When it's restored and rendered, there's no specific ordering on attributes, since order has no effect in html.  I guess I don't mind this, but it's just more chances for bugs in the system and feels a little icky.

Filing this one under It Probably Doesn't Matter.

Jeremy