Hanine Hanynowsky created FORGE-927:
---------------------------------------
Summary: Add Ajax support for Searching entities.
Key: FORGE-927
URL:
https://issues.jboss.org/browse/FORGE-927
Project: Forge
Issue Type: Feature Request
Components: Scaffold
Affects Versions: 2.0.0.Alpha4
Environment: Any
Reporter: Hanine Hanynowsky
Priority: Optional
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(AjaxBehavioreven
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 speicify if he/she would like to generate these
statements in order to enable Ajax or not. Example:
scaffold-x from World.java --enableAjax true
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira