The WOComponent parser chokes because that is invalid XML and also a bad 
practice in general [much like using inline bindings and ognl :)] 

If you want to optionally include a div tag, there’s a dynamic element for 
that.  You should use WOGenericContainer with an omitTags binding on the 
condition.

SideMenuDiv: WOGenericContainer {
        elementName = “div”;
        omitTags = hasNoSideMenu;
}

The whole thing looks like it be refactored into a subcomponent that has 
WOComponentContent. Then you could use that with a WOSwitchComponent and switch 
out different components for side menu/no side menu.

Something like

—SideMenuWrapper.html
<div id="mainwrapper">
        <webobject name=“SideMenu"/>
        <div id="maincontent">
                <webobject name=“Content”/>
        </div>
</div>
—SideMenuWrapper.wod
Content: WOComponentContent {}
SideMenu: … and so on

—BlankWrapper.html
<webobject name=“Content”/>
—BlankWrapper.wod
Content: WOComponentContent {}

—SamplePage.html
<!DOCTYPE html>
<html>
        <webobject name=“HeaderSection”/>
        <webobject name=“Body”>
                <div id=“wrapper”>
                        <webobject name=“TopMenuSection”/>
                        
                        <webobject name=“SideMenuSwitch”>
                                <div id=“maincontent>
                                ...
                                </div>
                        </webobject>

                        <webobject name=“BottomMenuSection”/>
                </div>
        </webobject>
</html>
—SamplePage.wod
SideMenuSwitch: WOSwitchComponent {
        WOComponentName = menuWrapperName; //Returns either “SideMenuWrapper” 
or “BlankWrapper”
        //…other bindings go here
}
…and so on


On May 2, 2014, at 9:52 AM, James Kevin Eaves <[email protected]> wrote:

> I am trying to port my old WebObjects to Wonder/WOLips and am getting errors 
> in the HTML.
> The error is that about the <WEBOBJECTS>,  </WEBOBJECTS>, <DIV> and </DIV>  
> tag is missing.
> First, the code is correct. I think that the parser is not pairing the 
> correct open and close tags.
> I am using Eclipse 4.3.2 and Wolips 4.3.2.
> I have a lot of DIV and /DIV tags that are inside of conditional WEBOBJECTS 
> tags.
> 
> 
> Here is the sample code.
> 
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
> "http://www.w3.org/TR/html4/loose.dtd";>
> <html>
>    <WEBOBJECT NAME="HeaderSection"></WEBOBJECT>
>   
>    <WEBOBJECT NAME=Body1>  
>   
>       <div id="wrapper">
>   
>          <WEBOBJECT NAME="TopMenuSection"></WEBOBJECT>
>         
>          <WEBOBJECT NAME="HASSideMenuConditional">
>             <div id="mainwrapper">
>             <WEBOBJECT NAME="SideMenu"></WEBOBJECT>
>         
>             <div id="maincontent">  <---- ERROR Missing </div> tag
>         
>          </WEBOBJECT>
>         
>          <!-- Inform begin -->          
>         
>          <div id="maininfowrapper">
>             <! -- some code goes here -->
>          </div>
>         
>          <!-- Inform end -->
>         
>          <!-- Main end-->
>          <WEBOBJECT NAME="HASSideMenuConditional">  <---- ERROR Missing 
> <WEBOBJECT> tag
>             </div> <!-- close maincontent>
>             </div> <!-- close mainwrapper>
>          </WEBOBJECT>
>         
>          <WEBOBJECT NAME="BottomMenuSection"></WEBOBJECT>
>   
>       </div><!--end wrapper-->  <---- <div> start tag is not found
>   
>       <WEBOBJECT NAME="FooterSection"></WEBOBJECT>
>   
>    </WEBOBJECT>  <---- <WEBOBJECT> start tag is not found
> 
> </html>
> 
> 
> --
> Kevin Eaves            <*}}}><
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to