Showing posts with label repeater. Show all posts
Showing posts with label repeater. Show all posts

Wednesday, March 28, 2012

UpdatePanel - Repeater - Hyperlink

We have what seems like a simple problem...We have a report that we have created within an updatepanel. The repeater in that UPanel has hyperlinks that will allow us to "drill down" to specific information. When we click that Hyperlink, we want to trigger another updatepanel to display details in it. To summarize what we want to do:

1) UPANEL1 will have a repeater which will have hyperlinks

2) Clicking a hyperlink in UPANEL1 will invoke a trigger in UPANEL2

3) UPANEL2 will then update itself with the details of the record we clicked on in UPANEL1

Does this make sense?

I'm having the exact same problem. I'm using LinkButtons, not Hyperlinks (which I assume you're using too, since Hyperlinks don't postback) but other than that, exactly the same problem. The things always post back, and I don't want them to. Did you, or anyone else for that matter, ever find a solution?

Do you guys have some code to share? I think it should be as simple as adding the repeater as an AsyncPostBack trigger to UpdatePanel2... is that what you tried?


I have exactly the same problem and if I just replace my LinkButtons by Buttons, everything works.


I got itSmile. At least I known how to work arround it.

The problem comes from LinkButton without an ID attribute.

The following page shows how to reproduce the problem :

<%@. Page Language="C#" EnableViewState="false" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AJAXEnabledWebApplication1._Default" %><html xmlns="http://www.w3.org/1999/xhtml" ><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:UpdatePanel runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Repeater DataSource="<%# Data%>" runat="server"> <ItemTemplate> OK <asp:Button runat="server" Text="<%# Container.DataItem%>" /> OK <asp:LinkButton ID="LinkButton1" runat="server" Text="<%# Container.DataItem%>" /> NOK <asp:LinkButton runat="server" Text="<%# Container.DataItem%>" /> <br /> </ItemTemplate> </asp:Repeater> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>
using System;using System.Web.UI;namespace AJAXEnabledWebApplication1{public partialclass _Default : Page {public string[] Data =new string[] {"aaaaa","bbbb","cccc","dddd"};protected void Page_Init(object sender, EventArgs e) { DataBind(); } }}

In the page, we have a Repeater with one Button and 2 LinkButton inside an UpdatePanel.

When the button or the first link are clicked, no problem. Only the panel is updated.

When the second link is clicked, the page completly reloads.

I don't know why, but adding the ID to the LinkButton solves the problem.

Monday, March 26, 2012

UpdatePanel & AccordionExtender

To all,

this is what i have so far.. a nested repeater that displays info from a datasource... the repeaters sits inside a updatepanel which has a conditional mode that should re-render (dont know if thats the right terminology) itself base on an event...

now.. i have so far managed to get the accordion extender working such that the updatepanel re-render itself to give out the right data... but ONLY if the scriptmanager having the PartialRendering as false... ie.. the re-rendering works if the whole page is rendered... the the partial rendering is true... the repeated accordion inside the update panel all expands and the accordion action no longer works... pretty much to the point where its similar to a treeview...

below is a snippet of my code...

<div id="navigation_left" runat="server" class="accordionSpan" >
<asp:Panel ID="Panel2" runat="server">
<atlas:UpdatePanel ID="UpdatePanel1" Mode="Conditional" runat="server" RenderMode="Inline">
<Triggers>
<atlas:ControlEventTrigger ControlID="StateRadioBtnLst" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:Repeater ID="rMyRepeater" runat="server">
<ItemTemplate>
<span id="Accordion1Pane">
<div><div class="accordionHeader">
<%# Eval("Name") %>
</div></div>
<div><div class="accordionContent">
<asp:Repeater ID="rMyRepeater1" runat="server" DataSource='<%# ((BusinessObjects.MatterCategorieJoin)Container.DataItem).MatterType %>'>
<ItemTemplate>
<div><%# ((BusinessObjects.MatterType)(Container.DataItem)).Name%></div>
</ItemTemplate>
</asp:Repeater>
</div></div></span>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel>
</div>

<atlas:AccordionExtender ID="AccordionExtender1" runat="server">
<atlas:AccordionProperties
TargetControlID="UpdatePanel1"
AutoSize="None"
SelectedIndex="0"
FadeTransitions="false"
FramesPerSecond="80"
TransitionDuration="150"/>
</atlas:AccordionExtender>

anyone with any idea of help??...
thanks to all who replies...

Hi tony_c,

Part of the problem is that you don't seem to have the right hierarchy of HTML elements. Check out the posthttp://forums.asp.net/thread/1333093.aspx to see how the divs and span should be nested. I would also recommend that you don't use the UpdatePanel as the TargetControlID. I'm not sure this is causing your problems, but it looks suspect.

Thanks,
Ted

UpdatePanel + Repeater + LinkButton: Which Event Will Fire?

I have been pulling my hair out for 8 hours now, trying to get this little piece of code to work. Any help would be greatly appreciated!

It is a seemingly simple excercise of having a LinkButton in a Repeater control, nested inside an UpdatePanel. For the life of me, I can't get a command (or click) event to fire!

I have tried adding event code for the repeater control as well as the linkbuttons. When a linkbutton is clicked, the Load event on the page runs, but I can never get a command event to fire.

There are MANY different things I have tried, and for clarity I have removed most of the abberations I have gone through. The code below is a stripped-down version that just shows the basics of what I am trying to do. I would be grateful if someone who has gone through this before could give me some things to try.

Again, I am simply trying to have some server-side code run in response to a LinkButton command that is nested inside a repeater, which is inside an UpdatePanel. It is data bound, as you will notice below (that is the one apsect that seems to work just fine). Thank you!

Here is the code (a little sanitized):

<atlas:UpdatePanel ID="UpdatePanel1" Mode="Conditional" runat="server"><ContentTemplate><table class="choices" border="0"><asp:Repeater ID="Choices" runat="server"><ItemTemplate><tr><td><asp:LinkButton ID="Choice" CssClass="choice" CommandName='<%#Eval("ID")%>' Text='<%#Eval("Name")%>' runat="server" /></td></tr></ItemTemplate><FooterTemplate><tr><td><asp:LinkButton ID="Choice" CssClass="choice" CommandName="0" Text="Nothing" runat="server" /></td></tr></FooterTemplate></asp:Repeater></table></ContentTemplate></atlas:UpdatePanel>

I dont see your triggers section, controling the action that happens on the click of the linkbutton, are you trying to perform a codebehind function?


How do you implement the code that executes when the button is pressed? Instead of a linkButton Click, fetch the ItemCommand event on the repeater.

Check out:

http://sncore.vestris.com/Source/sncore/SnCore.Web/AccountFeedItemImgsView.aspx
http://sncore.vestris.com/Source/sncore/SnCore.Web/AccountFeedItemImgsView.aspx.cs

There's a PagedList (a multicolumn repeater) with a toggle button inside an UpdatePanel.

<atlas:UpdatePanelID='panelShowHide'Mode="Conditional"runat="Server">
<ContentTemplate>
<asp:LinkButtonText='<%# (bool) Eval("Visible") ? "» Hide" : "» Show" %>'ID="linkToggleVisible"runat="server"
Visible='<%# base.SessionManager.IsAdministrator %>'CommandName="Toggle"CommandArgument='<%# Eval("Id") %>'/>
</ContentTemplate>
</atlas:UpdatePanel>

The handling code changes something in the DB, then updates the button only.

publicvoid gridManage_ItemCommand(object sender, DataListCommandEventArgs e)
{
try
{
switch (e.CommandName)
{
case "Toggle":
TransitAccountFeedItemImg img = SyndicationService.GetAccountFeedItemImgById(
SessionManager.Ticket,int.Parse(e.CommandArgument.ToString()));
img.Visible = !img.Visible;
if (!img.Visible) img.Interesting =false;
SyndicationService.CreateOrUpdateAccountFeedItemImg(SessionManager.Ticket, img);
LinkButton lb = (LinkButton)e.Item.FindControl("linkToggleVisible");
lb.Text = img.Visible ? "» Hide" : "» Show";
UpdatePanel up = (UpdatePanel)e.Item.FindControl("panelShowHide");
up.Update();
break;
}
}
catch (Exception ex)
{
ReportException(ex);
}
}

I don't have a running demo, you need to be admin on foodcandy.com to do this :)

Hope this helps,
dB.


Freakyuno:

I dont see your triggers section, controling the action that happens on the click of the linkbutton, are you trying to perform a codebehind function?

I tried both with and without a trigger.

I figure the code doesn't need a trigger section because it is being triggered from a linkbutton within the UpdatePanel.

However, I just want to make sure I made it clear that I did try it.


dblock,

It looks like the major difference between your code and mine is that you seem to put every linkbutton within its own updatepanel, and then the entire list is enclosed within a "wrapper" updatepanel.

Is that right?

I will give it a try and see if that helps. Do you know if it is required?

Thanks for the help.


speednet:

dblock,

It looks like the major difference between your code and mine is that you seem to put every linkbutton within its own updatepanel, and then the entire list is enclosed within a "wrapper" updatepanel.

Is that right?

I will give it a try and see if that helps. Do you know if it is required?

Thanks for the help.

I definitely had this working without having every linkbutton in its own updatepanel (with just the wrapper one). That would update the entire grid. For me the trick has been to catch the grid item command, not the button click.


I just threw this together (as you probably can tell!) and it works for me. I'm using the June CTP if that may have anything to do with it. Here's the ASPX file:

<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title>
</head>
<body>
<formid="form1"runat="server">
<atlas:ScriptManagerID="ScriptManager1"EnablePartialRendering="true"runat="server"/>
<atlas:UpdatePanelID="UpdatePanel1"Mode="conditional"RenderMode="inline"runat="server">
<ContentTemplate>
<asp:RepeaterID="Repeater1"runat="server"OnItemCommand="Repeater1_ItemCommand">
<ItemTemplate>
<asp:LinkButtonID="LinkButtonTest"runat="server"CommandName='<%# Eval("Name") %>'Text='<%# Eval("Name") %>'></asp:LinkButton><br/>
</ItemTemplate>
</asp:Repeater>
<br/>
<asp:LabelID="Label1"runat="server"></asp:Label>
</ContentTemplate>
</atlas:UpdatePanel>
</form>
</body>
</html>

...and the C# file:

using

System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public

partialclass_Default : System.Web.UI.Page
{
protectedvoid Page_Load(object sender,EventArgs e)
{
List<Test> tests =newList<Test>();

tests.Add(newTest("Apple"));
tests.Add(newTest("Berry"));
tests.Add(newTest("Cherry"));

Repeater1.DataSource = tests;
Repeater1.DataBind();
}

protectedvoid Repeater1_ItemCommand(object source,RepeaterCommandEventArgs e)
{
Label1.Text = e.CommandName;
}
}

public

classTest
{
privatestring _name ="";

publicstring Name
{
get {return _name; }
}

public Test(string name)
{
_name = name;
}
}

Apart from the table tags, this is pretty much the same as you're doing.

