File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Make selection with h:selectOneMenu and redisplay the value in a h:outputText?

 
Todd Patrick
Ranch Hand
Posts: 31
Android Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I make a selection with h:selectOneMenu and redisplay the value in a hutputText?

I have the following two JSF components defined:



With a button at the bottom of the page defined as:



In an Application scope bean, the method defined for valueChangeListener is:

public void clientIDSelected(ValueChangeEvent event) {
PhaseId phaseId = event.getPhaseId();
String oldValue = (String) event.getOldValue();
String newValue = (String) event.getNewValue();
if (phaseId.equals(PhaseId.ANY_PHASE)) {
event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
event.queue();
} else if (phaseId.equals(PhaseId.UPDATE_MODEL_VALUES)) {
if (newValue != null) {
this.currentTransStartDate = newValue;
}
}

FacesContext context = FacesContext.getCurrentInstance();
context.renderResponse();
}


The navigation rule is defined as:

<navigation-rule>
<from-view-id>/transactionbrowser.jsf</from-view-id>
<navigation-case>
<from-outcome>no results</from-outcome>
<to-view-id>/transactionbrowser.jsf</to-view-id>
</navigation-case>
</navigation-rule>


When I click my single h:commandButton, the selected value from the h:selectOneMenu is not displayed in the hutputText. The rendered hutputText is empty:


I'd appreciate any help on this, this should be simple, but I guess I am missing the point.

I do have Kito Mann's JavaServerFaces In Action book, which doesn't seem to have a clear solution either, still a great book though.

Thanks,
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic