• Post Reply Bookmark Topic Watch Topic
  • New Topic

Eclipse JSF ID Generator  RSS feed

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please is there a plugin for eclipse that i can use to generate IDs for my JSF tags, Its takes me time to add ids to every tag in my application, and i don't want JSF to generate them for me at runtime
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One could be written, I suppose. Or you could cook up an XSLT and run that.

However, simply assigning generated IDs to your JSF elements is doing yourself a disservice. It's better to use descriptive names for id's.

You don't need to give every little tag an ID - there's really only 2 reasons why you need an ID:

1. If the element is prone to throwing exceptions (like data controls often do), the ID will help you figure out which one is failing, since the ID is usually part of the failure message.

2. If the element is associated with some other element, the id is the common way of making that association. For example, the outputLabel references the id of the control it's labelling.
 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
One could be written, I suppose. Or you could cook up an XSLT and run that.

However, simply assigning generated IDs to your JSF elements is doing yourself a disservice. It's better to use descriptive names for id's.

You don't need to give every little tag an ID - there's really only 2 reasons why you need an ID:

1. If the element is prone to throwing exceptions (like data controls often do), the ID will help you figure out which one is failing, since the ID is usually part of the failure message.

2. If the element is associated with some other element, the id is the common way of making that association. For example, the outputLabel references the id of the control it's labelling.




I am only needing this because of your second reason, that is identifying which tag is throwing errors
 
Hakan Erdogan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently I needed such a plugin because my jsf output was about 15 MB. It was an HTML output format report, and since the runtime generated ids are so long such as id="form:j_id_jsp_1683309375_39:1:j_id_jsp_1683309375_53:0:j_id_jsp_1683309375_54"
the report file was 15 MB. Actually I began to use a reporting tool (jasperreports) after that. Anyway since there isn't any plugin and one of my friend and I decided to write one. It's coming soon, and hosted by sourceforge.

https://sourceforge.net/projects/jsfidgenerator/
 
Hakan Erdogan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've released the Beta version of the plugin.

http://sourceforge.net/projects/jsfidgenerator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!