开发者

How can I render a JSF component based on if the date is greater than today's date?

i get a date fr开发者_如何学运维om server side and how do I compare this in my xhtml code, so that if it is less than today's date, I'll render the panel, otherwise not.


You can have a method in your bean

class MyBean{    
  public boolean isDateBigger(){
   //date comparissoin and return result
  }
}

on XHTML

render="#{myBean.dateBigger}"

Update:

As per your comment, if you want to accomplish it through javascript then.

take two hidden parameter. One current millis and another representing your date's millis

compare them using javascript and apply DIV's style visibility:hidden to hide


try

{mbean.cardExpiryDate gt now}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