jatl
jatl copied to clipboard
Skip rendering elements
Hello Adam,
another question what I have: it is possible to skip elements? My use case:
I have some functionality to check if there a permission to call controller.
But in menu I will skip tag, for example:
.ul().id("menu")
.li().havePerm("isAnonym").a().reverse(LOGIN).tr("Login").end(2)
...
If the user does not have permission, I don't will show Login-Link. Of course,
I can do this with if-statement, but then is not fluent :)
Best regards,
Anton
Original issue reported on code.google.com by [email protected]
on 22 Jun 2012 at 9:16
Interesting.
I could certainly add something to perhaps to toggle muting the output .
Perhaps builder.write(boolean b) ? The question is when is it legal to mute or
what happens exactly.
However I could see this as potentially confusing and bug prone.
I'm partly waiting for Java 8 (I know its a long time away) to add better
conditional support through closures to enable more fluent style.
Let me think about it some more and feel free to add possible implementation
ideas.
Original comment by [email protected]
on 23 Jun 2012 at 12:36
Original comment by [email protected]
on 10 Oct 2012 at 2:32
- Added labels: Type-Enhancement
- Removed labels: Type-Defect