.

UI Components for JSF
Post Reply
gliesian
Posts: 94
Joined: 18 Sep 2011, 06:41

25 Jul 2014, 20:50

.
Last edited by gliesian on 09 Sep 2014, 02:51, edited 1 time in total.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

25 Jul 2014, 21:43

gliesian wrote:Can anyone advise naming conventions for component id's?
No... not realy. Although... I always try to have them as functional/business like as possible and as less technical as possible.

User avatar
snooperman
Posts: 155
Joined: 06 Nov 2012, 18:43

28 Jul 2014, 10:05

I found this email in my inbox, I can't find the original article, but I think it's relevant

JSF Coding rules

Here are the rules to follow when developing JSF pages:
1. One view = one xhtml page.
2. One modalPanel = one xhtml page.
3. One page xhtml = one corresponding backing bean
4. Edit form = Add form
5. Backing bean name xxx = xxxBean.
6. Do not use session scope.
7. No text should be hardcoded in the page -> Everything should be in a utf-8 properties file.
8. Avoid at maximum the components binding
9. A bean should have the same name as the page viewBuyers.xhtml --> viewBuyersBean
10. Utilize 'empty' and 'not empty' instead of '!=null'
11. Add always the id attribute on the JSF components. The prefixes are:
  • Input text : txt
    Label : lbl
    Div : div
    Combobox : sel
    Column : col
    Datatable : dtb
    Checkbox : chk
    Form : frm
    Button : btn
    Link : lnk
    DataScroller : dts
    Image : img
    Panel : pnl
    ModalPanel : mdl
12.Prefix the page name based on the actions :
  • viewMyPage : if the page displays the details of an entity(ex : viewBuyer)
    listMyPage : if the page displays a list of entities (ex : listBuyer)
    editMyPage : if the page add/modify an entity (ex : editBuyer)
13.Postfix the page by Modal if it the page contains a modal panel(ex : editBuyerModal).
var details = {
. . PF.version: "5.0.x",
. . JSF.version: "2.x",
. . Tomcat.version: "8.x"
}

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 40 guests