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...Module ForumsModule ForumsReportsReportsGenerate report based on query string + AJAX + Employee directoryGenerate report based on query string + AJAX + Employee directory
Previous
 
Next
New Post
8/11/2010 4:36 AM
 

Hi All,

First of all a big thank for all your support and developments on DNN.


I have set up an intranet site with DNN. I now need to add an Employee directory to it.

The idea is that I have an SQL table populated with data from the Active Directory. I can use the reports module to search my employee using a parameter as a query string.

Here is the query:
SELECT 
                * 
FROM
                Staging.dbo.STGEmployee 
WHERE
                EmployeeFirstName like '%'  + @url_Par + '% 
                OR EmployeeLastName like '%'  + @url_Par + '%'

This is working fine.

Now I want to go a step further and reproduce somehow the functionality of Efforty User Directory module: I want to fire that query on each input char in a text box and display the list of employee accordingly.

So here are my questions
1 - How to fire the query from a text box for input and a send button all that in the same page
2 - How to make this in an update panel on the same page so I don’t have to refresh the whole page?
3 - How to make this work on input key without send button?

Many thanks for your suggestions.

Aurélien

 
New Post
8/11/2010 1:21 PM
 
Hello, this is typically done via using an autocomplete ajax element (e.g. one from the ajax toolkit) - http://www.adefwebserver.com/dotnetnukehelp/Misc/Dotnetnuke_AJAX_ControlToolkit.htm is a nice resource for this. As the changes will fire server events you typically wire up the event (e.g. the textchanged event of the textbox) to fire the query that provides the grid data. As to how to get an update panel, DotNetNuke has a supports partial rendering checkbox (that can be set in the dnn manifest also ) -http://www.datasprings.com/Resources/ArticlesInformation/AJAXwDotNetNuke.aspx

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/13/2010 10:31 AM
 
Hi thanks for your return.



For information I did the following on my DNN 5 site:

1 - Add a HTML module to the page. in this module I put a textbox:

Title<input type="texte" id="QueryStg" OnKeyUp="QueryEmployee()" />

Then I had some javascript code to:
a-set the text box value to the value entered before postback
b-build url to call report module with the queryString

<body onload="getQueryString()">
<script language="JavaScript">
function getQueryString(){
document.getElementById("QueryStg").value = gup('par');
document.getElementById("QueryStg").focus();
}

function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}

function QueryEmployee(){
var obj = document.getElementById("QueryStg");
var form = document.getElementById("Form");
var url = "http://mysite.corp/intranet/test.aspx?par=" + obj.value;
form.action=url;
form.submit();
}

function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars[QueryStg];
}
</script>


2 - Add the report module set up to select data based on the par parameter in the url

At this point I have to reload the page on every key up.

Is there a way to add an update panel for both HTML and Reports modules? The idea is to avoid pure dev as much as possible and find a free solution.

Many thanks,
 
New Post
8/13/2010 6:18 PM
 
you can go and edit the module definitions for the individual module controls (via host->module definitions) and set "support partial rendering". Please note, I do not advise this for html as it will break file uploads (which can't occur under ajax) - it may also effect the report module but I've not tested this.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsGenerate report based on query string + AJAX + Employee directoryGenerate report based on query string + AJAX + Employee directory


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