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

Add Ajax support for Searching entities.

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Optional
    • 3.x Future
    • 1.3.0.Final
    • Scaffold
    • None

    Description

      For a better user experience, adding ajax support for searching entities will be appreciated.
      Here are the modifications to have such support:
      For example: Let's consider the entity : World.java

      1- change the method public void paginate() to public void paginate(AjaxBehaviorEvent event) in WorldBean.java

      2- in /world/search.xhtml : change =>

      <f:event type="preRenderView" listener="#{helpBean.paginate()}" />

      to =>

      <f:event type="preRenderView" listener="#{helpBean.paginate(this)}" />

      3- embed : <f:ajax /> in <h:inputText fields and/or <h:selecOneMenu ... components.....this way:

      <h:inputText ........>
      <f:ajax event="keyup" render="the_id_of_the_datatable" execute="@form" />
      </h:inputText>

      Remark: the ajax event for SelectOneMenu is click, not keyup.

      4- finally in WorldBean.java, modify the create method, so that it becomes:

      public String create() {

      if (this.conversation.isTransient()) {
      this.conversation.begin();
      } else {
      this.conversation.end();
      }
      return "create?faces-redirect=true";
      }}}

      5- Optional: remove the search button in search.xhtml
      That's all.

      Ideally, Forge should let the developer specify if he/she would like to generate these statements in order to enable Ajax or not. Example:

      scaffold-x from World.java --enableAjax true

      Attachments

        Activity

          People

            Unassigned Unassigned
            hanynowsky_jira Hanine Hanynowsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: