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 ForumsClientAPIClientAPIproblem with DNNTextSuggest in templated controlsproblem with DNNTextSuggest in templated controls
Previous
 
Next
New Post
10/2/2006 10:11 AM
 
Hi,

The scenario is as follows, I have a GridView and on the footer is the "Add" option where I choose a dropdown element to be added to the gridview. like a category selection for the actual element shown.

Now the category list has grown hugue and it is time for using the DNNTextSuggest...

But hey, it looks like it's not working well if it's not placed on the DNN usercontrol root... if we put it inside a gridView as a templated field it doesn't reference it right...

when I type anything appears a javascript popup with the message "404 - control not found"...


We have  the following code for the populate on demand event:

protected void DNNTextSuggestCamp_PopulateOnDemand(object source, DotNetNuke.UI.WebControls.DNNTextSuggestEventArgs e)
{
 DNNTextSuggest DNNTextSuggestCtl;
 DNNTextSuggestCtl = (DNNTextSuggest)((gvAgrupCamp.FooterRow.Cells[3].FindControl("DNNTextSuggestCamp")));
 PopulateList(e.Nodes, e.Text, DNNTextSuggestCtl);
}



the findcontrol method of referencing the usercontrol is working right with other usercontrols so I think it's a javascript problem of any kind..

I attach the rest of the code at the end of the post, as it might be interesting it is an adaptation to c# of the Michael Washington article.
http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1067/Default.aspx

Ah, the code works fine if I reference directly the DNNTextSuggest control on the usercontrol root.
protected void MyDNNTextSuggest_PopulateOnDemand(object source, DNNTextSuggestEventArgs e)
{
   PopulateList(e.Nodes, e.Text, this.MyDNNTextSuggest);
}

The code:
            private void PopulateList(DNNNodeCollection objNodes, String strText, DNNTextSuggest DNNTextSuggestCtl)
            {
                DNNNode o;
                DataTable dt = GetData();
                String strText2 = strText.Replace("[", "").Replace("]", "").Replace("'", "''");
                dt.CaseSensitive = DNNTextSuggestCtl.CaseSensitive;

                DataRow[] Drs = dt.Select("name like '" + strText2 + "%'");
                foreach (DataRow dr in Drs)
                {
                    if ((DNNTextSuggestCtl.MaxSuggestRows == 0) ||
                            (objNodes.Count < DNNTextSuggestCtl.MaxSuggestRows + 1))
                    {
                        o = new DNNNode((String)dr["name"]);
                        o.ID = (String)dr["id"];
                        objNodes.Add(o);
                    }
                }

            }
            private DataTable GetData() {
                DataTable dt = new DataTable();
                dt.Columns.Add(new DataColumn("id", System.Type.GetType("System.String")));
                dt.Columns.Add(new DataColumn("name", System.Type.GetType("System.String")));
               
                AddRow(1, "name1", dt);
                AddRow(1, "name12", dt);
                AddRow(1, "name1234", dt);
                AddRow(1, "name13", dt);
                AddRow(1, "name134", dt);
                AddRow(1, "name14", dt);
                AddRow(1, "name125", dt);
                AddRow(1, "name12345", dt);

                return dt;
            }
            private void AddRow(int ID, String Name, DataTable dt)
            {
                DataRow dr = dt.NewRow();
                dr["id"] = ID;
                dr["name"] = Name;
                dt.Rows.Add(dr);
            }


 
New Post
10/2/2006 2:14 PM
 

This has more to do with the clientcallback architecture than it does with the control.  The question to ask, is at what point in the page's lifecycle are your conrols created.  If the answer is sometime after the Init event, then the callback will not be able to find the control.

Another user has also expressed interest in making the DNNLabelEdit control work inside a templated control. 

These things will be possible once my updated callback architecture gets added, which will allow you to determine at what point the callback "short-circuits".

Note:  I will also need to update the textsuggest control to allow for this property... 


 
New Post
10/3/2006 4:01 AM
 
Thanks for your fast response!!

Well, we will wait for it. By now we will use it stand-alone ;)

Great job!!
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIproblem with DNNTextSuggest in templated controlsproblem with DNNTextSuggest in templated controls


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