You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2023/07/05 14:16:15 UTC
[myfaces-tobago] branch main updated: refactor(demo): ajax input field example
This is an automated email from the ASF dual-hosted git repository.
hnoeth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/main by this push:
new 74c34dbc60 refactor(demo): ajax input field example
74c34dbc60 is described below
commit 74c34dbc60a1f3abc59a3c171e7cd3105cb7efb6
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Jul 5 16:15:03 2023 +0200
refactor(demo): ajax input field example
---
.../src/main/webapp/content/010-input/10-in/In.xhtml | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/10-in/In.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/10-in/In.xhtml
index 722b651a0e..936e8c3b74 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/10-in/In.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/010-input/10-in/In.xhtml
@@ -95,18 +95,16 @@
<tc:section label="Ajax">
<p>The output field in this example, displays the given value on the server.
- With <code class="language-markup"><f:ajax render="outputAjax" listener="\#{inController.update}"/></code>,
+ With <code class="language-markup"><f:ajax event="input" render="outputAjax" listener="\#{inController.update}"/></code>,
the output field will be rerendered, after the value has been changed.
- This is because <code>outputAjax</code> is the id of the <code><tc:out/></code> tag.
- and the default event for <code class="language-markup"><tc:in/></code> is <code>change</code>.
Additional, the <code>listener</code> attribute is set. The given method is called after the input field
loose focus.</p>
- <tc:in id="inputAjax" label="On Change" value="#{inController.changeValue}">
+ <tc:in id="inputAjax" label="Input" value="#{inController.changeValue}">
<f:facet name="before">AJAX</f:facet>
<f:facet name="after">on change</f:facet>
- <f:ajax render="outputAjax" listener="#{inController.update}"/>
+ <f:ajax event="input" render="outputAjax" listener="#{inController.update}"/>
</tc:in>
- <tc:out id="outputAjax" label="On Server" value="#{inController.changeValue}"/>
+ <tc:out id="outputAjax" label="Output" value="#{inController.changeValue}"/>
</tc:section>
</ui:composition>