MDaemon WorldClient v11 missing columns blank lines in your Inbox

by Joe Payne 3. August 2011 09:30

After upgrade of my MDaemon 10 installation to version 11, my WorldClient essentially broke.  I could log into my WorldClient, but the right window contents were always blank or empty.   I could see message counts in the left side, all the folders etc.  Left side worked great.  But no matter what folder I clicked, the right side was empty.

Since I only used WorldClient when I travel, it was more of a hassle than an issue.  I could use the Simple theme or Mobile theme to get what I needed.  But the Standard and LookOut themes continued to have missing content.  This morning I finally decided it was time to clean up some old issues.  So I dug into it via Google and finally figured out the cause.

Apparently the ability to customize the columns in the right-pane window of the WorldClient view is new to version 11 of MDaemon.  Unfortunately the upgrade install failed to actually SET those columns to be visible.  If you look closely in your right-pane window of WorldClient, you’ll notice there are no column headings.  AHA ! 

The solution is incredibly simple.  You have to tell WorldClient what columns you want to see in each view like Inbox, Contacts, Tasks, Calendar etc.  To do this, just click the Options choice at the bottom of your left-side window pane.  Then choose the Columns menu choice like shown:

image

On the next screen, notice how NONE of the checkboxes are selected.  So WorldClient is essentially told not to display any columns for anything.  Not sure why a developer would allow this scenario but that’s for another discussion Smile

To resolve the problem, just click the checkbox for each column you want to appear like this:

image

When you’re done, be sure to click the Save button at the top:

image

Once your settings are saved, click back to your Inbox and you should see all your emails just you expect.

NOTE:  This has to be done per-user, so if you have multiple accounts you must do this for each one individually.  Joy !

Tags: , ,

Personal | Tech Support

Control an ASP.Net Modal Popup within a Gridview Row

by Joe Payne 22. June 2011 14:47

So today I needed to do something I had done before.  Simple, right?  Just copy/paste the code from another project and <wham> everything works, right?  NOT!

Today’s goal was to make a popup edit window for the contents of a specific grid row.  Each gridview row has it’s own edit button.  I want the user to be able to edit the controls of the gridview row within a nifty popup window.

First we have to add a Panel to our HTML.  This panel will contain everything included in our popup window.  Here’s a good start:

<asp:Panel ID="EditReturnItemDialog" runat="server" Style="display: none; width: 300px" CssClass="modalPopup">
    <asp:Panel ID="EditReturnItemDialogHeader" runat="server" CssClass="modalPopupHeader" EnableViewState="false">
        <asp:Localize ID="EditReturnItemDialogCaption" runat="server" Text="Edit Return Item" EnableViewState="false"></asp:Localize>
    </asp:Panel>
    <br />
    Specify Return Number for this return...
    <br /><br />
    <table>
        <tr valign="middle" style="font-weight:bold">
            <td>Return Number: </td>
            <td><asp:TextBox ID="txt_AuthorizeReturnNumber" runat="server" Width="80px"/></td>
        </tr>
        </table>
    <br /><br />
    <center><asp:Button ID="btn_SaveEditReturnItem" runat="server" Text="Submit" OnClick="btn_SaveEditReturnItem_Click"/>&nbsp;&nbsp;&nbsp;<asp:Button ID="btn_EditReturnItemCancel" runat="server" Text="Cancel" /></center>
</asp:Panel>

Notice the object ID names here.  They are critical and must match exactly with how you specify them in the ModalPopupExtender.  If you get just one wrong, the popup won’t fire and you may not even see an error depending on how your browser is configured.

Also notice at the end of the panel is a save button with an OnClick event, but the Cancel button does not have one.  This is intentional.  Unless you have need to extra functionality within the Cancel operation, you can hook the ‘cancel’ functionality of the MPE directly to the button.  Alternatively you can specify an OnClick event for the Cancel button and specifically issue the MPE.Hide() command.  It’s your choice.

