jsp - In JSF how to hide resultBean until doAction executed? -


i adding web service jsf page. page should take input , give output after submit button clicked. problem before button clicked there empty displayed on page. want know how hide if form empty.

the following jsp code

    <h:form styleclass="form" id="form1">         <table>             <tbody>                 <tr>                     <td align="left">number:</td>                     <td><h:inputtext styleclass="inputtext" id="trainnumber1"                         value="#{xxx_porttype_display.parambean.request.number}">                     </h:inputtext></td>                 </tr>             </tbody>         </table>         <hx:commandexbutton id="buttondoaction1" styleclass="commandexbutton"             type="submit" value="submit"             action="#{xxx_porttype_display.doaction}">         </hx:commandexbutton>         <table>             <tbody>                 <tr>                     <td align="left">result:</td>                     <td><h:outputtext styleclass="outputtext" id="quotacount1"                         value="#{xxx_porttype_display.resultbean.result}">                     </h:outputtext></td>                 </tr>             </tbody>         </table>     </h:form> 

i don't want “result:” displayed before doaction execute/button clicked.

thanks

use rendered attribute.

<h:panelgroup rendered="#{not empty xxx_porttype_display.resultbean.result}">     <table>         <tbody>             <tr>                 <td align="left">result:</td>                 <td><h:outputtext styleclass="outputtext" id="quotacount1"                     value="#{xxx_porttype_display.resultbean.result}">                 </h:outputtext></td>             </tr>         </tbody>     </table> </h:panelgroup> 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -