We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've created bean Validation for validation purposes
@RequestScoped @Named("Validation") public class Validation { public boolean hasViolations(String field) { // implementation details } public List<String> getViolations(String field) { // implementation details } }
I've tried to use method getViolations in my tag
{@java.lang.String field} {#if inject:Validation.hasViolations(field)} <div class="mb-3 alert alert-danger d-flex align-items-center" role="alert"> <svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Danger:"> <use xlink:href="#exclamation-triangle-fill"/> </svg> {#each inject:Validation.getViolations(field)} <div>{it}</div> {/each} </div> {/if}
And I've got the following exception:
io.quarkus.qute.TemplateException: Found template problems (1): [1] Incorrect expression found: {field} - Unsupported iterable type found: java.lang.String - at tags/validation.html:8
It works only with small workaround (define local variable using let)
{@java.lang.String field} {#if inject:Validation.hasViolations(field)} <div class="mb-3 alert alert-danger d-flex align-items-center" role="alert"> <svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Danger:"> <use xlink:href="#exclamation-triangle-fill"/> </svg> {#let violations=inject:Validation.getViolations(field)} {#each violations} <div>{it}</div> {/each} {/let} </div> {/if}
No response
uname -a
ver
java -version
mvnw --version
gradlew --version
The text was updated successfully, but these errors were encountered:
/cc @mkouba
Sorry, something went wrong.
Qute parser - loop - fix validation of virtual method params
5f1210e
- resolves quarkusio#23286
@kucharzyk this PR should fix the problem.
a6ce381
- resolves quarkusio#23286 (cherry picked from commit 5f1210e)
mkouba
Successfully merging a pull request may close this issue.
Describe the bug
I've created bean Validation for validation purposes
I've tried to use method getViolations in my tag
And I've got the following exception:
It works only with small workaround (define local variable using let)
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: