[forge-issues] [JBoss JIRA] (FORGE-927) Add Ajax support for Searching entities.

Hanine Hanynowsky (JIRA) jira-events at lists.jboss.org
Tue May 28 20:37:54 EDT 2013


     [ https://issues.jboss.org/browse/FORGE-927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hanine Hanynowsky updated FORGE-927:
------------------------------------

    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(AjaxBehavioreven event){} }} in *WorldBean.java*

2- in */world/search.xhtml* : change =>  
bq. {{<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:

bq.{{<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*}}

  was:
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 =>  
bq. {{<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:

bq.{{<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*}}


    
> 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 =>  
> bq. {{<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:
> bq.{{<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: http://www.atlassian.com/software/jira


More information about the forge-issues mailing list