]
George Gastaldi updated FORGE-927:
----------------------------------
Affects Version/s: 1.3.1.Final
(was: 2.0.0.Alpha4)
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: 1.3.1.Final
Environment: Any
Reporter: Hanine Hanynowsky
Priority: Optional
Fix For: 2.x Future
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 =>
bq. {{<f:event type="preRenderView"
listener="#{helpBean.paginate()}" />}}
bq. to =>
bq. {{<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:
bq. {{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*}}
--
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: