Web Connection
Property Not Found
Gravatar is a globally recognized avatar based on your email address. Property Not Found
  Michael Hogan (Ideate Hosting)
  All
  Nov 23, 2018 @ 02:23pm

I'm in the midst of a WC5.x redesign and I'm having trouble consolidating the required pieces into my template. Getting the error "Property RequiresFormRef is not found" in addition to other property not found errors so I'm assuming I'm not loading or instantiating the wwWebControl class.

The VS template for the page has three includes which I no longer need - so I attempted to move the necessary code into the page itself. They include:

<%@ Page Language="C#" ID="cart01_Page" GeneratedSourceFile="TdsWeb/cart01_Page.prg" %> <%@ Register Assembly="WebConnectionWebControls" Namespace="Westwind.WebConnection.WebControls" TagPrefix="ww" %>

I also had a couple other includes that I removed, but adding them back in does not resolve the issue.

<%@ Register Src="ucHeader.ascx" TagName="ucHeader" TagPrefix="uc1" %> <%@ Register Src="ucLmenu.ascx" TagName="ucLmenu" TagPrefix="uc2" %> <%@ Register Src="ucFooter.ascx" TagName="ucFooter" TagPrefix="uc3" %>

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Nov 23, 2018 @ 06:46pm

That property is part of wwWebControl and if that class is missing nothing really would work because it's the base class for all other controls.

Recent version of Web Connection are no longer loading the WebControlXXX.prg explicitly so you'll have to explicitly add them (or set #DEFINE WWC_LOAD_WEBCONTROLS .T. in wconnect_override.h.

I know you probably don't want to hear this, but if you're doing a redesign you might want to consider switching pages over to MVC style designs since the WebControls model has been deprecated. I've been doing this myself recently with several apps and while it's time consuming it's often relatively quick to move to a the MVC model. But of course it depends on the complexity of the pages - the more interactive the more changes are required as the WebControl pages handle a lot of state management between requests transparently.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Nov 26, 2018 @ 12:13pm

Digging further into this...

In my template page I am attaching an included sub-template (I'm assuming the terminology is understandable) thus:

<%@ Register Src="ucHeader.ascx" TagName="ucHeader" TagPrefix="uc1" %>

and later on:

<uc1:ucHeader ID="ucHeader1" runat="server" SourceFile="tdsweb\ucHeader_control.prg"
            ScriptFile="ucHeader.ascx" />

The ascx file works fine with this content:

<%@ Control Language="c#" ClassName="ucHeader" Inherits="Westwind.WebConnection.WebControls.wwWebUserControlBase" %>

<%@ Register Assembly="WebConnectionWebControls" Namespace="Westwind.WebConnection.WebControls"
    TagPrefix="ww" %>

<ww:wwWebUserControl ID="t1" runat="server" ControlClass="ucHeader" GeneratedSourceFile="TDSweb\ucHeader_control.prg" />

<div id="nav">
    <div id="home" class="nav">
        <a href="https://www.tica.org/">Welcome to TICA</a>
    </div>
    <div id="member" class="nav">
        <a href="https://www.tica.org/members">Members</a>
    </div>
    <div id="online" class="nav">
        <a href="login00.tds">TDS Online</a>
    </div>
</div>

However, when I try to insert the following code, I get the 'Property Not Found' error. I don't know if I'm confusing WC5 with an illegal character or perhaps I'm hitting a string length problem...?

<%@ Control Language="c#" ClassName="ucHeader" Inherits="Westwind.WebConnection.WebControls.wwWebUserControlBase" %>
<%@ Register Assembly="WebConnectionWebControls" Namespace="Westwind.WebConnection.WebControls"
    TagPrefix="ww" %>
<ww:wwWebUserControl ID="t1" runat="server" ControlClass="ucHeader" GeneratedSourceFile="TDSweb\ucHeader_control.prg" />
<div class="container-fluid top-bar-container opacity">
    <header class="TopHeader">
        <div id="s5_menu_wrap">
            <nav class="menu col-md-12 col-lg-8 mx-auto">
                <ul id="s5_nav">
                    <li class="mainParentBtn mainMenuParentBtn">
                        <span class="s5_level1_span1">
                            <span class="s5_level1_span2">
                                        Cat Lovers
                            </span>
                        </span>
                    </li>
                </ul>
            </nav>
        </div>
    </header>
</div>
Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Nov 26, 2018 @ 12:49pm

I'm not sure - it looks like this should be no problem.

Take a look at the generated PRG file and compile that file and see whether it gives you any errors - I suspect that perhaps there's an illegal character (like CHR(0) or other low ASCII char) in there somewhere perhaps? The generated PRG might give a hint.

Just to be sure make sure you copy the exact header from the one that works into the one that doesn't to ensure that header logic is correct. That part is easy to mess up - but it looks right to me. Also you need to CLEAR ALL CLOSE ALL after making changes to control file.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Nov 26, 2018 @ 02:31pm

The problem is with the following:

    <header class="TopHeader">
    </header>

Name collision? If I change <header to <div then it compiles properly. If you can point me to a fix, that would be great.

is an HTML5 tag you may not have bumped into back in WC5.x

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Nov 26, 2018 @ 02:33pm

Can you look at the code and see what's happening there?

The form controls shouldn't be looking at the tags explicitly... it's only looking for specific server tags (ie. tags with prefixes). It'd be interesting to see what code was generated.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Nov 26, 2018 @ 03:10pm

I'd be happy to look - can you give me a hint for what prg**** files I should be looking at?

You do have some special handling in WebPageParser.prg to force that 'fixed ID' for tags...

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Nov 26, 2018 @ 04:20pm

Look in the generated file for the control.

I think the reason is that the name is duplicated? Maybe give the header an explicit id and see if that helps.

<header id="myHeader">
...
</header>

Although - I would think that text would just generate as staticly embedded text.

+++ Rick --

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Nov 26, 2018 @ 04:33pm

Assigning a random ID does not help.

The ucheader_control.prg file is not updated before the error - the problem must occur before or during the rewrite of the prg.

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Rick Strahl
  Rick Strahl
  Nov 26, 2018 @ 04:46pm

I just set up a user control with the same code as you have and added it to a new page and it works without an issue for me... So I think there must be something else going on in the host page.

I think to track this down:

  • Make sure the control works in a new page
  • Simplify the host page
  • Verify that other controls work

also make sure that the source file is generated where you think it should be generated. The way you have it it should exist in a controls folder in the application folder not the web folder. If there is both delete them both and re-run.

I suspect you're right there's a naming conflict somewhere, but without looking at the code tree that's difficult to track down.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Nov 27, 2018 @ 04:11pm

Ahhhh... yes. I see the *_control.prg files now. Clever.

Nevertheless, the control.prg file is not being updated when I use the header tag. It does get updated when I use the div tag.

I see that you are recursively writing that out in webpageparser so I'll trace it through there.

Thanks for pointing me in the right direction.

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Michael Hogan (Ideate Hosting)
  Rick Strahl
  Nov 28, 2018 @ 03:39pm

In webpageparser.parsecontrol, you are creating an loCtl object.

While webpageparser.parsecontrol is processing the lcControlText:

    <header class="TopHeader" id="frustrating">
        <div id="s5_menu_wrap">
            <nav class="menu col-md-12 col-lg-8 mx-auto">
                <ul id="s5_nav">
                    <li class="mainParentBtn mainMenuParentBtn">
                        <span class="s5_level1_span1">
                            <span class="s5_level1_span2">
                                Cat Lovers
                            </span>
                        </span>
                    </li>
                </ul>
            </nav>
        </div>
    </header>

...you are creating an loCtl object.

Since this evaluates to False:

*** Special handling for the page and UserControl
DO CASE 
CASE  llIsWebPage OR  ;
   ( llIsUserControl AND THIS.ParseMode = 2 ) 
...
OTHERWISE 
   *** If controls can be vars we don't need a form reference defined
   *** otherwise we must create the instance on the form
   IF loCtl.RequiresFormRef
      THIS.oResponseDefinitions.Write("   " + lcId + " = null " + CRLF)
   ENDIF
...

Trouble is, there is no loCtl.RequiresFormRef property.

The only places I see that property referenced in WC5.x is in WebControl.prg in the wwWebListItem class and the wwWebControl class.

So at this point I'm out of my depth.

Gravatar is a globally recognized avatar based on your email address. re: Property Not Found
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Nov 28, 2018 @ 11:48pm

Well, wwWebControl is the base class for all controls, so the property should be there via inheritance, so maybe the control that is getting there is not valid in some way?

+++ Rick ---

© 1996-2018