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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...IconAPI - IconKey not showingIconAPI - IconKey not showing
Previous
 
Next
New Post
1/27/2012 12:51 AM
 

Hi,

I've been trying out the IconKey attribute on my dnn:CommandButton controls, and I have noticed an interesting oddity.

If my IconKey attribute appears too far down the line of attributes on my control, then the image does not appear. Some quick & dirty tests are hinting that if it appears in the 5th or later position, then it won't render. But, if it appears earlier, then it does.

It's looking strange to me, so I'll see if I can do a quick test module to see how it renders. I'm just wondering if anyone else is noticing this.

 
New Post
1/27/2012 1:34 AM
 

Ok, I did a quick test (on DNN 06.01.01). I created a View user control, with nothing in the code-behind but having the control inherit from PortalModuleBase. My testing confirms that the IconKey attribute in position 5 or lower will not render.

Here is a link to a picture of how it renders. Also, when I look at what is pushed to my browser (Chrome), I see that the src attribute on the rendered img doesn't have a value (or an = sign either).

Here is the complete markup of my test. Can anyone else reproduce my results?

  1. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ViewIconKeyTest.ascx.cs" Inherits="DesktopModules_AdHoc_IconKeyTest_ViewIconKeyTest" %>
  2. <%@ Register TagPrefix="dnn" Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" %>
  3.  
  4. <ul>
  5.     <li><dnn:CommandButton IconKey="Edit" ID="EditSomething" runat="server" CssClass="CommandButton" CausesValidation="false" Text="IconKey - First Attribute" /></li>
  6.     <li><dnn:CommandButton ID="CommandButton1" IconKey="Edit" runat="server" CssClass="CommandButton" CausesValidation="false" Text="IconKey - Second Attribute" /></li>
  7.     <li><dnn:CommandButton ID="CommandButton2" runat="server" IconKey="Edit" CssClass="CommandButton" CausesValidation="false" Text="IconKey - Third Attribute" /></li>
  8.     <li><dnn:CommandButton ID="CommandButton3" runat="server" CssClass="CommandButton" IconKey="Edit" CausesValidation="false" Text="IconKey - Fourth Attribute" /></li>
  9.     <li><dnn:CommandButton ID="CommandButton4" runat="server" CssClass="CommandButton" CausesValidation="false" IconKey="Edit" Text="IconKey - Fifth Attribute" /></li>
  10.     <li><dnn:CommandButton ID="CommandButton5" runat="server" CssClass="CommandButton" CausesValidation="false" Text="IconKey - Sixth (last) Attribute" IconKey="Edit" /></li>
  11. </ul>
 
New Post
1/27/2012 12:30 PM
 

I didn't try to re-produce your results but see from looking at the code for the web server control, DnnCommandButton, why this would happen. It is not strictly the numeric position of the IconKey attribute in the markup but whether the attribute occurs after another attribute (such as Text) which forces creation of child controls to occur before the IconKey property is set.

The ImageButton control needs to have it's ImageUrl property set during the controls pre-render event, not when the ImageUrl property of the DnnCommand button is referenced as this only occurs during CreateChildControls.

Please log this as an issue in Gemini as the order in which properties of a control are set should not affect the rendering of the control.

Good catch, by the way, and a good and concise verification of the issue!


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/4/2012 10:13 PM
 
William Severance wrote:

Please log this as an issue in Gemini as the order in which properties of a control are set should not affect the rendering of the control.

 Hi Bill,

I'll post this as an issue in Gemini, hopefully in the next week or so - been a bit busy lately.

Before I post it, though, I want to examine it a bit more. It looks like there might be a relationship to the Text property of the control, but I recall getting the same effect without an actual Text attribute (though I did have a ResourceKey attribute, which would render as a Text).

Along a similar line, I whipped up a quick set of HyperLinks to display various available IconKeys (to make it easier for me to choose from, in whatever skin I have). What was interesting in this was that when the Icon renders, the Text for the hyperlink does not (very strange, and gives some credence to your suggestion of the root cause). Anyway, I want to take a closer look at this myself - maybe at least find where the error happens, even if I don't have a fix to suggest.

Here's the simple markup to show the (partial) list of Sigma Icons:


<style type="text/css">
    fieldset .ListIconKey
    {
        width: 80%;
    }
    fieldset .ListIconKey ul
    {
        margin: 0 auto;
        padding: 0;
    }
    .ListIconKey ul li
    {
        display: inline-block;
        width: 150px;
    }
</style>
<fieldset class="ListIconKey">
    <legend>IconKey</legend>
    <p>The following are Sigma icons; the text is the value to use for the IconKey.</p>
    <ul>
        <li><asp:HyperLink ID="Hyperlink37" runat="server" >no IconKey</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink01" runat="server" IconKey="Save" >"Save"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink02" runat="server" IconKey="Edit" >"Edit"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink03" runat="server" IconKey="Add" >"Add"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink04" runat="server" IconKey="Delete" >"Delete"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink05" runat="server" IconKey="About" >"About"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink06" runat="server" IconKey="Action" >"Action"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink07" runat="server" IconKey="ActionDelete" >"ActionDelete"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink08" runat="server" IconKey="ActionRefresh" >"ActionRefresh"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink09" runat="server" IconKey="Activatelicense" >"Activatelicense"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink10" runat="server" IconKey="AddFolder" >"AddFolder"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink11" runat="server" IconKey="Cancel" >"Cancel"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink12" runat="server" IconKey="Checked" >"Checked"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink13" runat="server" IconKey="Delete" >"Delete"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink14" runat="server" IconKey="Deny" >"Deny"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink15" runat="server" IconKey="Email" >"Email"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink16" runat="server" IconKey="Grant" >"Grant"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink17" runat="server" IconKey="Health" >"Health"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink18" runat="server" IconKey="Help" >"Help"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink19" runat="server" IconKey="Integrity" >"Integrity"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink20" runat="server" IconKey="Kb" >"Kb"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink21" runat="server" IconKey="Lists" >"Lists"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink22" runat="server" IconKey="Lock" >"Lock"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink23" runat="server" IconKey="Max" >"Max"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink24" runat="server" IconKey="Min" >"Min"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink25" runat="server" IconKey="Rt" >"Rt"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink26" runat="server" IconKey="Lt" >"Lt"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink27" runat="server" IconKey="Up" >"Up"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink28" runat="server" IconKey="Dn" >"Dn"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink29" runat="server" IconKey="Shared" >"Shared"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink30" runat="server" IconKey="Trash" >"Trash"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink31" runat="server" IconKey="Users" >"Users"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink32" runat="server" IconKey="User" >"User"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink33" runat="server" IconKey="Vendors" >"Vendors"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink34" runat="server" IconKey="Unchecked" >"Unchecked"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink35" runat="server" IconKey="View" >"View"</asp:HyperLink></li>
        <li><asp:HyperLink ID="Hyperlink36" runat="server" IconKey="ViewStats" >"ViewStats"</asp:HyperLink></li>
    </ul>
</fieldset>
 
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...IconAPI - IconKey not showingIconAPI - IconKey not showing


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