-
1. Re: CDK vcp-body problem with condition
asrichas2can Nov 18, 2008 10:34 AM (in response to asrichas2can)Now I understood the problem.
When the code generators finde the vcp:body-Tag, it stopps writing the code into doEncodeBegin() and starts with doEncodeChildren().
So there are if-statement starting before the body and ending after it, then the closing } ends in a different method and causes an error.
It replaced this by separate if-clause. But there are 2 disadvantages:
[list=]
Some xml thinks now there are unbalanced tags, because a div-Tag is opened in one if-clause and must be closed in another. -
2. Re: CDK vcp-body problem with condition
asrichas2can Nov 18, 2008 10:45 AM (in response to asrichas2can)// Please ignore my previous reply, it is incomplete.
Now I understood the problem.
When the code generators finds the vcp:body-Tag, it stopps writing the code into doEncodeBegin() and starts with doEncodeChildren().
So if there are if-statement starting before the body and ending after it, then the closing } ends in a different method and causes an compiler error.
I replaced this by separate if-clause. But there are 2 disadvantages:Some xml parser thinks now there are unbalanced tags, because a div-Tag is opened in one if-clause and must be closed in another. How can I disabled this well-formed checker?
The other problem is that I define a condition variable in a jsp-scriptlet. Because the visibility of this scriptlet ends in doEncodeBegin() but the value would be needed also in doEncodeEnd(), I have to repeat the code, which is not very readable. -
3. Re: CDK vcp-body problem with condition
nbelaevski Nov 20, 2008 8:57 PM (in response to asrichas2can)"AsRichAs2Can" wrote:
Some xml parser thinks now there are unbalanced tags, because a div-Tag is opened in one if-clause and must be closed in another. How can I disabled this well-formed checker?
Use ResponseWriter#startElement/endElement in scriptlet to handle this."AsRichAs2Can" wrote:
The other problem is that I define a condition variable in a jsp-scriptlet. Because the visibility of this scriptlet ends in doEncodeBegin() but the value would be needed also in doEncodeEnd(), I have to repeat the code, which is not very readable.
Use c:set tag and org.ajax4jsf.renderkit.ComponentVariables class to pass variables between methods. Check source of this project: http://anonsvn.jboss.org/repos/richfaces/trunk/ui/componentControl