Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic JSF homepage  RSS feed

 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

From my JSF homepage page I need to 'automatically' as the URL is entered, to invoke server code inorder to build my page. My homepage is dynamically built with the latest data, so how do I invoke a server code 'action' to retrieve the correct data to populate the table.

This wouldnt be an issue if the page was directed through from a commandLink or Commandbutton, but I'm unsure as how to tackle this, any tips/pointers.

Thanks in advance.
Zein
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if on your homepage you have something that is getting a value from some bean, it will call its getter method for that attribute. So in your getter method you write the code that gets the latest data.

So if I had.

<h:datatable value="#{myBean.dataForTable}"....

Then in the backing bean MyBean I would have

public List<Data> getDataForTable() {
// Code that gets the data
}

Mark
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark for your speedy response, I'll give it a go.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!