G
Guest
Hi,
I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.
Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.
The code for that currently looks something like this:
foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Text;
foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;
foreach (RepeaterItem tierItem in tierRepeater.Items)
{
sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")).Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Text;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Value;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;
ListOAPYs.Add(rcDTO);
}
}
Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.
If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.
thanks!!
Bill
I am new to the MVP pattern and one of the main reasons that we are going
this route is because we are doing Scrum with 30 day sprints - so we have a
continually morphing design. We are using TDD as well to improve our ability
to refactor... you probably all know this approach.
Although the user iterface is supposedly one of the last things that you
need to do, this is a web app and we have multiple nested Repeaters on the
page. Within these repeaters we have a textbox in one column that we need to
retrieve contents from. I have been struggling trying to find examples of
something like this as I can't figure out how to expose this to the view
through the interface. Having a single control on the page is easy to use
through the interface. Retrieving the data in the code behind depends on
using Repeater names and FindControls, etc.
The code for that currently looks something like this:
foreach (RepeaterItem pgItem in ProdGroupRepeater.Items)
{
Repeater prodRepeater = (Repeater)pgItem.FindControl("ProductRepeater");
sProdGroup = ((Label)pgItem.FindControl("ProductGroupName")).Text;
foreach (RepeaterItem prodItem in prodRepeater.Items)
{
Repeater tierRepeater =
(Repeater)prodItem.FindControl("TiersRepeater");
sProduct = ((Label)prodItem.FindControl("ProductName")).Text;
foreach (RepeaterItem tierItem in tierRepeater.Items)
{
sRecommendedAPY =
((TextBox)tierItem.FindControl("RecommendedAPY")).Text;
sApprovedAPY =
((TextBox)tierItem.FindControl("ApprovedAPY")).Text;
sMinBal = ((HiddenField)tierItem.FindControl("MinBal")).Value;
RateChangeDTO rcDTO = new RateChangeDTO();
rcDTO.RecommendedAPY = sRecommendedAPY;
rcDTO.ProductGroup = sProdGroup;
rcDTO.ProductName = sProduct;
rcDTO.DistrictID = sDistrictID;
rcDTO.MinBal = sMinBal;
ListOAPYs.Add(rcDTO);
}
}
Is there some way to retrieve the data from these textboxes in the MVP
pattern? I searched for a couple days and coudn't find any examples similar
enough that I could apply.
If this isn't enough info to help, I could put together a simple example
that uses these same concepts. Maybe I'm totally off base here - like I said,
I'm completely new to all of this.
thanks!!
Bill