Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputTextarea: autocomplete function does not trigger itemSelect AJAX behavior event. #5071

Closed
Selaron opened this issue Aug 15, 2019 · 4 comments
Labels
🐞 defect Bug...Something isn't working
Milestone

Comments

@Selaron
Copy link
Contributor

Selaron commented Aug 15, 2019

1) Environment

PF 7.0 + 7.1-SNAPSHOT
Mojarra 2.3
OpenWebBeans
Tomcat 9

2) Expected behavior

When using inputTextarea with autocomplete and adding a p:ajax event="itemSelect", the itemSelect event should be triggered by the user selecting a suggested item.

3) Actual behavior

The event simply does not trigger.

4) Steps to reproduce

Select a suggestion from inputTestarea and (don't) wait for the ajax lister to get called.

5) Sample XHTML

<h:form>
	<p:inputTextarea widgetVar="textarea" completeMethod="#{myBean.autoCompleteString}" >
		<p:ajax event="itemSelect" listener="#{myBean.onSelectItem}" />
	</p:inputTextarea>
</h:form>

6) Sample bean

@Named
@ViewScoped
public class MyBean {
public List<String> autoCompleteString(final String filter) {
		final List<String> result = new ArrayList<>();
		for (int i = 0; i < 30; i++) {
			result.add(filter + i);
		}
		return result;
	}

	public void onSelectItem(SelectEvent<String> event) {
		final int i = 8;
	}
}
@melloware melloware added the 🐞 defect Bug...Something isn't working label Aug 15, 2019
@melloware melloware added this to the 7.1 milestone Aug 15, 2019
@Selaron
Copy link
Contributor Author

Selaron commented Aug 15, 2019

Would like to add a pull request if you are not already on it.

Root cause short: InputTextareaRenderer . encodeScript() does not encodeClientBehaviors().

@melloware
Copy link
Member

Please do I will review it when you submit.

@Selaron
Copy link
Contributor Author

Selaron commented Aug 15, 2019

This issue came up in a recent question on StackOverflow.com.

@melloware
Copy link
Member

Thank for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 defect Bug...Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants