function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChamizChamiz 

Problem with using greater than sign in conditions

There is a problem in using ">" sign in the if conditions. 

Here the sample code.

 

I  have created a empty component 

 

<!------- myComponent ------------>
<apex:component>
<apex:componentBody />

</apex:component>

 

and code of the visualforce page 

 

<apex:page renderAs="html" showheader="false">
 <c:myComponent>
 <apex:outputText rendered="{!(3>2)}" />

 </apex:page> 

 

 

Following error occurs when I'm trying to save the page.

 

Error: The element type "apex:componentReference" must be terminated by the matching end-tag "</apex:componentReference>"

 

But when I close the "apex:outputText" tag as </apex:outputText>

Instead of self closing page does not show any error. 

 

 

<apex:page renderAs="html" showheader="false">
 <c:myComponent>

 <apex:outputText rendered="{!(3>2)}"></apex:outputText>
 </c:myComponent>
 

 </apex:page>  

 

Can you explain this behavior ? 

 

 

 

 

Message Edited by Chamiz on 08-31-2009 10:00 PM
lvivaninlvivanin

Try this

 

<apex:page > <apex:outputText value="Hello world!" rendered="{!(3>2)}" escape="false" ></apex:outputText> </apex:page>

 

 

 

TehNrdTehNrd

Or...

 

 

<apex:outputText rendered="{!(2<3)}"></apex:outputText>

 

 

 

ChamizChamiz
When <apex:outputText> tag close using </apex:outputText> it woks fine. But when I use self close to end the tag it shows above mentioned error. I want you to expalin this behavior. 
ColinKenworthy1ColinKenworthy1

Chamiz

 

Your first VF page with the error is missing this tag </c:myComponent>

In your second VF page you have have that tag and the page works.

 

You can have the pair <c:myComponent> XXXXXXXX </c:myComponent>

OR self closing <c:myComponent/>

 

But you cannot have just <c:myComponent> on its own.

 

ChamizChamiz

Colin,

 

Sorry <c:myComponent> closing tag is there in my first page. Thats not the reason.