• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF 1.2 - Custom component

 
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

I have a following doubt… let me know if you have any idea

Problem description:
I have following four xhtmls of simillar format.
1. page1ExcelExport.xhtml
2. page2ExcelExport.xhtml
3. page3ExcelExport.xhtml
4. page4ExcelExport.xhtml

Only some variables change in each page.

Requirement:
I want to define a template xhtml and substitute required values.
I know in JSF 2.0 we have this Composite component model. But in JSF 1.2 how can we do with minimum supporting model?


page1ExcelExport.xhtml listed below:





 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can use facelet insert tag (ui:insert). You can create multiple insert tag in your template page and can use them by define tag of facelet(ui:define). for example

in your template page-

<ui:insert name="title"></ui:insert>

and after including this template in your more specific page you can define it-
<ui: define name="tilte"> ABC </ui:define>

I hope it works for you
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

How can I use it to fill the attribute value? could you give me an example snippet?
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instead of accessing the tempalte xhtml ...defined a POJO which exposes necessary attributes for template.

1. On click of excel export ...call action method if new POJO
2. based on request params fill in all properties
3. redirect to xhtml template
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic