Search the Blog Minimize
spacer
DNNDev Blogs: Most recent blog entries Minimize

Understanding the XMod AddUserPicker Control

Jul 30

Written by:
7/30/2009 8:25 AM  RssIcon

The contol is used to select a user from the current portal and assign the user as the one that initially created the record. This control is not required. XMod normally automatically assigns the user without any intervention on your part. However, this control has been added for those situations where administrators or moderators create a record on behalf of a user. This is especially useful in combination with XMod's ability to show a user only those records he/she has added. But in can cause some load time issues if not configured correctly...

In most of our DNN Professor XMod applications, we create an Administration panel on the top of the XMod form.

 This is accomplished by adding the Xmod form control named panel .

The control has an attrbute named showroles. The showroles attribute is set to specific DNN security roles that have permission to view this section of the form.

An example of this would be showroles="Administrators,Editors"

Among panel options that are specific to each of our applications is included the Xmod control.

XMod adduserpicker control

Our users find it very useful for the purpose of initially propagating listings and then assigning these listings to a specific user. Once the listing is assigned to a user, that user now has control to edit the listing.

The control has an attribute named roles. By default it will return all registered users on your DNN portal.

In most cases this is not an issue. But, consider a site that has over 30,000 registered users. Every time that a form is initiated to add a new listing or update a listing the database has to traverse all 30,000 users. This can create quite a penalty in form load time.

In most cases, you have not assigned all registered users to have the ability to add listings. For example, in our Business Directory application, most users assign Administrators and one additional security role to have this ability. This security role assignment is on the security tab when you opt to Configure Xmod Module from the Xmod module action menu.

XMod security settings

By setting the roles attribute to only return users that match the roles with permission to add records, you can greatly reduce the load time of the control.

Here's how:

By default the roles attribute is set to roles=""

An example of a basic control setup would look like this:

adduserpicker ref="AddUser" displayfield="userfullname" roles=""

Change the roles attribute to only return a subset of users.

adduserpicker ref="AddUser" displayfield="userfullname" roles="Subscribers"

You can additionally add additional roles to this attribute by separating the roles using a comma.

adduserpicker ref="AddUser" displayfield="userfullname" roles="Subscribers,Editors,Administrators"

You would also have the option of removing the control from the form but the ability to assign the record to another user would no longer be available.

To learn more about the control  click here.

To learn more about XMod productivity using DNN Professor applications click here.

Enjoy,
Buck

Tags:
Categories:
Location: Blogs Parent Separator Buck Anderson

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
spacer
dummy