Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPITestSuggest problem - PopulateOnDemand event handler working but no list renderedTestSuggest problem - PopulateOnDemand event handler working but no list rendered
Previous
 
Next
New Post
11/17/2009 12:43 PM
 

I followed Michael's tutorial - http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/1067/Using-the-DNN-Text-Suggest-Control.aspx

Everything appears to be set up correctly, but no list is ever rendered under the textbox. If I debug with Visual Studio however I can see my PopulateOnDemand event handler being called and a collection of nodes being built.

Here's the code from my ASCX control:

< %@ Register TagPrefix="dnn" Assembly="DotNetNuke.WebControls" Namespace="DotNetNuke.UI.WebControls" %>
< dnn:DNNTextSuggest ID="txtAddItemToOrder" runat="server" OnPopulateOnDemand="txtAddItemToOrder_PopulateOnDemand"></dnn:DNNTextSuggest>

And here's my code behind:

        Protected WithEvents txtAddItemToOrder As DotNetNuke.UI.WebControls.DNNTextSuggest

        Public Sub txtAddItemToOrder_PopulateOnDemand(ByVal sender As Object, ByVal e As DotNetNuke.UI.WebControls.DNNTextSuggestEventArgs) Handles txtAddItemToOrder.PopulateOnDemand
            PopulateList(e.Nodes, e.Text)
        End Sub

        Private Sub PopulateList(ByVal objNodes As DNNNodeCollection, ByVal strText As String)

            Dim o As DNNNode
            Dim dt As DataTable = Orders.GetAvailableProductSKUs

            'strip out troublesome chars for Select below
            strText = strText.Replace("[", "").Replace("]", "").Replace("'", "''")
            dt.CaseSensitive = Me.txtAddItemToOrder.CaseSensitive
            Dim drs() As DataRow = dt.Select("ProductSKU like '%" & strText & "%'")
            Dim dr As DataRow
            For Each dr In drs
                If Me.txtAddItemToOrder.MaxSuggestRows = 0 OrElse objNodes.Count < (Me.txtAddItemToOrder.MaxSuggestRows + 1) Then
                    o = New DNNNode(CStr(dr("ProductSKU")))
                    o.ID = CStr(dr("ProductSKU"))
                    objNodes.Add(o)
                End If
            Next
        End Sub

At the end of the PopulateList procedure, objNodes contains a number of nodes and control is passed back to the user, but nothing appears. What am I missing?

I am running DNN 4.9.5 with DotNetNuke.WebControls.dll 1.5.3.20116

I am probably misunderstanding something, but can you explain how the above code (from Michael's tutorial) could work when, after the objNodes collection is filled, nothing is done with objNodes? objNodes doesn't get passed back to anything after PopulateList completes.

 
New Post
11/17/2009 12:48 PM
 

I notice someone else reported the same problem: DNNTextSuggest question

Sorry, I don't have a public URL I can give out.

 
New Post
11/17/2009 2:23 PM
 

The code looks fine to me.  the nodes object is not needed to be passed anywhere since it is an object reference passed in.  When you modify it in your code, the object reference that you were given from the control is updated (ByVal, ByRef has no effect here as ByVal simply adds another ref to your object). 

I would suggest getting Fiddler to see what data is being passed back and forth.  Note:  don't user localhost to load your site, use your machine name to get fiddler to see the traffic.  Please post the request/response from this so we can verify the data is being sent back.


 
New Post
11/18/2009 6:19 AM
 

OK, here is a trace from Fiddler:

POST /Site-Admin/Orders/OrderID/38/CustomerID/44/ModuleID/372/Custx/0.aspx?StartDate=18%2f10%2f2009&EndDate=18%2f11%2f2009& HTTP/1.1
Accept: */*
Accept-Language: en-gb
Referer: http://fl-dev.company.com/Site-Admin/Orders/OrderID/38/CustomerID/44/ModuleID/372/Custx/0.aspx?StartDate=18%2f10%2f2009&EndDate=18%2f11%2f2009
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8)
Host: fl-dev.company.com
Content-Length: 103
Connection: Keep-Alive
Pragma: no-cache
Cookie: .ASPXANONYMOUS=Fyh5BWGOygEkAAAAZjg5NjczOGUtZjRiZC00Mzc1LWEyMjItY2E1NmEwMTA5OGI10; __utma=120844255.1376878736.1256829489.1258472455.1258542535.6; __utmz=120844255.1256829489.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); Store_CartID=859da945-8022-4f5f-bfbf-58ea11d9dd18; MyViewedItems=1134,1145; ASP.NET_SessionId=mgmqax45i5bzrczyvm2man55; language=en-GB; __utmb=120844255; __utmc=120844255; authentication=DNN; .DOTNETNUKE=DFC4A093F4BF470BEE7FFA07679AE677FDB067B0F7251F4C3350298F34A5C8063559877E182DED536DBE14600E83ECCBC736BA1C9B7A692F3E8CF18DFD1B9D3BF65AEDBFC8F73798CC95FE08EC332BBC

__DNNCAPISCI=txtAddItemToOrder dnn_ctr372_ViewEditOrders_OrderDetails1_txtAddItemToOrder&__DNNCAPISCP=a
HTTP/1.1 200 OK
Date: Wed, 18 Nov 2009 11:10:37 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
__DNNCAPISCSI: 200
__DNNCAPISCSDI:
Set-Cookie: portalaliasid=BE32431B08261B518C1F7D096767BB05857DB463E04B8C241281271DE4EBA0BFBC0F946050ED0D4FFC3B6D158D40F651DFC47B4D59A002CC6E2C73C6E0E0A7B38B8DC35D629309717853FEAE7DB1BC71; expires=Wed, 18-Nov-2009 11:11:37 GMT; path=/; HttpOnly
Set-Cookie: portalroles=; expires=Wed, 18-Nov-2009 11:11:37 GMT; path=/; HttpOnly
Set-Cookie: language=en-GB; path=/; HttpOnly
Cache-Control: public
Content-Type: text/html; charset=utf-8
Content-Length: 1502

<root id="dnn_ctr372_ViewEditOrders_OrderDetails1_txtAddItemToOrder"><n txt="620202700003_MLT (Multi, 36) 0 available, price: 465.00" id="620202700003_MLT (Multi, 36) 0 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 38) 0 available, price: 465.00" id="620202700003_MLT (Multi, 38) 0 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 40) 1 available, price: 465.00" id="620202700003_MLT (Multi, 40) 1 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 42) 1 available, price: 465.00" id="620202700003_MLT (Multi, 42) 1 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 44) 0 available, price: 465.00" id="620202700003_MLT (Multi, 44) 0 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 46) 0 available, price: 465.00" id="620202700003_MLT (Multi, 46) 0 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 48) 0 available, price: 465.00" id="620202700003_MLT (Multi, 48) 0 available, price: 465.00" /><n txt="620202700003_MLT (Multi, 50) 0 available, price: 465.00" id="620202700003_MLT (Multi, 50) 0 available, price: 465.00" /><n txt="900202700002_ASS (Assorted, 36) 0 available, price: 475.00" id="900202700002_ASS (Assorted, 36) 0 available, price: 475.00" /><n txt="900202700002_ASS (Assorted, 38) 0 available, price: 475.00" id="900202700002_ASS (Assorted, 38) 0 available, price: 475.00" /><n txt="900202700002_ASS (Assorted, 40) 0 available, price: 475.00" id="900202700002_ASS (Assorted, 40) 0 available, price: 475.00" /></root>

 

 
New Post
11/20/2009 9:10 AM
 

So it looks like the response is coming down.  What is a bit odd is the id you are using.  Try using a simpler ID (like a number) and see if that helps.


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPITestSuggest problem - PopulateOnDemand event handler working but no list renderedTestSuggest problem - PopulateOnDemand event handler working but no list rendered


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out