-
1. Re: JSF way to conditionally add attributes
ishabalov Aug 15, 2007 8:21 PM (in response to mgrouch)A least you can use binding and Java API to put anything you need into attributes map. Just remember that it must be serializable.
-
2. Re: JSF way to conditionally add attributes
mgrouch Aug 15, 2007 8:39 PM (in response to mgrouch)I've tried using f:attribute tag inside the component I needed to add attribute to. It didn't work. Is there JSF solution (without coding in Java and doing binding)? This is VERY common problem and there should be
something to do it in JSF page itself...
Might be Seam could provide s:attribute which would actually work
as people expect it to work. -
3. Re: JSF way to conditionally add attributes
mgrouch Aug 15, 2007 8:46 PM (in response to mgrouch)something like
<s:attribute name="#{expr}" value="#{expr4value}" rendered="#{condition}"/>
is needed badly. -
4. Re: JSF way to conditionally add attributes
mgrouch Aug 15, 2007 9:08 PM (in response to mgrouch)I've also tried Gravel's ga:attribute to no avail
-
5. Re: JSF way to conditionally add attributes
matt.drees Aug 16, 2007 12:17 AM (in response to mgrouch)Yeah, I've wondered how to best do this, too.
-
6. Re: JSF way to conditionally add attributes
fhh Aug 16, 2007 3:53 AM (in response to mgrouch)Have you tried the ternary operator?
Regards
Felix -
7. Re: JSF way to conditionally add attributes
pmuir Aug 16, 2007 5:32 AM (in response to mgrouch)As Felix says, ternary operators should be sufficient.
-
8. Re: JSF way to conditionally add attributes
mgrouch Aug 16, 2007 6:22 AM (in response to mgrouch)No ternary operators are not sufficient as in some cases empty attributes
are not allowed. I need ability to insert or skip attribute. -
9. Re: JSF way to conditionally add attributes
mgrouch Aug 16, 2007 6:56 AM (in response to mgrouch)Even worse some attributes do not allow EL expressions at all
so ternary operator is not an option. -
10. Re: JSF way to conditionally add attributes
mgrouch Aug 16, 2007 1:32 PM (in response to mgrouch)Please, help. I wonder why there is no solution for such a common problem.
Thanks -
11. Re: JSF way to conditionally add attributes
mgrouch Aug 16, 2007 11:14 PM (in response to mgrouch)I've reopened the issue
http://jira.jboss.com/jira/browse/JBSEAM-1807 -
12. Re: JSF way to conditionally add attributes
norman.richards Aug 17, 2007 12:35 AM (in response to mgrouch)"mgrouch" wrote:
Even worse some attributes do not allow EL expressions at all
so ternary operator is not an option.
With JBoss EL, you should be able to access any property. -
13. Re: JSF way to conditionally add attributes
mgrouch Aug 17, 2007 8:28 AM (in response to mgrouch)How do I skip an attribute which doesn't allow empty string?
What if I need many possible conditions. Do you think writing long sequence of nested '?' operators is good practice?