(Apologies for the spacing... I'm a spacing freak!)


The inner UpdatePanel did not help. I'll post a complete code sample, without editing out the unnecessary stuff. Maybe someone will know why the Command event is not firing.

<asp:PlaceHolder ID="Content" runat="server"><div class="results"><p class="question"><asp:Literal ID="Question" runat="server" /></p><atlas:UpdatePanel ID="UpdatePanel" Mode="Conditional" runat="server"><ContentTemplate><asp:MultiView ID="Views" runat="server"><asp:View runat="server"><div class="choiceswrapper"><table class="choices" border="0"><asp:Repeater ID="Choices" OnItemCommand="Choices_Click" runat="server"><ItemTemplate><tr><td><atlas:UpdatePanel ID="InnerUpdatePanel" Mode="Conditional" runat="server"><ContentTemplate><asp:LinkButton ID="Choice" CssClass="choice" onmouseover="this.className='choiceon';" onmouseout="this.className='choice';" CommandName='<%#Eval("ID")%>' Text='<%#Eval("Name")%>' runat="server" /></ContentTemplate></atlas:UpdatePanel></td></tr></ItemTemplate><FooterTemplate><tr><td><asp:LinkButton ID="Choice" CssClass="discardoption choice" onmouseover="this.className='discardoption choiceon';" onmouseout="this.className='discardoption choice';" CommandName="0" Text="Discard" runat="server" /></td></tr></FooterTemplate></asp:Repeater></table></div><p class="instructions">After you register your vote the current results will be displayed. Select "Discard Vote" to see the results without voting (your vote is discarded permanently).</p></asp:View><asp:View runat="server"><div class="options"><table><tr><td>Entry 1</td><td> [ <strong>0</strong> ] </td><td><img src="images/bar.gif" width="4" height="11" alt="" /></td></tr></table></div><div class="foot"><div class="center"><strong>You are already logged in.</strong></div></div></asp:View></asp:MultiView></ContentTemplate></atlas:UpdatePanel><div class="tblrowseparator"></div></div></asp:PlaceHolder>

Only the first View in the MultiView is used right now. I kept the extra UpdatePanel in there, from the test I mentioned in my last post. Also, in case anyone is wondering, I tried removing the MultiView from the UpdatePanel, and it still did not work.

The code-behind looks like this:

Sub Choices_Click(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.RepeaterCommandEventArgs)Handles Choices.ItemCommandIf (Me.Master.CurrentUser.LoggedInAndActivated)Then'I set a breakpoint on the "If" statement above to see if the code ever entered the event'... Much more code hereEnd IfSetupAndDisplay(Me.Master.CurrentUser.ID)End Sub

Thank you Jason!

Can you take a look at the code I just posted and see if you can see any problems?

I am using the June CTP (which is awesome), so I'm OK there. I was thinking maybe it was the MultiView, but it stll didn't work when I tried removing it.

My ScriptManager is on the Master page (which works fine for another UpdatePanel on the same page).


I'm pretty sure the problem has something to do with the repeater.

I completed removed the repeater, and replaced it with just a single linkbutton in the table, and then wired the code-behind to the linkbutton command (instead of the repeater item command event) and it did execute the code.

Any eagle-eyes see a problem with my repeater code? Should I try a different template control?


Hmm... when I tried your code straight, I got nothing (could be the MultiView for me!). So I removed the MultiView and the inner UpdatePanel (definately not needed) and I was able to get the event to fire.

I'll try adding the the MultiView back in to see if that might be the issue.


Oops... didn't set the ActiveIndex of the MultiView to 0 :|

Anyway, I've added your MultiView code (almost) exactly and I definately getting the Choices_Click event firing. The only things I changed was removing the inner UpdatePanel.

When I re-added the inner UpdatePanel the event did NOT fire. So that's what I believe to be the issue.


Jason,

First of all, thank you very much for taking the time to test out my code - much appreciated!

That inner UpdatePanel was only in there as a test, and I tried testing both with and without it. Didn't work either way.

It is interesting that when I removed the repeater it started to work.

Looking at my code for the 1,000th time today, I'm reasonably sure it is good, valid code. Itshould work. The fact that you successfully tested it on your end would indicate that also.

It is quite possible that something else is interfering with the operation of this code, maybe it's just going to take another day of trial and error to eliminate all the possibilities.

It's also possible that I have some combination of things that is exposing a rare bug. My web site is very complex, so it wouldn't surprise me. I was actually hoping that if I posted the code it might help spark an idea from one of the Atlas developers or contributors.

In any case, if you can think of anything else that may be causing the problem, I would appreciate whatever you could offer. Once I'm able to narrow down the problem, I'll post my solution here.

Thanks again for your help.

-Todd


I believe I have finally nailed down the basic problem, although the exact details are still a little murky.

It turns out that this is one of those very tricky areas in ASP.NET, and not actually and Atlas issue. It has been blogged by Scott Mitchell (of 4guysfromrolla.com) in the past. Here are the relevant links:

http://scottonwriting.net/sowBlog/posts/1263.aspx

http://scottonwriting.net/sowblog/posts/1268.aspx

Although I did not find the exact solution for the ASP.NET issue described in the blog entries, it helped me identify the basic issue so I could code around it.

The solution I came up with works pretty well and is not too kludgy:

1. I put a <asp:HiddenField> tag within the UpdatePanel, and used it to PostBack an ID code (the same ID code that I was originally going to PostBack as a command argument). I included the HiddenField inside the UpdatePanel so that I could reset it to an empty string after each PostBack. If it was outside the UpdatePanel, I would not be able to update it during the partial render.

2. I kept the LinkButtons in the Repeater, but added an OnClientClick event to each one that loads the ID code into the HiddenField. Check out the weird syntax I had to come up with, to overcome all the different quote characters: OnClientClick='<%#String.Format("$({2}{0}{2}).value={2}{1}{2};", HiddenTag.ClientID, Eval("ID"), Chr(39))%>' You may also notice the Atlas shortcut "$()" is used instead of document.getElementById().

3. I stripped out all Repeater and Control Events, and now process everything in the Load event. The Load event looks for a value posted back in the HiddenField, because if the HiddenField contains anything, that means one of the LinkButtons in the repeater must have been clicked. So although the LinkButtons still perform the PostBack (with partial rendering), they are only used to jumpstart the processing in the Load event, and nothing else.

I hope this is helpful to anyone else who encounters the same problem with template controls and PostBacks. It may save you the day-and a half that I have spent on this issue.

Saturday, March 24, 2012

UpdatePanel and DateControl Problem

Hi,

I have an UpdatePanel wrapped around a repeater and a button. The repeater has a Peter Blum DateTextBox which uses a lot of javascript as well

The Date controls work fine the first time the page is loaded, but once I click the button that is inside the updatePanel, the DateControl stops working. If I try to modify the text box an alert is displayed which says that the page is loading. I tested using an update progress control to check if any asych post backs going on at that time and there were'nt.

So is this a bug in Atlas, that it does not work with javascript intensive controls or am I doing something wrong.

here is a portion of the aspx page

<

br/><br/><atlas:UpdateProgressID="progress"runat="server"><ProgressTemplate>Page is Loading<asp:ImageID="Loading"runat="server"ImageUrl="http://asyncpostback.com/Images/spinner.gif"/></ProgressTemplate></atlas:UpdateProgress>

<

atlas:UpdatePanelID="updateRepeater"runat="server"Mode="conditional">

<

Triggers>

<

atlas:ControlEventTriggerControlID="Button2"EventName="Click"/>

</

Triggers>

<

ContentTemplate><asp:RepeaterID="Repeater1"OnItemCreated="OnItemCreated"runat="server"><ItemTemplate><table><tr><td><asp:DropDownListID="ddlLocations"runat="server"></asp:DropDownList></td><td><Date:DateTextBoxID="DateTextBox"xDate='<%#Eval("StartDate")%>'xPopupCalendar-xAutoSharedCalendarB="true"runat="server"></Date:DateTextBox></td></tr><tr><td><asp:LabelID="lblTest"runat="server"Text='<%#Eval("VenueID")%>'></asp:Label></td></tr></table></ItemTemplate></asp:Repeater></ContentTemplate>

</

atlas:UpdatePanel>

<

asp:ButtonID="Button2"runat="server"OnClick="onClick2"Text="Button"/>

If anybody has any idea it would be grealty appreciated.

thanks

I found out the reason for this problem. I was actually using a third party control that was designed before Atlas came out. This control wrote its own scripts. When this was placed inside an update panel the HTML tags of the web control are replaced by Atlas. However, the javascript that was written by this control is no longer used, since Atlas is unaware of that. The Validators do not work with update panels for similar reasons.

As far as third party controls are concerned, any control that uses thePage.RegisterArrayDeclaration, Page.RegisterStartupScript or Page.RegisterClientScriptBlock will probably break with AJAX.


hello.

can you explai what you mean by "the htmltags of the web controls are replaced by atlas"? btw, i'm not really sure on why you say that using the clientscriptmanager methods will break in this version of atlas...


I too am using Peter Blum's Date controls and his Validation controls, and Atlas seems to break all of them for me too.

Rob

Wednesday, March 21, 2012

UpdatePanel and RequiredValidator

Hi,

I have an UpdatePanel which has a Repeater inside. Each ItemTemplate of Repeater containers a Textbox and its RequiredValidator. Here is the code

<atlas:UpdatePanel ID="ButtonLabelContainerPanel" runat="server">
<ContentTemplate>
<asp:Repeater ID="ButtonLabelContainer" runat="server">
<ItemTemplate>
<div id="LabelRow" class="formRow">
<label id="Label1" for="ButtonText" runat="server"><%=Resources.InterfaceKitsResource.ButtonLabel %></label>
<asp:TextBox ID="ButtonText" Text="<%# Container.DataItem %>" runat="server" />
<asp:RequiredFieldValidator ID="ButtonTextValidator" ControlToValidate="ButtonText" ValidationGroup="CreateButtonImageValidationGroup" Text="Button Label is required" runat="server" Display="Dynamic" />
</div>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="addLabel" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>

Notice the Validator has a "ValidationGroup".. somewhere else on the page, I have a button (not part of the trigger) which will be clicked and has the same "ValidationGroup"...

The issue is.. all empty textbox within the repeater shows up the error message EXCEPT the first textbox.

What am I doing wrong?

hello.

can you build a repro page and post it here?


Yeah, here is a watered down version of what i have

-----
<%@. Page Language="C#" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindButtonContainer();
}
}

