-
1. Re: Custom Facelets tag ignored inside a4j:repeat
ilya_shaikovsky Jun 16, 2010 9:19 AM (in response to xck3001)Does my tag have to extend some Ajax4JSF class in order to work inside the A4J loop?
No. a4j:repeat - could be used for f: and h: and myfaces tags for example and them not depends on any a4j classes.
So need to look more to your impl.
-
2. Re: Custom Facelets tag ignored inside a4j:repeat
xck3001 Jun 16, 2010 9:27 AM (in response to ilya_shaikovsky)We noted that is does not depend on any attribute/parameter that I pass inside the tag, because even without any attribute the encodeAll() is not triggered.
I will try to create a very small piece of an example to simplify the examination.
-
3. Re: Custom Facelets tag ignored inside a4j:repeat
xck3001 Jun 17, 2010 4:21 AM (in response to xck3001)BTW, in the "real-world" page we use dozens of h:outputText inside the a4j:repeat, so this indeed works. Maybe my custom component is just something missing.
I made an reduced example which also reproduces this error:
Custom component:
@FacesComponent("testComponent") public class TestComponent extends UIComponentBase { @Override public String getFamily() { return null; } @Override public void encodeAll(FacesContext ctx) throws IOException { ctx.getResponseWriter().write("test"); } }
Taglib:
<tag> <tag-name>test</tag-name> <component> <component-type> testComponent </component-type> </component> </tag>
Facelet:
<f:view contentType="text/html"> <head> </head> <body> <a4j:repeat value="#{testBean.items}" var="item"> #{item} <test:test /> <br/> </a4j:repeat> Output below list:<test:test /> </body> </f:view>
Managed bean, just created for using inside a4j:repeat loop:
@ManagedBean public class TestBean { private List<String> items; @PostConstruct public void init() { List<String> items = new ArrayList<String>(); items.add("item1"); items.add("item2"); items.add("item3"); this.items = items; } public List<String> getItems() { return items; } }
This will generate the following output (note that the tag outside of the a4j:repeat is rendered correctly):
item1 item2 item3 Output below list:test
-
4. Re: Custom Facelets tag ignored inside a4j:repeat
ilya_shaikovsky Jun 17, 2010 5:04 AM (in response to xck3001)probably some problems with namespace definition or taglib declaration. In order to check follow simple steps:
- open test page
- call "show page HTML source" from browser menu
- verify if there are
<test:test />
tags in generated HTML. If them present - tag was just not identified.
-
5. Re: Custom Facelets tag ignored inside a4j:repeat
xck3001 Jun 17, 2010 5:34 AM (in response to ilya_shaikovsky)The tag is resolved, because you can see the "test" output at the last line. Also, here is the HTML source:
<body> item1 <br /> item2 <br /> item3 <br /> Output below list:test </body>
-
6. Re: Custom Facelets tag ignored inside a4j:repeat
xck3001 Jun 22, 2010 6:32 AM (in response to xck3001)Can I provide any additional information about the problem?
-
7. Re: Custom Facelets tag ignored inside a4j:repeat
ilya_shaikovsky Jun 28, 2010 7:26 AM (in response to xck3001)sample in war with java sources would be great.