Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get selectedDate using AjaxBehaviorEvent?

<h:outputLabel id="remainingDays" value="#{bean.DueDate}" title="#{bean.remainingDays}"  >
<p:ajax listener="#{bean.listenerMethid}" update="remainingDays,remainingDays" process="remainingDays" event="mouseover"></p:ajax>
</h:outputLabel>
<p:tooltip for="remainingDays" id="tooltip" />



public void listenerMethod(AjaxBehaviorEvent event){


}

How can i get Duedate using AjaxBehaviorEvent inside the listenerMethod()

like image 766
Arunprasad Avatar asked Dec 15 '12 08:12

Arunprasad


1 Answers

This should work as a general way to get the value through AjaxBehaviorEvent:

public void listenerMethod(AjaxBehaviorEvent event) {
    String dueDate = (String) ((UIOutput)event.getSource()).getValue();
}

However, in your case, you can just access it through the varable (or getter) since it is in the same bean as the listenerMethod.

like image 58
grekier Avatar answered Oct 27 '22 11:10

grekier