Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1211

Adding a Reset button to the JSF search pages

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • 3.x Future
    • 1.4.1.Final
    • Scaffold
    • None

    Description

      At the moment, when you generate JSF pages, the search.xhtml have a Search and a Create New button :

      <h:panelGroup styleClass="buttons">
        <h:commandLink value="Search" action="#{bookBean.paginate}" styleClass="btn btn-primary"/>
        <h:commandLink value="Create New" action="#{bookBean.create}" styleClass="btn btn-primary"/>
      </h:panelGroup>
      

      With long search forms it would be handy to have a Reset button that would clear the form. A simple <h:commandButton type="reset" /> will not work, so you would have to have an extra method that clears the example, something like :

      <h:panelGroup styleClass="buttons">
        <h:commandLink value="Search" action="#{bookBean.paginate}" styleClass="btn btn-primary"/>
        <h:commandLink value="Reset" action="#{bookBean.reset}" styleClass="btn btn-primary"/>
        <h:commandLink value="Create New" action="#{bookBean.create}" styleClass="btn btn-primary"/>
      </h:panelGroup>
      

      The bookBean.reset method could just do a new on example (or initialise with default values for example)

      Attachments

        Activity

          People

            Unassigned Unassigned
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: