Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Products › Development › Forge › Component - WebControls Register  |  

 

dnn_ct_webcontrols_170x64.gif

 

  Quick Links  
 


  Team Leadership  

Jon Henning

jonhenning.jpg

 


  DotNetNuke Projects  
The DotNetNuke Projects are a special category of platform extensions which are developed by volunteers to conform to the high professional standards mandated by DotNetNuke Corporation. The DotNetNuke Projects are distributed as a standard part of the DotNetNuke core application release offerings.

 


Maximum ASP
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
FCKeditor Project
 


DotNetNuke® Project :: WebControls

The primary purpose of the DotNetNuke WebControls project is to allow developers to utilize feature-rich controls in their applications without the associated cost or distribution restrictions associated with commercial controls. All controls utilize the ClientAPI, and therefore support a rich client side object model, work cross-browser, and utilize AJAX functionality.

The DotNetNuke TreeView control is an open-source ASP.NET WebControl that has a rich client-side object model and supports advanced featuresets like populate on demand and keyboard navigation.
The DotNetNuke Menu control is an open-source ASP.NET WebControl that has a rich client-side object model and supports advanced featuresets like populate on demand and keyboard navigation (soon).
The DotNetNuke Label Edit control is an open-source ASP.NET WebControl that allows any label to be editable on the client where it uses a client-callback to persist the changes. Simply specify a client-side event like onclick to allow the user to edit. It supports RichText and MultiLine editing.
The DotNetNuke Text Suggest control is an open-source ASP.NET WebControl that allows any textbox to suggest the results the user is looking for by dynamically populating a menu of matched items.
The DotNetNuke Tab Strip control is an open-source ASP.NET WebControl that allows a page to be displayed in a tabular manner. It supports 3 rendering modes, including AJAX on-demand loading to allow for optimal performance.
The DotNetNuke ToolBar control is an open-source ASP.NET WebControl that allows a toolbar to be attached to any control.
 


WebControls Project Blog
Mar 2

Posted by: Jon Henning
3/2/2007

Being able to retrieve and set personalization values on the client is a new feature that DNN will support for version 4.5.  Since personalization is something specific to DNN, the code will reside in the DNN specific ClientAPI files of dnncore.js and DNNClientAPI (ClientAPI.vb).  The current state of the dnncore.js is such that it does not utilize namespaces.  Instead it prefixes all function names with __dnn_.  Module developers use these client-side functions when they are calling server-side methods like AddBodyOnloadEventHandler and EnableMinMax, but they are not intended to be used directly from the client.  Since we now wish to expose client-side methods for setting and obtaining personalization values, the creation on a new namespace is in order.
The name of this namespace will be dnncore.  To start out, it will only support personalization methods, but eventually the entire set of dnncore functions will be encapsulated.

Since the core is in the process of adapting the MS AJAX framework, I have decided to start following some of their naming standards, specifially, denoting a method is meant to be private by the prefixing of an _ (underscore).

The first two methods of dnncore that are not private are

dnncore.getUserProp(sNameCtr, sKey, pFunc)
dnncore.setUserProp(sNameCtr, sKey, sVal, pFunc)

sNameCtr - The concept of the naming container serves a similar function to namespaces in our js and .NET code.  It enables our keys to be unique between our modules. 
sKey - The key parameter should also be self explanitory.  It is the property name we are setting or retrieving.
sVal - The setUserProp obviously needs to pass a value to assign. 
pFunc - pointer to function to invoke with results from our async callback.

Pesonalization has existed in the DNN Framework for a long time.  Therefore, most of these parameters should be easy to understand.  The one exception to this is the pFunc parameter.  To explain this it is important to remember is what the first A in AJAX stands for.  Thats right, Asynchronous!  Javascript is a single threaded environment.  There is no way to do some sort of looping structure with something like DoEvents (VB) while we wait for a result.  Some of you are probably saying that the XMLHTTP object that the MS and Mozilla/FireFox offer has a property that allows for async to be true or false.  Additionally, the method the ClientAPI exposes has a parameter for async.  What gives?
Causing javascript to execute a synchronous request to the serer is not a good idea, for it will make the browser appear to be locked up.  Additonally, support for browsers that do not have their own XMLHTTP object would be impossible.  Most AJAX frameworks utilize the hidden IFrame method to utilize postbacks for these browsers.  As you know, the requesting of a webpage is certainly not synchronous.

So how do you obtain a value? 

Code similar to this can be used.

function getUserSettings()
{
    dnncore.getUserProp('MyModule', 'backgroundColor', setValue);
    dnncore.getUserProp('MyModule', 'color', setValue);
}

function setValue(sNameCtr, sKey, sVal)
{
    $('mytextbox').style[sKey] = sVal;
}

function setUserSettings()
{
    dnncore.setUserProp('MyModule', 'backgroundColor', 'yellow');
    dnncore.setUserProp('MyModule', 'color', 'blue');
}

Some of you may be asking, since this is just javascript, how can I be sure that users don't obtain any personalization value they want?  Or, how can I stop them from putting a bunch of junk in these tables, thus bloating my database?

Both of these are legitimate concerns.  The first, however, depends on what module developers are storing in the user's personalization.  Most likely, these are simple settings the user already knows about.  The second, is a bigger concern, and therefore something needs to be done to limit what values can be inserted.  To address both concerns, the DNNClientAPI class now has a method that needs to be used to enable a personalization property to be both set and retrieved.


EnableClientPersonalization(ByVal strNamingContainer As String, ByVal strKey As String, ByVal objPage As Page) As Boolean

strNamingContainer - personalization naming container
strKey - personalization key
objPage - page being rendered (handles callback)
ReturnValue - Returns True when browser supports client-side personalization.  If this returns false, it is your responsibility to ensure that your code still functions, most likely with postbacks.

The core has supported the EnableMinMax method for a long time now.  One of the parameters going into this method is PersonaliztionType.  The supported types consisted of:  None, Page, and Cookie.  A new type has been added to support persisting to Personalization.  Support for this requires an additional overloads to be added to allow the developer to pass in the NamingContainer and Key for personalization.

In addition to module developers having another cool tool in their toolbox, the core has also utilized this feature.  The newly updated control panel currently has min/max capability, that persists between page requests.  This is now persisting with the new overloaded EnableMinMax.

DotNetNuke.UI.Utilities.DNNClientAPI.EnableMinMax(imgVisibility, rowControlPanel, Not IsVisible, Common.Globals.ApplicationPath & "/images/min.gif", _
 Common.Globals.ApplicationPath & "/images/max.gif", DNNClientAPI.MinMaxPersistanceType.Personalization, "Usability", "ControlPanelVisible" & Me.PortalSettings.PortalId.ToString)

Tags:

Re: Client-Side Personalization - A Sneak Peek At 4.5.0

"The current state of the dnncore.js is such that it does not utilize namespaces. Instead it prefixes all function names with __dnn_."

Will clientAPI functions still be availabe via the current function names or will we need to update our dependent code to use the "dnncore" namespace?

By charliesolomon on   3/2/2007

Re: Client-Side Personalization - A Sneak Peek At 4.5.0

If you are referring to code that references dnn. then the answer is a definite no (I work very hard to maintain backwards compatibility). If you have code that calls __dnn something, then you won't need to worry about this release. If that is your case, could you send me an email detailing how you use these methods directly (and which ones) so I can get a better understanding when I decide to refactor these?

By jhenning@solpart.com on   3/2/2007

Re: Client-Side Personalization - A Sneak Peek At 4.5.0

i understand pFunc but i'm still a little unclear as to how to correctly use EnableClientPersonalization and setting/getting personalization values. can you give full example?

By afromobile on   3/2/2007

Re: Client-Side Personalization - A Sneak Peek At 4.5.0

Personalization has been in the core for many years now. The way you access and set these values has not changed. The EnableClientPersonalization simply allows these values to be set and retrieved from the client, like my blog states, via the dnncore.setUserProp.
A full example is the way the Control Panel persists, which you can look at when 4.5 releases.

By jhenning@solpart.com on   3/2/2007
 


Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com
T-WORX, INC.
Professional DotNetNuke Solutions
www.t-worx.com
AppTheory
Professional development for medium to large projects based on the DotNetNuke platform.
www.apptheory.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP