Rank: Advanced Member Groups: Member
Joined: 7/18/2008 Posts: 76
|
Good Afternoon, I have created a screen that uses a flyout within a repeater for a list of comments and when you add a new comment to the top of the repeater list the index for the flyout is off and it does not render the flyout info correctly. If you add the item to the bottom of the repeater the index is fine and the flyouts work as they are supposed to. I have attached a sample test page demonstrating this issue I am having. The code is already setup to demonstrate the flyout indexing issue I am referring to. I have also added a comment that will show you how to get the flyouts working, however, I want the most recent comment to appear at the top of the list, that is why I am bringing this up. Your assistance would be greatly appreciated. I am working with EO Objects 2010 (8.0) Build 05/26/2011
Code: HTML/ASPX
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="PCN.test" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="hrdComments" runat="server">
<title>Transaction Comments</title>
<style type="text/css">
.content, .shadow {
position: relative;
bottom: 4px;
right: 4px;
}
.shadow { background-color: #ccc; }
</style>
<script type="text/javascript">
maxL = 512;
var bName = navigator.appName;
function taLimit(taObj) {
if (taObj.value.length == maxL) return false;
return true;
}
function taCount(taObj, Cnt) {
objCnt = createObject(Cnt);
objVal = taObj.value;
if (objVal.length > maxL) objVal = objVal.substring(0, maxL);
if (objCnt) {
if (bName == "Netscape") {
objCnt.textContent = maxL - objVal.length;
}
else { objCnt.innerText = maxL - objVal.length; }
}
return true;
}
function createObject(objId) {
if (document.getElementById) return document.getElementById(objId);
else if (document.layers) return eval("document." + objId);
else if (document.all) return eval("document.all." + objId);
else return eval("document." + objId);
}
function closeDialog(asReturn) {
if (asReturn == "CANCEL") {
window.returnValue = asReturn;
}
else {
window.returnValue = asReturn;
} //END if (asReturn == "CANCEL") {
self.close();
} //End function closeDialog(){
function addComment() {
if (Page_ClientValidate()) {
if (confirm("Are you sure you want to add the comment?")) {
eo_Callback("<%=cbpComments.ClientID %>", "SAVE");
return false;
} //End if (confirm()) {
} //End if (Page_Validate()) {
} //End function addComment() {
</script>
</head>
<body style="margin-top: 2px; margin-left: 2px;">
<form id="frmComments" runat="server">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="padding-top: 1px; padding-left: 2px; font-family: Tahoma; font-size: 11pt; font-weight: bold; color: Blue;">
Transaction Comments
</td>
</tr>
<tr>
<td>
<eo:CallbackPanel ID="cbpComments" runat="server" AutoDisableContents="True" LoadingDialogID="dlgPleaseWait" SafeGuardUpdate="False">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="padding-top: 4px; padding-left: 2px;">
<div id="dvCommentList" style="height: 200px; overflow: auto; border: 1px solid #7f9db9; width: 615px; background-color: White; padding-left: 2px;">
<asp:Repeater runat="server" ID="rptrComments">
<ItemTemplate>
<asp:Label ID="lblComments" Font-Names="Tahoma" Font-Size="10pt" runat="server" Width="595px"><%# DataBinder.Eval(Container.DataItem, "header")%></asp:Label>
<eo:Flyout ID="foComments" runat="server" For="lblComments" ExpandDirection="BottomLeft">
<ContentTemplate>
<div class="shadow">
<div class="content" style="border: solid 1px #7f9db9; width: 450px; background-color: White; padding-left: 2px;">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<div style="border: solid 1px white; background-color: #7f9db9;">
<table cellpadding="0" cellspacing="0" style="font-family: Tahoma; font-size: 10pt; font-weight: bold; line-height: 10px;">
<tr>
<td style="font-weight: bold; text-align: right; padding-right: 4px; color: White; padding-top: 8px;">
Date:
</td>
<td style="font-weight: normal; color: White; padding-top: 8px;">
<%# Eval("comment_dt")%>
</td>
</tr>
<tr>
<td style="font-weight: bold; text-align: right; padding-right: 4px; padding-top: 4px; padding-bottom: 8px; color: White;">
Author:
</td>
<td style="font-weight: normal; padding-top: 4px; color: White; padding-bottom: 8px;">
<%# Eval("team_mbr")%>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div style="padding-top: 5px; font-family: Tahoma; font-size: 10pt; overflow: auto; height: 85px;">
<%# Eval("comment")%>
</div>
</td>
</tr>
</table>
</div>
</div>
</ContentTemplate>
</eo:Flyout>
</ItemTemplate>
<SeparatorTemplate>
<hr>
</SeparatorTemplate>
</asp:Repeater>
</div>
</td>
</tr>
<tr>
<td style="font-family: Tahoma; font-size: 10pt; font-weight: bold; padding-top: 4px;">
Add New Comment: <asp:RequiredFieldValidator ID="rfvComment" runat="server" ErrorMessage="Please enter some comments before continuing." ControlToValidate="txtComment" SetFocusOnError="True" ValidationGroup="vgComment" Font-Names="Tahoma" Font-Size="9pt"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td style="padding-top: 4px; padding-left: 2px;">
<asp:TextBox ID="txtComment" runat="server" Font-Names="tahoma" Font-Size="10pt" onKeyPress="return taLimit(this)" onKeyUp="return taCount(this,'charCounter')" Height="84px" Width="612px" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td style="font-family: Tahoma; font-size: 8pt;">
You have <b><font color="red"><span id="charCounter">512</span></b></font> characters remaining for your comment.
</td>
</tr>
<tr>
<td style="padding-top: 4px; padding-bottom: 4px;" align="center">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Button ID="btnAddComment" runat="server" Text="Add Comment" OnClientClick="return addComment()" UseSubmitBehavior="false" Font-Names="tahoma" Font-Size="10pt" Width="268px" ValidationGroup="vgComment" />
</td>
<td style="padding-left: 15px;">
<asp:Button ID="btnCloseComments" OnClientClick="return closeDialog()" runat="server" Text="Close Comments" UseSubmitBehavior="false" Font-Names="tahoma" Font-Size="10pt" Width="268px" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<asp:HiddenField ID="hdnTransactionID" runat="server" />
<asp:HiddenField ID="hdnAssociateID" runat="server" />
</eo:CallbackPanel>
</td>
</tr>
</table>
<eo:Dialog ID="dlgPleaseWait" runat="server" BackColor="White" BackShadeColor="Blue" Style="font-size: 12px; font-family: tahoma" BorderColor="#6993BE" BorderStyle="Double" BorderWidth="3px">
<ContentTemplate>
<table border="0">
<tr>
<td align="center">
<img src="Images/loading.gif" alt="" />
</td>
</tr>
<tr>
<td>
<table cellpadding='0' cellspacing='0'>
<tr>
<td align='center' style='padding-bottom: 8px; padding-top: 10px; padding-left: 10px; padding-right: 10px; font-family: Calibri; font-size: 10pt; font-weight: bold;'>
Please wait...
</td>
</tr>
<tr>
<td align='center' style='padding-bottom: 10px; padding-left: 10px; padding-right: 10px; font-family: Calibri; font-size: 10pt; font-weight: bold;'>
We are processing your request.
</td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</eo:Dialog>
</form>
</body>
</html>
Code: Visual Basic.NET
Public Partial Class test
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Turn Off Caching at the Server Level for this page.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
If Not IsPostBack Then loadInfo(False, "")
End Sub
Protected Sub loadInfo(ByVal abAddNew As Boolean, ByVal asComment As String)
txtComment.Text = ""
rptrComments.DataSource = CreateCommentList(abAddNew, asComment)
rptrComments.DataBind()
End Sub
Private Function CreateCommentList(ByVal abAddNew As Boolean, ByVal asComment As String) As DataTable
Dim table As New DataTable()
table.Columns.Add("transactionid", GetType(String))
table.Columns.Add("associateid", GetType(String))
table.Columns.Add("header", GetType(String))
table.Columns.Add("team_mbr", GetType(String))
table.Columns.Add("comment_dt", GetType(String))
table.Columns.Add("comment", GetType(String))
'The error occurs when the row is added at the top of the repeater.
'Adding the row to the top of the table doesn't allow the flyout index to be created correctly.
If abAddNew Then table.Rows.Add("811", "6701", "08/01/2011 4:25 PM Darrell: New Record where Flyout Index IS NOT WORKING. Your comment: " + asComment, "Darrell", "08/01/2011 4:25 PM", "New Record where Flyout Index IS NOT WORKING. Your comments: " + asComment)
table.Rows.Add("811", "6701", "08/01/2011 3:25 PM Darrell: Comment 1", "Darrell", "08/01/2011 1:25 PM", "Comment 1")
table.Rows.Add("811", "6701", "08/01/2011 2:25 PM Darrell: Comment 2", "Darrell", "08/01/2011 2:25 PM", "Comment 2")
table.Rows.Add("811", "6701", "08/01/2011 1:25 PM Darrell: Comment 3", "Darrell", "08/01/2011 3:25 PM", "Comment 3")
'If you add the row to the bottom of the table instead of the top of the table the repeater renders fine.
'Comment out the top "If abAddNew Then " above and uncomment this line below you will see that the Flyout works as designed.
'If abAddNew Then table.Rows.Add("811", "6701", "08/01/2011 4:25 PM Darrell: New Record where Flyout Index IS WORKING. Your comment: " + asComment, "Darrell", "08/01/2011 4:25 PM", "New Record where Flyout Index IS WORKING. Your comments: " + asComment)
Return table
End Function 'CreateDataTable
Protected Sub cbpComment_Execute(ByVal sender As Object, ByVal e As EO.Web.CallbackEventArgs) Handles cbpComments.Execute
Select Case e.Parameter.ToUpper
Case "SAVE"
'Simulate Adding New Comment
loadInfo(True, txtComment.Text.Trim)
End Select
End Sub
End Class
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have posted build 2011.0.22 that should fix this problem. You can download it from our download page. Please let us know if it works for you.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 7/18/2008 Posts: 76
|
Thank you. The new version is now working.
|