• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Eclipse JSF ID Generator

 
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
 
Saloon Keeper
Posts: 21985
151
Android Eclipse IDE Tomcat Server Redhat Java 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
 
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
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic