Submit on Enter in JSF


if you want to make a form submit with executing your action in JSF, what you can do is as follows:

<h:commandButton id="hidden" style="width:0px;height:0px;border:none" action="#{bean.doSth}" />

this is a hidden button and will execute your method.

Btw, if you use style=”display:none;”, it does not work in ie 🙂

Integrating JBoss EL with JSF

JBoss EL is a powerful tool if you are using JSF. You can pass parameters to methods in JSF with it. It is my favorite tool right now while developing with JSF. I thought it was coming with Seam only, I mean I thought that you cannot use it without Seam but then in a PrimeFaces-Spring-Hibernate project I needed this. It turns out that you can use JBoss el w/o Seam also and it is very easy to integrate.

1. Just download JBoss EL jar to your web-ing/lib folder, or add it as a dependency in your pom.xml file ( if you’re using maven)

and put this in your web.xml file:


that is it. now you can do a lot of tricks like :

<ui:repeat var="day"  value="#{bean.user.getWorkingDays(bean.periodStartDate, bean.periodEndDate)}">
<p:commandButton value="#{day}" action="#{bean.selectDay(day)}"/>

yes, like above all kind of tricks can be done now.