• Post Reply Bookmark Topic Watch Topic
  • New Topic

dyanmic dropdown

 
ramya satheish
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<h:selectOneMenu id="role" disabled="false" value="#{employeeDetails.currentrole}" >

<f:selectItem itemLabel="--Select--" />
<f:selectItems value="#{employeeDetails.currentRoles}"/>
</h:selectOneMenu >


Will the selected value get changed whenever employeeDetails.currentrole changes? If not how to acheive this?
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it will not. JSF is based on HTTP and HTTP is a synchronous request/response protocol. That means that the client can ONLY receive an update (response) from the server if it makes a request. The server cannot send unsolicited data asynchronously.

In order to update any part of a JSF page (or any HTML page, for that matter), you have to poll the server for the updated data. There's an HTML META option for this, but that updates the entire page. For a more fine-grained approach using RichFaces a4j, you can use their polling tag to refresh selected parts of the page display.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!