private void BindButtonContainer()
{
ArrayList ButtonLabelArray = new ArrayList();
ButtonLabelArray = getButtonTextList(false);
ButtonLabelArray.Add("");
ButtonLabelContainer.DataSource = ButtonLabelArray;
ButtonLabelContainer.DataBind();

}

private ArrayList getButtonTextList(bool createHover)
{
ArrayList ButtonLabelArray = new ArrayList();
foreach (RepeaterItem item in this.ButtonLabelContainer.Items)
{
TextBox mytextBox = (TextBox)item.FindControl("ButtonText");
ButtonLabelArray.Add(mytextBox.Text);
}
return ButtonLabelArray;
}

protected void AddButtonLabel(object sender, EventArgs e)
{
BindButtonContainer();
}

protected void BindOutputImages(object sender, EventArgs e)
{
Output.DataSource = getButtonTextList(false);
Output.DataBind();
}

</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<atlas:ScriptManager ID="scriptmanager1" EnablePartialRendering="true" runat="Server" />
</head>
<body>
<form id="form1" runat="server">
<div id="RepeaterSection">
<atlas:UpdatePanel ID="ButtonLabelContainerPanel" runat="server">
<ContentTemplate>
<asp:Repeater ID="ButtonLabelContainer" runat="server">
<ItemTemplate>
<div id="LabelRow" class="formRow">
<label id="Label1" for="ButtonText" runat="server"><%=Resources.InterfaceKitsResource.ButtonLabel %></label>
<asp:TextBox ID="ButtonText" Text="<%# Container.DataItem %>" runat="server" />
<asp:RequiredFieldValidator ID="ButtonTextValidator" ControlToValidate="ButtonText" ValidationGroup="CreatButtonGroup" Text="Button Label is required" runat="server" Display="dynamic" />
</div>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="addLabel" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
<asp:LinkButton ID="addLabel" CssClass="addFormRow" Text="Add Another" OnClick="AddButtonLabel" runat="server" />
</div>

