R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
IIF ISINROLE ACTION confirmation dialog and ESCAPING
Last Post 01 Sep 2006 05:58 PM by bgates. 0 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
arijkensUser is Offline
New Member
New Member
Posts:18

--
12 Jul 2008 01:26 PM  
Hi,

After a lot of reading, trial-and-error and strong coffee I found some solutions for issues with IIF, ISINROLE, ACTION, Confirmation and ESCAPING. I posted a few topics concerning this and after reading a lot of other forum topics I realised that I'm not the only one facing these issues.

So, here are the solutions working for me. Please note: I am a new ListX user (two weeks now) AND not an expert in HTML/JAVE/DNN. So any remarks/ additions are welcome.

Greetings,

Arjan


Example 1: Link Anchor with ACTION
This is pretty straightforward and well documented in the help file. I only put it here to be complete...The action is performed when using the link.
<a {ACTION,[FileID],OpenFile,,Message} href='#'>Anchor with ACTION</a>

Example 2: Link Anchor with ACTION and Confirmation dialog
The action is performed only when the user confirms, otherwise nothing happens.
<a onclick="if(window.confirm('sure?')) {return true;} return false;" {ACTION,[FileID],OpenFile,,Message} href='#'>Anchor with ACTION and Confirmation dialog</a>

Example 3: Link Anchor with Role checking and confirmation dialog
The anchor will only be visible if the user is a member of role ROLENAME. When using the link a confirmation dialog pops up. For visibility purposes I did not enter more javacode in this example.
{IIF,([FORMAT,"ROLENAME",{ISINROLE}]),"<a onclick=\"if(window.confirm('sure?'))\{ return true;\} return false;\" href='#'>Anchor with Role checking and Confirmation dialog</a>",""}

Example 4: Link Anchor with Role Checking and ACTION
The anchor will only be visible if the user is a member of role ROLENAME. When using the link, the action will be executed.
{IIF,([FORMAT,"ROLENAME",{ISINROLE}]),"<a \{ACTION,[FileID],OpenFile,,Message\} href='#'>Anchor with Role Checking and ACTION</a>",""}

Example 5: Link Anchor with Role checking, ACTION and Confirmation dialog
The anchor will only be visible if the user is a member of role ROLENAME. When using the link, a confirmation dialog pops up and only if confirmed the action will be executed.
{IIF,([FORMAT,"ROLENAME",{ISINROLE}]),"<a onclick=\"if(window.confirm('sure?'))\{ return true;\} return false;\" \{ACTION,[FileID],OpenFile,,Message\} href='#'>Link Anchor with Role checking, ACTION and Confirmation dialog</a>",""}

Remember to enable (1.9) Use Compound Conditions and Math in IIF tags in the General menu for proper using IIF
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share