Once your Panel is in place, now it’s time to build the ModalPopupExtender itself.  Here how this one will look:
<ajax:ModalPopupExtender ID="mpe_EditReturnItemPopup" runat="server" TargetControlID="btn_Hidden1"
PopupControlID="EditReturnItemDialog" BackgroundCssClass="modalBackground" CancelControlID="btn_EditReturnItemCancel"
DropShadow="false" PopupDragHandleControlID="EditReturnItemDialogHeader" />

There’s a lot here, but basically it all makes sense.  We give the MPE an ID for itself.  But notice the TargetControlId is set to an object we haven’t added yet.  That object, btn_Hidden1 is the trick.  Normally an MPE requires being hooked into a working button.  That’s what we’re doing here, we’ve just made the button invisible. 

By setting an MPE to a button that isn’t used, it gives you the ability to create an MPE and manually manipulate it elsewhere in the code-behind.  Here’s the code for the hidden button, it’s quite simple:

<asp:Button ID="btn_Hidden1" runat="server" style="display: none"  />

Note how I’ve used a style with display: none instead of the usual Visible=”false”.  Why?  Because a Visible=”false” will not render the control at all on the client side, thus the MPE cannot find it’s button to hook.  The MPE will fail to fire the popup and it’s doubtful you’ll even see an error.  So do not use the Visible=, instead use a style with display: none on your hidden button.

We have one last thing to build on the HTML side:  Our gridview command button.  This button renders for each row in the Gridview control.  It’s responsible for opening the actual popup window when it’s clicked.

Adding the button is easily done.  Simply add the button to a template field in your gridview row like such:

<asp:TemplateField HeaderText="Actions">
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
    <ItemTemplate>
        <asp:LinkButton ID="btn_Edit" runat="server" ToolTip="Edit" CommandName="Do_Edit" CommandArgument='<%#string.Format("{0}", Eval("ReturnItemId"))%>'><img src="<%# GetIconUrl("edit.gif") %>" 
        border="0" alt="Edit" /></asp:LinkButton>
    </ItemTemplate>
</asp:TemplateField>

In this particular case, we’re using an icon image to represent the button but you get the point nonetheless.

The key here is we’re using the gridview RowCommand event to handle the popup action.  So the button must have the CommandName and CommandArgument parameters specified.

Finally we’re done with the HTML side.  Now let’s build the code-behind to drive this popup.

For your Gridview control, make sure you’ve specified a function for the RowCommand event like so:

<asp:GridView ID="grd_ReturnItems" runat="server" AutoGenerateColumns="False" DataKeyNames="ReturnItemId"
    CellSpacing="0" CellPadding="4" Width="100%" SkinID="Summary" OnRowCommand="grd_ReturnItems_RowCommand" >

Now build the code-behind to drive the ModalPopupExtender and render the popup.  Here’s the final piece of the puzzle:

Protected Sub grd_ReturnItems_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles grd_ReturnItems.RowCommand
 
    ' pull in the ReturnItemID and load up the returnitem class
    Dim _ReturnItemId As Integer = AlwaysConvert.ToInt(e.CommandArgument)
    Dim _ReturnItem As ReturnItem = ReturnItemsDataSource.Load(_ReturnItemId)
    If _ReturnItem.ReturnItemid = 0 Then
        Return
    End If
 
    Select Case e.CommandName
        Case "Do_Edit"
            mpe_EditReturnItemPopup.Show()
    End Select
 
End Sub

See how it’s done?  Simply call the .Show() method of the ModalPopupExtender object.  The browser client handles the rest automatically.

Well if you’ve read this far, then you’ve probably realized by now that I never answered the question of “Why didn’t it work when you copy/paste’d the code from another project?”  I made the mistake of using Visible=”False” on the hidden button instead of using style=”display: none” </thumpsforehead> Smile

Tags: , , , ,

AC7 Articles | Personal | Tech Support

How To Maintain Scroll Position during Postback in AbleCommerce 7

by Joe Payne 19. May 2011 14:23

If you've ever spent hours writing a page only to have it jump all over the place during any postback, this tip will make your day.  With one simple command in Page_Load() you can make the page stay exactly where it was before the postback fired.

In your Page_Load() routine, add this line:

this.Page.MaintainScrollPositionOnPostBack = true;

 

Now some will say "I can already do that in the .ASPX file."  That's swell, but in AbleCommerce-Land you rarely work with the original .ASPX file.  In AbleCommerce-Land the vast majority of your work will be inside User Controls, so you don't have direct access to the page declaration.

Using this technique works great in a user control and you don't have to worry about modifications to a .ASPX file conflicting with other controls that use the same .ASPX file.

Nifty!  Winking smile

Tags: , ,

AC7 Articles | Personal | Tech Support

AbleCommerce 7.0.5 Bug using Edit Addresses from Order Details page

by Joe Payne 18. May 2011 09:25

When using the Edit Addresses button from the Order Details page in AbleCommerce 7.0.5, there is bug when multiple shipments are involved. If you click Save to store any changes made, all the shipment addresses will get set to the address that is shown on the first shipment. This blows away the address details of shipments beyond Shipment #1.

The fix is simple. Edit the /Admin/Orders/EditAddresses.aspx.cs file. Locate the following code:

 

protected void SaveButton_Click(object sender, EventArgs e)
{
    _Order.BillToFirstName = BillToFirstName.Text;
    _Order.BillToLastName = BillToLastName.Text ;
    _Order.BillToCompany = BillToCompany.Text ;
    _Order.BillToAddress1 = BillToAddress1.Text;
    _Order.BillToAddress2  =BillToAddress2.Text;
    _Order.BillToCity = BillToCity.Text;
    _Order.BillToProvince = BillToProvince.Text;
    _Order.BillToPostalCode = BillToPostalCode.Text;
    _Order.BillToCountryCode = BillToCountryCode.Items[BillToCountryCode.SelectedIndex].Value;
    _Order.BillToPhone = BillToPhone.Text;
    int index = 0;
    foreach (OrderShipment shipment in _Order.Shipments)
    {
        RepeaterItem item = ShipmentRepeater.Items[index];
        shipment.ShipToFirstName = GetControlValue(item, "ShipToFirstName");
        shipment.ShipToLastName = GetControlValue(item, "ShipToLastName");
        shipment.ShipToCompany = GetControlValue(item, "ShipToCompany");
        shipment.ShipToAddress1 = GetControlValue(item, "ShipToAddress1");
        shipment.ShipToAddress2 = GetControlValue(item, "ShipToAddress2");
        shipment.ShipToCity = GetControlValue(item, "ShipToCity");
        shipment.ShipToProvince = GetControlValue(item, "ShipToProvince");
        shipment.ShipToPostalCode = GetControlValue(item, "ShipToPostalCode");
        shipment.ShipToCountryCode = GetControlValue(item, "ShipToCountryCode");
        shipment.ShipToPhone = GetControlValue(item, "ShipToPhone");
    }
    _Order.Save();
    SavedMessage.Text = string.Format(SavedMessage.Text, DateTime.UtcNow.ToLocalTime());
    SavedMessage.Visible = true;
    EditAddressAjax.Update();
}



And replace it with this code:

protected void SaveButton_Click(object sender, EventArgs e)
{
    _Order.BillToFirstName = BillToFirstName.Text;
    _Order.BillToLastName = BillToLastName.Text ;
    _Order.BillToCompany = BillToCompany.Text ;
    _Order.BillToAddress1 = BillToAddress1.Text;
    _Order.BillToAddress2  =BillToAddress2.Text;
    _Order.BillToCity = BillToCity.Text;
    _Order.BillToProvince = BillToProvince.Text;
    _Order.BillToPostalCode = BillToPostalCode.Text;
    _Order.BillToCountryCode = BillToCountryCode.Items[BillToCountryCode.SelectedIndex].Value;
    _Order.BillToPhone = BillToPhone.Text;
    int index = 0;
    foreach (OrderShipment shipment in _Order.Shipments)
    {
        RepeaterItem item = ShipmentRepeater.Items[index];
        shipment.ShipToFirstName = GetControlValue(item, "ShipToFirstName");
        shipment.ShipToLastName = GetControlValue(item, "ShipToLastName");
        shipment.ShipToCompany = GetControlValue(item, "ShipToCompany");
        shipment.ShipToAddress1 = GetControlValue(item, "ShipToAddress1");
        shipment.ShipToAddress2 = GetControlValue(item, "ShipToAddress2");
        shipment.ShipToCity = GetControlValue(item, "ShipToCity");
        shipment.ShipToProvince = GetControlValue(item, "ShipToProvince");
        shipment.ShipToPostalCode = GetControlValue(item, "ShipToPostalCode");
        shipment.ShipToCountryCode = GetControlValue(item, "ShipToCountryCode");
        shipment.ShipToPhone = GetControlValue(item, "ShipToPhone");
        // BEGIN MOD: AbleMods.com
        // 5/18/2011
        // bug-fix in AC705
        index++;
        // END MOD: AbleMods.com
    }
    _Order.Save();
    SavedMessage.Text = string.Format(SavedMessage.Text, DateTime.UtcNow.ToLocalTime());
    SavedMessage.Visible = true;
    EditAddressAjax.Update();
}


I checked AbleCommerce 7.0.7 and the code appears correct, not sure if 7.0.6 has it though.

Tags: , , ,

AC7 Articles | Tech Support

HP Proliant DL360 G3 Red Health Light and Interlock LED amber

by Joe Payne 16. May 2011 22:13

Well it just goes to show you are never done learning in the IT business.

A few weeks ago I decided to deploy my backup web server as the primary was showing odd hardware errors in Server 2003.  However I couldn’t even get the backup to show me a POST boot.  In fact, it just stared at me with a red health LED on the front and nothing more.  The power supplies didn’t even light their green LEDs despite hearing the fans spin inside.  Inside the server showed only an amber Interlock light. 

So I cold-booted the primary and brought it back online.  I pulled the backup DL 360 G3 and brought it home for the usual kitchen-table bench testing.  Yes, the wife just loves it when I do that.

But nothing I did resolved the seemingly dead server.  I reseated CPU’s, CPU power boards, RAM, power supplies and anything else that remotely looked removable.  Nothing.

I finally got around to ordering another backup DL 360 G3 last week off eBay.  It arrived today.  Finally, my anxiety of running live sites on a single box with no backup would soon be a thing of the past.  I unbox the new backup DL 360 G3, throw it too on the kitchen table and ………. nothing.  The EXACT same symptoms as the previous backup server.

So by the general laws of armchair logic, I knew this was no longer a problem with the hardware.  There has to be something else.  I hopped on Google, did the usual searches and spent a good 30 minutes reading post-after-post.  Finally, I found the answer.  Within 10 seconds I had both servers running great.

The problem is the recycler companies that buy these units up and sell them on eBay.  They don’t know HP units as well as they advertise.  And they DO NOT “test” them to ensure they boot.  At least they don’t AFTER they install two power supplies in a system specifically configured for a single power supply.

That’s right, the problem was the motherboard has a configuration switch (SW2 on DL360 G3) with 4 positions.  The 4th position specifically tells the system whether there are two power supplies or just one.  It’s not automatic in the G3 series. 

The recyclers clearly acquired these units as single power supply, tested them, then loaded up the additional power supply under the assumption it would be auto-detected.  This isn’t true in the G3 series if the 4th switch on SW2 is not set correctly.  Toggling the 4th SW2 switch on the motherboard immediately eliminated the problem on both servers.

Now the power LED on each power supply lights up.  The Interlock light no longer lights up.  And the servers proceed to POST boot without a problem.

Hopefully this blog post will save somebody the headache and expense I’ve endured for such a painfully simple solution.

Tags: , , , ,

Personal | Tech Support

Month List