<div id="output">
<asp:Button ID="CreateButtons" runat="server" OnClick="BindOutputImages" ValidationGroup="CreatButtonGroup" Text="Create Button" />

<atlas:UpdatePanel ID="OutputPanel" Mode="Conditional" runat="server">
<ContentTemplate>
<atlas:UpdateProgress ID="OutputInProgress" runat="server">
<ProgressTemplate>
Working...
</ProgressTemplate>
</atlas:UpdateProgress>

<asp:Repeater ID="Output" runat="server">
<ItemTemplate>
<div class="generatedButton">
<%# Container.DataItem %>
</div>
</ItemTemplate>
</asp:Repeater>

</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="CreateButtons" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
</div>
</form>
</body>
</html>
------
To test this..

1) fill in something in the first textbox, click on "Add Another"
2) fill in something in the second textbox click on "Add Another" again
3) click "create button"

Now you should see the text you entered on the bottom correct?

4) get rid of the text in the second texbox
5) click "create button"

The text of the requiredvalidator shows up as expected.. But now try this...

6) get rid of the text in the first textbox as well...so now you have both empty text boxes
7) click "create button"

See the problem? the requiredvalidator text next to the first textbox did not show up.

The only time it shows up for the first textbox is when it's the ONLY textbox in the repeater. When page load, without entering anythign, just one textbox, click "create button". It'll work.

