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
Steve RossSteve Ross 

Apex tags vs html tags?

I'm new to writing visualforce pages and I'm wondering what the advantages/disadvantages are of using apex tags vs doing the same thing in straight html. I am creating a custom quote page and rendering it as a PDF. I will need to use the apex repeat tag and I will need to paginate as well.

 

I'f seen examples that are nearly pure HTMl and others that are all apex tags and yet others that are a mix.

 

Any advice would be appreciated.

 

Thanks, Steve

Best Answer chosen by Steve Ross
Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

This is a very good question.

 

Following are some of the difference between the Apex tags and Html tags,

Apex Tags

  • By using apex tags we can give the 'rendering' options through controllers.
  • Can apply javascripts functions provided directly or through controllers.
  • Apex tags are well-formed tags. You cannot create a vf page without <apex:page> </apex:page>

Html tags

  • But by using html tags we can only apply Javascripts and Jquery.
  • Also many functionality cannot be applicable in html tags.
  • Not well-formed, means you don't need to mention the script within head tag or without html also you can design html page

Hope this will help you...!

 

If this answer is useful, please give kudos.

All Answers

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

This is a very good question.

 

Following are some of the difference between the Apex tags and Html tags,

Apex Tags

  • By using apex tags we can give the 'rendering' options through controllers.
  • Can apply javascripts functions provided directly or through controllers.
  • Apex tags are well-formed tags. You cannot create a vf page without <apex:page> </apex:page>

Html tags

  • But by using html tags we can only apply Javascripts and Jquery.
  • Also many functionality cannot be applicable in html tags.
  • Not well-formed, means you don't need to mention the script within head tag or without html also you can design html page

Hope this will help you...!

 

If this answer is useful, please give kudos.

This was selected as the best answer
Steve RossSteve Ross

Thanks, that helps!

 

So it sounds like the best practices is to use apex tags unless you have a good reason not to.

 

Do you think it is more likely that an html tag would be unsupported for a future releases than an apex tag? I would like my pages to be as stable as possible across releases.

 

 

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Thanks for your response,

 

I don't think so a much difference would be there. Apex will become as much as easier than writing Html tags.

 

Releases are only to improve the functionality and but not to degrade existing one. So, Don't want to worry about the your existing code. It will be safe always.

Aathi suryaAathi surya
Thank you sister