This only stops working when there are multiple itmes in the repeater.
and oh btw,

the display="dynmaic" stopped functioning as well.

say

1) enter soemthign in first textbox
2) click "add another"
3) without entering anything in the second textbox, click "create button"

you'll see the red requiredvalidator error next to the the second box. now try

4) to fill something into the secondbox,
5) tab away to "create button"

normally without updatepanel, the red text will disappear right away, but now it doesn't.

I'm using firefox 1.5

hello.

that's weird. i've followed the steps you've mentioned in your previous post and here i get the error on the first validator too! if i fill the textbox and hit tab, the error goes away, so i really can't reproduce the errors you're having...btw, i've tested it in IE 6 and firefox 1.5 too.

can you repro those errors on another machine? i can try to look at it tomorrow at work, where i have win 2003 server, but here with xp sp2 and the march ctp of atlas, everything went well.


Hello Luis,

Yeah, I've deployed onto an windows 2003 server with march CTP, i get teh same problem.

Everything else works except the first validator and "display='dynamic'". I'm guess this is a bug in Atlas. Worst to worst, I'll have to resolve to traditional javascript dom for this matter. But if you have any insight, please do post here.

Thanks a a lot!

hello again.

well, i've tried here at work and guess what? well, validation wasn't working well with firefox. so, why was it working at home: simple, because i've changed the atlas.js code that i'm using in my pages.

the problem i was getting was related with the way validation was working. after adding elements to the page, i was allways getting a postback. so, several things go wrong here:

1. the update panel isn't working properly with validation because the method that submits the form doesn't verify the state of the validators before doing the submit (i've pointed this problem in several post here)

2. after copying the js files used on the client side validation, i noted that the number of validators on the page was allways 1. using fiddler i could see that they were returning it correctly (there was as script section with 2 validators on it). it was then that i recalled having found a bug related with the way firefox interprets the script nodes returned from the server side. the problem is that to firefox \n is a node while it's discarded in IE (i really don't know which implementation is correct; this is just an observation related with the way both browsers behave). so, the problem was that firefox was executing "\n" (which simply doesn't do anything) while ie was executing the var Page_Validators ... line which redefines the validators arrays.

how to solve these? i've presented a simple solution to number 1 in previous posts

related with number 2, i say that the _updatescripts method of the atlas.js (or atlasruntime.js) has to be modified so that it has this line:

if

(xmlScriptNode.childNodes.length != 0) {
for (var c = xmlScriptNode.childNodes.length - 1; c >= 0; c--) {
var nodeType = xmlScriptNode.childNodes[c].nodeType;
if ((nodeType == 3) || (nodeType == 4) || (nodeType == 8)) {
text = xmlScriptNode.childNodes[c].nodeValue;
if( text =="\n")
{
continue;
}
break;
}
}
}

the bolder bigger lines solve the interpretation issue on firefox. hope this helps.


Hi Luis,

This problem with scripts in Firefox is fixed in the April CTP, which we will be releasing this month (obviously!).

Thanks,

Eilon


howdy again!

that's great! thanks again.