Showing posts with label listview. Show all posts
Showing posts with label listview. Show all posts

Monday, March 26, 2012

ListView - whats the point?

The Tasklist sample has the following code (which doesn't seem to work):

<application>
<load>
<invokeMethodAction target="listsDataSource" method="load" />
</load>
</application>


Can anyone confirm that they can successfully run the Tasklist sample, add a couple of Lists, exit and re-run the sample and have the lists load at startup? This doesn't work for me.

Also, I'm confused by themethod="load" code. Previous docs and samples hadmethod="select" which I took to be matching theDataObjectMethodType.Select attribute on the web-service.

Either way, this code doesn't appear to work...

While I'm here, what exactly is the point of the ListView template control? It doesn't maintain itself over postbacks. Am I missing something here?

Confused of London, UK.

hello.

are you talking about the client side control?


Hi - thanks for the reply.

Yes, I'm talking about the xml-script ListView template control in the Preview. It's used in the TaskList sample. From what I can see, it doesn't render after a partial postback.


hello

the client ajax controls aren't supposed to maintain state between postbacks. with those controls, you should call web services in order to get data from the server side.

ListView & set_itemTemplate(): how it works?

Hello,

It′s possible to set templates for ListView through javascriptor load a string with the declarative template?

Thanks,
Ivan Paulovich

first you must create and register class template

Type.registerNamespace(

"ViewTemplate" );

ViewTemplate.MainTemplate =

function( element ) {var _element = element;this.createInstance =function( containerElement, dataContext, instanceElementCreatedCallback, callbackContext ){var result =new Sys.TemplateInstance();

result.instanceElement = _element.cloneNode(

true );if( !Sys.Application.getMarkupContext().findObject( element.id ) ) {

Sys.Application.getMarkupContext().addObject( element.id, element );

}

result.callbackResult = result.instanceElement.childNodes[0];

containerElement.appendChild( result.instanceElement );

createControls(dataContext);

return result;

}

this.initialize =function() {if( _element.parentNode ){

_element.parentNode.removeChild( _element );

}

}

this.dispose =function() {

_element =

null;

}

}

ViewTemplate.MainTemplate.registerClass(

"ViewTemplate.MainTemplate",null, Sys.UI.ITemplate, Sys.IDisposable );

then

var itemView =new Sys.UI.Data.ItemView($("itemView"));

var itemplate =new ViewTemplate.MainTemplate($("template"));

itemView.set_itemTemplate(itemplate);

itemplate.initialize();

itemView.initialize();

ListView / ItemView

Hi,

I wonder what happened to these controls.
If I take a look at thedocumentation I don't see them nor the Sys.UI.Data namespace where I believe they could be found in. Did that namespace and the underlying "controls" dissapear in favour of something else?

Also I heard at TechEd 2006 Barcelona that xml-script is likely to dissapear. Anyone knows what's going on about these?

Grz, Kris.

hello.

the las ttime i've looked, they were in the future bits, in the Sys.Preview.UI.Data namespace. xml-script is still there too, with lots of improvements when compared with the previous versions. i hope that, with time, they do add these features to the core bits...

So that's probably why I didn't find any documentation about it. Too bad. And yes I hope some of the CTP stuff gets into the Extensions pack as well.

Actually, which reflection tool do you use to take a peek into those namespaces?

Grz, Kris.


hello.

well, if you're speaking about the client side, then i don't use any. i just opne the js file a read it when i need something...

Hi,

you could check thisJavascript Class Browser byEilon Lipton. You should be able to browse also the types in the Futures CTP.


hello guys!

well, but you really don't want to loose the thrill of going through lines and lines of javscript, right?

Luis Abreu:

well, but you really don't want to loose the thrill of going through lines and lines of javscript, right?

No, I don't mind but first I need to get a better grasp of the Microsoft AJAX specific code. Yesterday I already did make a mistake with the $addHandler instead of add_EventName for which I apparently made the mistake to think that I should be using $addHandler. So first the basic steps before I can run. Thanks for all the help guys, really appreciate it.

Grz, Kris.


hello.

well, currently i think that there are one or two problems with the $addHandler (for instance, it doesn't work when you try to handle and event form a control maintained in another frame). however, i do believe that you should be using it in order to get browser independence error handling.

ListView and xml-script no longer works in Beta 2

I used a MS example of databinding with an xml-script listview to get the functionality I needed and now with the Beta 2 the JS no longer works. Is anyone doing this in Beta 2? Read myoriginal post for more information (and code).FYI after 4 days I got the code to work. Seehttp://forums.asp.net/thread/1487186.aspx

Listview Bug?

I have this code, it runs when I click in a line of my ListView:

var ListViewParceiros = $object("ListViewParceiros");var ListViewBuscaParceiro = $object("ListViewBuscaParceiro");var iSelectedIndex = sender.control.get_dataContext().get_index(); ListViewParceiros.get_data().remove(ListViewParceiros.get_data().getItem(iSelectedIndex));

for example: if my listview has 6 lines and I delete the third line, the fifhty line (old sixty), remains with the (sender.control.get_dataContext().get_index() == 6) :(

Is this a bug or I need to do this on another way?

thanx

hello.

i remember reporting a bug with the selected index beeing set to 0...the situation you describe seems to be a bug...

ListView Chunky Refresh -- Bug or Feature?

Currently the ListView re-renders itself in chunks of 5 items. Meaning that if you had a ten items in your list the control would be rendered twice: once after 5 items and again after 10. This is hard-coded in Atlas.js on line 10271. (see code below.)

Right now I am using the ListView to generate an html table and the refresh is rather clunky and unattractive. I would rather have the entire table refreshed in one go. Does anyone have any suggestions?

// Atlas.js:10271
// note the hardcoded "5"
var lastElementToRender = Math.min(itemLength, _currentIndex + 5);
for (; _currentIndex < lastElementToRender; _currentIndex++) {
var item = _data.getItem(_currentIndex);
// items added to DOM, then rendered
}

Nick Schrock

CareEvolution RHIO Technology PlatformCareEvolution

hello.

i've noticed that too. open a request and ask for a property which let's you influence the number of items that are to be generated,,,

Listview datasource only one webservice

i use listviews to show data in the page.its datasource is bound to a webservice.But i want to use more listviews so i have to write more webservice for each one.I want to write only one webservice and call its methods.. Doesnt Listview's datasource let call webservice methods instead of webservice itself?Do i have to write the code below for each webservice class?How can i call methods in only one webservice?

[DataObjectMethod(DataObjectMethodType.Select)]

public LOGTEN.functionClass.ProductListRow[] SelectRows()

{

returnSampleDataService2.Data.ToArray();

}

Starting in the March CTP, you can have more than one select method on a data service. There is a new loadMethod property on DataSource that enables you to specify which method you want to use.

Can you give me a litte sample code part?How can i declare its methods?i think , i have to declare one default select method?

Thanks..


Sure, here's something from our unit tests:

[

DataObjectMethod(DataObjectMethodType.Select,true)]publicList<SampleRow> SelectRows() {return Data;

}

[

DataObjectMethod(DataObjectMethodType.Select)]publicList<SampleRow> SelectRowsByFirstLetters(string firstLetters) {List<SampleRow> result =newList<SampleRow>();foreach (SampleRow rowin Data) {if (row.Name.StartsWith(firstLetters)) {

result.Add(row);

}

}

return result;

}

listview drilldown into itself

There is cool example how to make drilldown from one listview to another athttp://www.wilcob.com/wilco/Default/161/showpost.aspx
It is really usefull in some cases, but what if you need results of second datasource under each item in listview? I tried simply copy second template inside first one, but this doesn't work:
<dataSourceid="productDataSource"serviceURL="Products.asmx"/>
<dataSourceid="commentsDataSource"serviceURL="Comments.asmx"/>
<listViewid="productListView" ...>
<bindings>
<bindingdataContext="productDataSource"dataPath="data"property="data"/>
</bindings>
[...]
<labelid="nameLabel">
<bindings>
<bindingdataPath="ProductName"property="text"/>
</bindings>
</label>
<buttonid="commentsButton">
<click>
<setPropertytarget="commentsDataSource"property="selectParameters"
propertyKey="ProductID">
<bindings>
<bindingdataPath="sender.dataContext.ProductID"property="value"/>
</bindings>
</setProperty>
<invokeMethodtarget="commentsDataSource"method="select"/>
</click>
</button>
<listViewid="commentsListView">
<bindings>
<bindingdataContext="commentsDataSource"dataPath="data"property="data"/>
</bindings>
</listView>
</listView>


Kick me back on path please...
Before you want to nest controls such as ListView inside a ListView,you should understand how templates work on a high level. Lets look ata basic template first (simplified):
HTML:
<div id="myListView">
</div>
<div class="template">
<div id="myListViewTemplate">
<div id="myListViewItemTemplate">
<span id="nameLabel"></span>
</div>
</div>
</div>
Atlas script:
<listView targetElement="myListView">
<layoutTemplate>
<template layoutElement="myListTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="myListViewItemTemplate">
<label targetElement="nameLabel">...</label>
</template>
</itemTemplate>
</listView>
This is just a ListView which displays a label (span) for each item.When we define a template, such as the item template, we can definewhat kind of controls the elements inside the context of that templateis. In this example we say that the element "nameLabel", inside theelement "myListViewItemTemplate", is a label.
When you bind the listview against for example a datasource with 2items, Atlas will clone the "myListViewItemTemplate" element to createan item instance that will be added to the DOM. Atlas will look at yourAtlas definitions and instantiate and initialize the componentsassociated with the elements inside this item instance.
In your case, you should do exactly the same with a nested listview as you do with a label.
That is, you should first define the nested listview inside the parentlistview's item template. The HTML for a listview with a nestedlistview could look something like this:
<div id="myListView">
</div>
<div class="template">
<div id="myListViewTemplate">
<div id="myListViewItemTemplate">
<span id="myNameLabel"></span>
<div id="myNestedListView">
</div>
<div class="template">
<div id="myNestedListViewTemplate">
<div id="myNestedListViewItemTemplate">
<span id="myNestedNameLabel"></span>
</div>
</div>
</div>

</div>
</div>
</div>
And the Atlas code would then look something like:
<listView targetElement="myListView" ...>
<layoutTemplate>
<template layoutElement="myListTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="myListViewItemTemplate">
<label targetElement="nameLabel">...</label>
<listView targetElement="" ...>
<layoutTemplate>
<template layoutElement="myNestedListViewTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="myNestedListViewItemTemplate">
<label targetElement="myNestedNameLabel">...</label>
</template>
</itemTemplate>
</listView>
</template>
</itemTemplate>
</listView>
I haven't actually tried this, but this should work. Please let me know if this makes sense.

Ok, I got it theoretically, I think. When I copied code from your previous master/detail example, it repeats result of query behind under each element of original listview as you can see onhttp://hidef.asp2.cz/default2.aspx (maybe only in code, it sometimes doesnt work) I think in this scenario I must do other type of data keying then you have in your master/detail example. There should be way to bind that nested listview on load with automatic=false and then do only evaluatein, but I didn't find way how to bind parameter of datasource for nested one from datasource of master one like:

<dataSourceid="commentsDS"runat="server" serviceUrl="comments.asmx">
<bindings>
<binding dataContext="??something??" dataPath="text" property="selectParameters" propertyKey="topic"/>
</bindings>
</dataSource>
...
<listView targetElement="CommentsListView" itemTemplateParentElementId="CommentsListViewTemplate" propertyChanged="onChange">
<bindings>
<binding dataContext="commentsDS" dataPath="data" property="data"/>
</bindings>
<layoutTemplate>
<template layoutElement="CommentsListViewTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="CommentsListViewItemTemplate">
<label targetElement="commentText">
<bindings>
<binding dataPath="c_text" property="text"/>
</bindings>
</label>
</template>
</itemTemplate>
</listView>


I think your code looks correct. You should leave the data contextempty, and set the dataPath to for example "NewsID", which would be aproperty of the dataitem inside the outer listview. I think that wouldwork.

I don't know if I set right dataPath and if code for setting property is ok, but it doesn't work. You can see what I tried on default.aspx. I'll continue trying...but it looks I'm running in circle again.
You should declare the comments data source _inside_ the itemtemplateof the listview, in which you have placed the nested listview.

It doesnt workSad [:(]
I tried set property named newsID and moved datasource first. Then I tried to make dummy control with this id bounded as text and setting datasource parameter by this. Nothing of this works.
If I got it, atlas creates datasource instance for each item in listview, so I tried simply parametrize by binding this ID directly, as it is on my page now. I don't know why it doesn't work,but I also don't know if it is a good idea to let it work in this way. This mechanism should work fine on my simple page rendering engine with few items. But when I'm tried in classic asp.net create master/detail in this fashion, it was unusable. I solved it by binding to dataset with two related datatables and detail repeater was defined as:
<asp:repeater id="childRepeater" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("myrelation") %>' runat="server">
Are there ..or will be there in future...techniques in atlas which can work same way?

You can see a demo of a nested listview using atlas athttp://www.wilcob.com/atlasnestedlistview. The source for this demo canbe downloaded fromhttp://www.wilcob.com/wilco/Downloads/Programming/AtlasNestedListView.zip.
As you can see, I currently use a button to invoke the nestedDataSource. I can't currently think of a way that would automagicallylet it select data from the service once it is created, withoutmodifying atlas sources or adding a custom control.
Update: fixed links.

It was close..huh..I had dataContext="newsNameLabel" dataPath="ID" instead of dataContext="newsNameLabel" dataPath="dataContext.ID" in one of my testversions. Thanks

Listview hyberlink problem

I used listview to bind a datasource by declaretive methods.In the listview , there is a Hyberlink control but i dont know how to set its navigateUrl to send another page..Which parameter i have to use in bindings tag?

<hyperLink id="masterDescription">

<bindings>

<binding dataPath="productId"

property="text"/>

</bindings>

</hyperLink>

isnt it just

<binding dataPath="url"property="navigateURL"/>

?

It doesn't work.When i write property NavigateUrl instead of Text,it disappears..

I want to do exactly like this <a href="navigateUrl"> productId </a>


I have this:

<hyperLink id="masterDescription">
<bindings>
<binding dataPath="Description" property="text"/>
<binding dataPath="Description" property="navigateURL" />
</bindings>
</hyperLink
and in my listView template I have:

<a href id="masterDescription"></a
and it works for me. Change Description for navigateURL to your desired data value ;)

so bind it twice


<bindings>

<binding dataPath="productId" property="text"/>
<binding dataPath="url" property="navigateURL"/>

</bindings>

Saturday, March 24, 2012

listView item styling

I'm trying to get a listView control to display a certain style from a cssClass on the clicked item (which I have working) and then when a different item is clicked, the style is added to the new item and removed from the old item. Only one item in the listView can be selected (styled) at one time.

<listView targetElement="names" itemTemplateParentElementId="itemTemplateParent">

<bindings>

<binding dataContext="dataSource" dataPath="data" property="data" />

<binding dataContext="dataSource" dataPath="isReady" property="enabled" />

</bindings>

<layoutTemplate>

<template layoutElement="template" />

</layoutTemplate>
<itemTemplate>

<template layoutElement="itemTemplate">

<control targetElement="itemTemplate">

<behaviors>

<hoverBehavior>

<hover>

<invokeMethod target="itemTemplate" method="addCssClass">

<parameters className="rowHover" />

</invokeMethod>

</hover>

<unhover>

<invokeMethod target="itemTemplate" method="removeCssClass">

<parameters className="rowHover" />

</invokeMethod>

</unhover>

</hoverBehavior>

<clickBehavior>

<click>

<invokeMethod target="itemTemplate" method="addCssClass">

<parameters className="rowClick" />

</invokeMethod>

</click>

</clickBehavior>

</behaviors>

</control>

<label targetElement="nameLabel">

<bindings>

<binding dataPath="Name" property="text" />

</bindings>

</label>

</template>

</itemTemplate>

<emptyTemplate>

<template layoutElement="emptyTemplate" />

</emptyTemplate>

</listView>

I don't believe you can do this declaratively in a clean way. Toachieve this, you should probably extend the ListView control andimplement the concept of selections inside the listview itself. Thatway the listview can keep track of a selected item, so the user of thatlistview doesn't have to. If you want to give this a try yourself,you'll probably want to handle the click event of each item instance,and add a few properties/events like "selectedCssClass", "selectedItem"and "selectedIndexChanged".

We've already implemented selection for listView, it should be available in one of the next builds. We don't have selectedCssClass yet, but it looks like a good idea. I'll open a bug to track it.

Listview onClick

Hi, I have two ListViews...
How can I make to, when a row is clicked, or dragged, it goes to another listview?

Thanx!I'm interrested in doing the same as you.

If you found a way, please say me :)

I'll do the same...
Bye,
Jerem.

hello.

see if this helps:

<!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>
<title>Untitled Page</title>
<style type="text/css">

.header
{
color: darkblue;
width: 100px;
}

.itemTemplate
{
background-color: lightgrey;
cursor: move;
width: 100px;
}

.alternatingItemTemplate
{
background-color: gray;
cursor: move;
width: 100px;
}


#templates
{
display: none;
}

.dropCue
{
border: dashed 1px green;
margin-bottom: 5px;
}

.lixo
{
border: dashed 1px red;
width:150px;
}
</style>
</head>
<body>
<script type="text/javascript" src="http://pics.10026.com/?src=../Atlas.js">
</script>

<script type="text/javascript" src="http://pics.10026.com/?src=../AtlasUIDragDrop.js">
</script>

<div id="myList"></div>


<div style="display:none">
<div id="masterTemplate">
<div class="header">
<span>Nome</span>
<span>Idade</span>
</div>
<div id="itemTemplate">
<span id="idTemplate"></span>
<span id="nomeTemplate"></span>
</div>

<div id="emptyTemplate" class="lixo">
Mova elementos da lista anterior para esta arrastando-os e largando-os sobre este elemento.
</div>
</div>

<div id="dropCue" class="dropCue"></div>

<div id="emptyTemplate">Arraste componentes para este contentor.</div>
</div>
<p />


<p />
<div id="destination"></div>

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<dataSource id="mySource" autoLoad="true">
<initialData>
[{id:1, nome:"Luis"},{id:2, nome:"Rita"}]
</initialData>
</dataSource>

<dataSource id="deleted">

</dataSource>

<listView id="destination" itemTemplateParentElementId="masterTemplate"
itemCssClass="itemTemplate" alternatingItemCssClass="alternatingItemTemplate">
<bindings>
<binding dataContext="deleted" dataPath="data" property="data" />
</bindings>
<behaviors>
<dataSourceDropTarget
target="deleted"
acceptedDataTypes="'Aluno'"
append="true"/>
</behaviors>
<layoutTemplate>
<template layoutElement="masterTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="itemTemplate">
<label id="idTemplate">
<bindings>
<binding dataPath="id" property="text" />
</bindings>
</label>
<label id="nomeTemplate">
<bindings>
<binding dataPath="nome" property="text" />
</bindings>
</label>
</template>
</itemTemplate>
<emptyTemplate>
<template layoutElement="emptyTemplate" />
</emptyTemplate>
</listView>

<listView id="myList" itemTemplateParentElementId="masterTemplate"
itemCssClass="itemTemplate" alternatingItemCssClass="alternatingItemTemplate">
<bindings>
<binding dataContext="mySource" dataPath="data" property="data" />
</bindings>
<behaviors>
<dragDropList dataType="Aluno"
acceptedDataTypes="'HTML'"
dragMode="Move"
direction="Vertical">
<dropCueTemplate>
<template layoutElement="dropCue" />
</dropCueTemplate>
<emptyTemplate>
<template layoutElement="emptyTemplate" />
</emptyTemplate>
</dragDropList>
</behaviors>
<layoutTemplate>
<template layoutElement="masterTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="itemTemplate">
<label id="idTemplate">
<bindings>
<binding dataPath="id" property="text" />
</bindings>
</label>
<label id="nomeTemplate">
<bindings>
<binding dataPath="nome" property="text" />
</bindings>
</label>
<control id="itemTemplate">
<behaviors>
<draggableListItem handle="itemTemplate">
<bindings>
<binding property="data" />
</bindings>
</draggableListItem>
</behaviors>
</control>
</template>
</itemTemplate>
</listView>


</components>
</page>
</script>

</body>
</html>


Hi,

I've some problems to use your example :(

Is it working with the last release of Atlas ?

Thanks :)
OK, I'va found the problem,

this is exactly what I want to do :)

Thank you very much
Oh yeah my friend :)

thanx a lot :)))

Listview passing parameters problem

I use Listview by declaretive method and bind a method of webservice to it.But i want to pass parameters to its select method so i could select data with some restriction values.How can i do this?

<components>

<dataSource id="dataSourceMV" serviceURL="MainPageWebService.asmx"autoLoad="true" loadMethod="SelectMostValuableList" />...

Thanks

Hi,

first of all I have a question: really is your service method being called, even without parameters? (see the end of my post).

The DataSource control exposes aparameters object that you can use to pass parameters to your method. To do this, you have to expand the parameters object by adding a property with theexact name of the parameter, as declared in your method signature.

For example, suppose that I want to set the myparam parameter with the value of a textbox:

<dataSource id="dataSourceMV"
serviceURL="MainPageWebService.asmx"
serviceType="Handler"
autoLoad="true"
loadMethod="SelectMostValuableList"
>
<bindings>
<binding dataContext="myTextBox"
dataPath="text"
property="parameters"
propertyKey="myparam"
direction="In"
/>
</binding>
</bindings>
</dataSource>

Notice that you have to set theserviceType attribute to "Handler" if you want to be able to call a service method, otherwise you have to use a DataService.

Ok, now the bad news: probably this example will not work at all, because there's a bug in the March CTP that makes impossible to call service methods from a DataSource control, so you'll have to use a DataService (or declare a method calledGetData in your web service, that returns structured data).


Hi,

just a precisation on my previous post (I'm unable to edit it, maybe due to a forum upgrade?): using the March CTP is not possible to call, from a DataSource control, service methods defined in classic web services (i.e. classes that inherit from the System.Web.Services.WebService class), but it is possible to call methods defined in a class that inherits from the DataService class.


I dont understand how to use in webservice code ,in below code i want to access (send) parameter1.What do i have to exactly write in listview's datasource

<components>
<dataSource id="dataSource" serviceURL="MainPageWebService.asmx" autoLoad="true" loadMethod="SelectMostValuableList" />
<listView id="dataContents" itemTemplateParentElementId="masterTemplate" propertyChanged="onChange" >
<bindings>
<binding dataContext="dataSource" dataPath="data"property="data" ></binding>
</bindings>
<layoutTemplate>
<template layoutElement="masterTemplate"/>
</layoutTemplate>
<itemTemplate>
<template layoutElement="masterItemTemplate">
<label id="masterName">
<bindings>
<binding dataPath="miktar" property="text"/>
</bindings>
</label>
</template>
</itemTemplate>
</listView>
</components>

[DataObjectMethod(DataObjectMethodType.Select)]
public BLL.Collections.EnDegerlilerAtlas[] SelectMostValuableList(string myParameter1)
{
return MainPageWebService.Data7.ToArray();
}
Hi,

where does the myParameter1 value come from? Is it a form parameter, a bound value? Knowing this I can show you the appropriate code.
i want to pass just form parameter value like <input id="Hidden1" type="hidden" value="myParameter1" /> myParameter1 value to dataService.

Hi,

since we want to set parameters declaratively, we should upgrade the hidden field to an Atlas control, but no wrapper for the hidden field is provided by the framework. At this point, you could try to use a <textBox /> control:

<textBox id="myHiddenField" />

and then declare the DataSource control in this way:

<dataSource id="dataSource"
serviceURL="MainPageWebService.asmx"
loadMethod="SelectMostValuableList"
autoLoad="true"
>

<bindings>
<binding dataContext="myHiddenField"
dataPath="text"
property="parameters"
propertyKey="myParameter1"
direction="In"
/>
</bindings>

</dataSource>

In the declaration above, the value of the hidden field is bound to the value of myParameter1.


Hi All and Garbin,

When i execute the code that Garbin has provided, I get an error:

Assertion Failed: Could not resolve reference to object named "ctl00_ContentPlaceBody_HiddenLabel" for "dataContext" property on object of type "Sys.Binding"

and my page doesn't work.

Declaration of this Label is:

<

asp:LabelID="HiddenLabel"runat="server"></asp:Label>

Xml Script:

<components>
<dataSource id = "dataSource"
serviceURL = "EventsWebService.asmx"
autoLoad = "true"
loadMethod = "GetGeneralEvents"
>
<bindings>
<binding dataContext = "ctl00_ContentPlaceBody_HiddenLabel"
dataPath = "text"
property = "parameters"
propertyKey = "ClientLogin"
direction = "In"
/>
</bindings>

The --> dataContext = "ctl00_ContentPlaceBody_HiddenLabel" <--

portion is hard coded as currently i don't know how to pass the generated control id to the XML Script.

Urgent help is HIGHLY appriciated. :)


Ok, I failed to understand "upgrade your hidden field to an Atlas Control"

so now code lOOks like this:

<

labelid="HiddenLabel"><%=CurrentClient.Login%></label>

<dataSource id = "dataSource"
serviceURL = "EventsWebService.asmx"
autoLoad = "true"
loadMethod = "GetGeneralEvents"
>
<bindings>
<binding dataContext = "HiddenLabel"
dataPath = "text"
property = "parameters"
propertyKey = "ClientLogin"
direction = "In"
/>
</bindings>
</dataSource>
.

.

.

<label id="HiddenLabel">
<bindings>
<binding property="text" dataPath="text" />
</bindings>
</label>

:( but still i have an error saying :

No data context available for binding with ID "" and dataPath "text" on object of type "Sys.UI.Label"


Hi,

ok, let's start with the last snippet you posted. The <binding /> inside the dataSource control has dataContext="HiddenLabel". This means that there must be an Atlas control with the id of "HiddenLabel". This control is declared below, but encapsulates a binding that isn't needed. Try to remove it:

<label id="HiddenLabel" />
Hi,

Sentimotive:


I failed to understand "upgrade your hidden field to an Atlas Control"


when I say "upgrading something to an Atlas control", I mean associate to a portion of static HTML (one element or a whole set of elements) an Atlas control.

For example, if you declared a textbox like

<input type="text" id="myTextBox" />
you can upgrade it to an Atlas TextBox by adding a control in the xml-script section:

<textBox id="myTextBox" />

Now, myTextBox is also an Atlas control (before, it was only a DOM element), and the element is encapsulated inside the control.
Regarding the hidden field, there isn't a specific Atlas control that wraps it. What you could do in this case is upgrade the hidden field to a TextBox and use the text property to get the hidden field's value:

<input type="hidden" id="myHiddenField" />
<textBox id="myHiddenField" />

But the above code is a sort of hack, and the best approach would be to write a specific Atlas control that wraps the hidden field element.
Hi,

btw, coding a little Atlas control that wraps an hidden field element is not difficult:

Type.registerNamespace('AtlasUI.HiddenField');

AtlasUI.HiddenField = function(associatedElement) {
AtlasUI.HiddenField.initializeBase(this, [associatedElement]);

// get/set the value.
this.get_value = function() {
return this.element.value;
}
this.set_value = function(val) {
if(val != this.element.value) {
this.element.value = val;
}
}

// Allow declarative programming against this control.
this.getDescriptor = function() {
var td = AtlasUI.HiddenField.callBaseMethod(this, 'getDescriptor');

td.addProperty('value', String);

return td;
}
}
AtlasUI.HiddenField.registerClass('AtlasUI.HiddenField', Sys.UI.Control);
Sys.TypeDescriptor.addType('script', 'hiddenField', AtlasUI.HiddenField);

listView paging and sorting

Will paging and sorting features be added to the listView control or will that be left to each developer to implement?
Thanks,
KeeganThey will. I can't tell you when but they will.

Listview post ASP.Net Ajax beta1

Hi all, I've been using a listView in the July CTP, and have just recently upgraded to beta 1, and for some reason my ListView no longer works.

I have figured out that the namespace is now Sys.Preview.UI.Data, and consequently changed my xml script to be

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005"
xmlns:"JavaScript: Sys.UI,Sys,Sys.Preview.UI.Data,Sys.Preview.Data">

etc...

Is there something more I have to do, or am I missing something.

Also, what has happened to all the examples in the documentation around the ListView, I'm pretty sure I'd be able to figure out what I'm doing wrong if there was a simple example as there was in the previous documentation.

Cheers.

Did you ever find a solution? I'm having no luck converting my old code to Beta 2.
FYI, I got my code working,http://forums.asp.net/thread/1487186.aspx

No, I ended up deciding that it was better to render it in a repeater on the Server side. I'm still interensted in the problem though, and will have a look at your solution.

Cheers.

ListView Performance

Dear community:

I have started a new feedback item on the MSDN Product Feedback center about the poor performance of ListView databinding in ATLAS.

Please view the details here:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=176826

I encourage you to view the feedback and comment and share your experiences. I believe this to be a major problem with ListView and, indeed, the way databinding happens in ATLAS on the client side (due to the MarkupParser.parse() method being called for each data item).

If you do not experience these problems, then please comment on that feedback item and let Microsoft (and me!) know in case this might be a special-case problem only for some browsers/installations.

I appreciate your time in this matter and I hope this will make ATLAS and even better product!!

Hi,

I completely agree with you. ListView is too slow to load.
Displaying 50 records takes foreverSad.

I realized this problem when I started the development way back in April 2006. But continued using Atlas in the hope that performance will improve in the coming CTPs. Now the code is in production and the users have been complaining that Listview takes lot of resources (CPU: 100%) and lot of time to display.

I haven't tried using the AJAX RC because of the breaking changes involved. The other option for me is to use the Gridview server control.
Either way its rework for me.

Hoping that Microsoft Team will release a fix for the CTP version.

Regards,
Tim


I'm very new to the ListView, just a few experiments so far but I did notice (for my 10 records) that, strangely, athough I was using ListView to render a table (which will usually not display until fully loaded) the table would appear incrementally, the table headers, then with a couple of rows, then a couple more, finally the entire 10 rows.

I was taken aback that the data was not converted to a "rendering object" (ie an entire table) THEN rendered to screen, it seemed to do a bit, render, do a bit more, render etc etc.

Usually I've found Databinding to always be faster than manually looping through records and adding the results to a list. In THIS case, I suspect the opposite would be true, the only thing the databinding is giving you is the ability to define Template objects and databind in one line of code without iterating.


hello.

though i haven't looked at it for some time, i think that the erndering is done from x to x rows which are then inserted on the screen...


Would be consistent with my observations, but seems like a strange way to do it. For example, if you were rendering a 3D game image, you wouldn't render X polygons, swap the display buffers, then take the previous rendering, add a X more polys, swap the buffers agaim, until finally you had an entire frame image, it would be unthinkably slow. So why do it here? Seems like a hack to get around slow code? If that's the case I would think that a fix will be hard because it means that the way it's done is fundamentally slow, and has already been "optimised" with this "do a bit, render, do a bit more, render" algorith.


hello.

well, they'er still in the future bits. btw, i think that the way to go is to use pagination and render them all at once (maybe changing the ui so that it is only shown when data is present - while it isn't, i think that showing an animated gif is more than enough).


On further analysis, I found that the listview performs much better on Mozilla FireFox than on IE 6.
So, I guess, the problem could be with IE's javascript engine rather than with the ListView itself.

Regards,
Tim

ListView rendering problem(Bug?)

Hi forum,

i got a problem when binding a listview against the Nortwind customers table (any table with 10 + cols). The rendering is very slow, slower than using an update panel to refresh the whole gridview.

So, i post my code and hope there is something wrong on it. Sorry for the long post, but put the initial data there was the olny way to make sure any one can just download it to a Atlas App folder and run it.

I tried to follow the examples provided, so i think the code is good, just with more cols because all the databind samples are with just a few cols. I'd like to know the opinion of the Atlas team about binding to tabular data.

<%

@dotnet.itags.org.PageLanguage="C#" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

scriptrunat="server">

</

script>

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>AtlasListView</title><styletype="text/css">div.listViewTable {font-family:Verdana,sans-serif;font-size:.9em;position:relative;}div.tableHead,div.tableBody {white-space:nowrap;overflow:visible;width:100%;}div.tableHeadspan,div.tableBodyspan {width:80px;padding:.2em;display:inline-block;border:1pxsolid#6495ED;border-top-width:0;border-bottom-width:0;}div.tableHead {background-color:#87CEFA;font-weight:bold;}div.listItemCssClass {background-color:#FFFACD;white-space:nowrap;overflow:visible;width:100%;}div.alternatingListItemCssClass {background-color:#FFFFF0;white-space:nowrap;overflow:visible;width:100%;}div.listItemCssClassspan,div.alternatingListItemCssClassspan {white-space:normal;}</style>

</

head>

<

body><formid="form1"runat="server"><atlas:ScriptManagerID="scriptManager"runat="server"></atlas:ScriptManager><h2>Customers list</h2><divid="listViewDiv"class="listViewTable"><divid="tableHeadDiv"class="tableHead"><span><aid="CustomerIDLk"href="javascript:;">CustomerID</a></span><span><aid="CompanyNameLk"href="javascript:;">CompanyName</a></span><span><aid="ContactNameLk"href="javascript:;">ContactName</a></span><span><aid="ContactTitleLk"href="javascript:;">ContactTitle</a></span><span><aid="AddressLk"href="javascript:;">Address</a></span><span><aid="CityLk"href="javascript:;">City</a></span><span><aid="RegionLk"href="javascript:;">Region</a></span><span><aid="PostalCodeLk"href="javascript:;">PostalCode</a></span><span><aid="CountryLk"href="javascript:;">Country</a></span><span><aid="PhoneLk"href="javascript:;">Phone</a></span><span><aid="FaxLk"href="javascript:;">Fax</a></span></div><divid="ListView1"class="tableBody"></div><divstyle="display: none;"><divid="ListView1_layoutTemplate"class="tableBody"><divid="ListView1_itemTemplate"><spanid="CustomerID"></span><spanid="CompanyName"></span><spanid="ContactName"></span><spanid="ContactTitle"></span><spanid="Address"></span><spanid="City"></span><spanid="Region"></span><spanid="PostalCode"></span><spanid="Country"></span><spanid="Phone"></span><spanid="Fax"></span></div></div><divid="ListView1_emptyTemplate">

No Customers records found.

</div></div></div><divid="pageNavigator"><inputtype="button"id="firstPageButton"value="<<"/><inputtype="button"id="previousPageButton"value="<"/><spanid="pageIndexLabel"></span>

/

<spanid="pageCountLabel"></span><inputtype="button"id="nextPageButton"value=">"/><inputtype="button"id="lastPageButton"value=">>"/></div></form><scripttype="text/xml-script">

<page xmlns:script=

"http://schemas.microsoft.com/xml-script/2005">

<components>

<dataSource id=

"customersDataSource" autoLoad="true">

<initialData>

<![CDATA[

new Sys.Data.DataTable(

[

new Sys.Data.DataColumn("CustomerID",String,null,false,true),new Sys.Data.DataColumn("OriginalCustomerID",String,null,false,false),new Sys.Data.DataColumn("CompanyName",String,null,false,false),new Sys.Data.DataColumn("ContactName",String,null,false,false),new Sys.Data.DataColumn("ContactTitle",String,null,false,false),new Sys.Data.DataColumn("Address",String,null,false,false),new Sys.Data.DataColumn("City",String,null,false,false),new Sys.Data.DataColumn("Region",String,null,false,false),new Sys.Data.DataColumn("PostalCode",String,null,false,false),new Sys.Data.DataColumn("Country",String,null,false,false),new Sys.Data.DataColumn("Phone",String,null,false,false),new Sys.Data.DataColumn("Fax",String,null,false,false)

],

[

{

"CustomerID":"ALFKI","OriginalCustomerID":"ALFKI","CompanyName":"Alfreds Futterkiste","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":{},"PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"},

{

"CustomerID":"ANATR","OriginalCustomerID":"ANATR","CompanyName":"Ana Trujillo Emparedados y helados","ContactName":"Ana Trujillo","ContactTitle":"Owner","Address":"Avda. de la Constitución 2222","City":"México D.F.","Region":{},"PostalCode":"05021","Country":"Mexico","Phone":"(5) 555-4729","Fax":"(5) 555-3745"},

{

"CustomerID":"ANTON","OriginalCustomerID":"ANTON","CompanyName":"Antonio Moreno Taquería","ContactName":"Antonio Moreno","ContactTitle":"Owner","Address":"Mataderos 2312","City":"México D.F.","Region":{},"PostalCode":"05023","Country":"Mexico","Phone":"(5) 555-3932","Fax":{}},

{

"CustomerID":"AROUT","OriginalCustomerID":"AROUT","CompanyName":"Around the Horn","ContactName":"Thomas Hardy","ContactTitle":"Sales Representative","Address":"120 Hanover Sq.","City":"London","Region":{},"PostalCode":"WA1 1DP","Country":"UK","Phone":"(171) 555-7788","Fax":"(171) 555-6750"},

{

"CustomerID":"BERGS","OriginalCustomerID":"BERGS","CompanyName":"Berglunds snabbk?p","ContactName":"Christina Berglund","ContactTitle":"Order Administrator","Address":"Berguvsv?gen 8","City":"Lule?","Region":{},"PostalCode":"S-958 22","Country":"Sweden","Phone":"0921-12 34 65","Fax":"0921-12 34 67"},

{

"CustomerID":"BLAUS","OriginalCustomerID":"BLAUS","CompanyName":"Blauer See Delikatessen","ContactName":"Hanna Moos","ContactTitle":"Sales Representative","Address":"Forsterstr. 57","City":"Mannheim","Region":{},"PostalCode":"68306","Country":"Germany","Phone":"0621-08460","Fax":"0621-08924"},

{

"CustomerID":"BLONP","OriginalCustomerID":"BLONP","CompanyName":"Blondesddsl père et fils","ContactName":"Frédérique Citeaux","ContactTitle":"Marketing Manager","Address":"24, place Kléber","City":"Strasbourg","Region":{},"PostalCode":"67000","Country":"France","Phone":"88.60.15.31","Fax":"88.60.15.32"},

{

"CustomerID":"BOLID","OriginalCustomerID":"BOLID","CompanyName":"Bólido Comidas preparadas","ContactName":"Martín Sommer","ContactTitle":"Owner","Address":"C/ Araquil, 67","City":"Madrid","Region":{},"PostalCode":"28023","Country":"Spain","Phone":"(91) 555 22 82","Fax":"(91) 555 91 99"},

{

"CustomerID":"BONAP","OriginalCustomerID":"BONAP","CompanyName":"Bon app\'","ContactName":"Laurence Lebihan","ContactTitle":"Owner","Address":"12, rue des Bouchers","City":"Marseille","Region":{},"PostalCode":"13008","Country":"France","Phone":"91.24.45.40","Fax":"91.24.45.41"},

{

"CustomerID":"BOTTM","OriginalCustomerID":"BOTTM","CompanyName":"Bottom-Dollar Markets","ContactName":"Elizabeth Lincoln","ContactTitle":"Accounting Manager","Address":"23 Tsawassen Blvd.","City":"Tsawassen","Region":"BC","PostalCode":"T2F 8M4","Country":"Canada","Phone":"(604) 555-4729","Fax":"(604) 555-3745"},

{

"CustomerID":"BSBEV","OriginalCustomerID":"BSBEV","CompanyName":"B\'s Beverages","ContactName":"Victoria Ashworth","ContactTitle":"Sales Representative","Address":"Fauntleroy Circus","City":"London","Region":{},"PostalCode":"EC2 5NT","Country":"UK","Phone":"(171) 555-1212","Fax":{}},

{

"CustomerID":"CACTU","OriginalCustomerID":"CACTU","CompanyName":"Cactus Comidas para llevar","ContactName":"Patricio Simpson","ContactTitle":"Sales Agent","Address":"Cerrito 333","City":"Buenos Aires","Region":{},"PostalCode":"1010","Country":"Argentina","Phone":"(1) 135-5555","Fax":"(1) 135-4892"},

{

"CustomerID":"CENTC","OriginalCustomerID":"CENTC","CompanyName":"Centro comercial Moctezuma","ContactName":"Francisco Chang","ContactTitle":"Marketing Manager","Address":"Sierras de Granada 9993","City":"México D.F.","Region":{},"PostalCode":"05022","Country":"Mexico","Phone":"(5) 555-3392","Fax":"(5) 555-7293"},

{

"CustomerID":"CHOPS","OriginalCustomerID":"CHOPS","CompanyName":"Chop-suey Chinese","ContactName":"Yang Wang","ContactTitle":"Owner","Address":"Hauptstr. 29","City":"Bern","Region":{},"PostalCode":"3012","Country":"Switzerland","Phone":"0452-076545","Fax":{}},

{

"CustomerID":"COMMI","OriginalCustomerID":"COMMI","CompanyName":"Comércio Mineiro","ContactName":"Pedro Afonso","ContactTitle":"Sales Associate","Address":"Av. dos Lusíadas, 23","City":"Sao Paulo","Region":"SP","PostalCode":"05432-043","Country":"Brazil","Phone":"(11) 555-7647","Fax":{}},

{

"CustomerID":"CONSH","OriginalCustomerID":"CONSH","CompanyName":"Consolidated Holdings","ContactName":"Elizabeth Brown","ContactTitle":"Sales Representative","Address":"Berkeley Gardens 12 Brewery","City":"London","Region":{},"PostalCode":"WX1 6LT","Country":"UK","Phone":"(171) 555-2282","Fax":"(171) 555-9199"},

{

"CustomerID":"DRACD","OriginalCustomerID":"DRACD","CompanyName":"Drachenblut Delikatessen","ContactName":"Sven Ottlieb","ContactTitle":"Order Administrator","Address":"Walserweg 21","City":"Aachen","Region":{},"PostalCode":"52066","Country":"Germany","Phone":"0241-039123","Fax":"0241-059428"},

{

"CustomerID":"DUMON","OriginalCustomerID":"DUMON","CompanyName":"Du monde entier","ContactName":"Janine Labrune","ContactTitle":"Owner","Address":"67, rue des Cinquante Otages","City":"Nantes","Region":{},"PostalCode":"44000","Country":"France","Phone":"40.67.88.88","Fax":"40.67.89.89"},

{

"CustomerID":"EASTC","OriginalCustomerID":"EASTC","CompanyName":"Eastern Connection","ContactName":"Ann Devon","ContactTitle":"Sales Agent","Address":"35 King George","City":"London","Region":{},"PostalCode":"WX3 6FW","Country":"UK","Phone":"(171) 555-0297","Fax":"(171) 555-3373"},

{

"CustomerID":"ERNSH","OriginalCustomerID":"ERNSH","CompanyName":"Ernst Handel","ContactName":"Roland Mendel","ContactTitle":"Sales Manager","Address":"Kirchgasse 6","City":"Graz","Region":{},"PostalCode":"8010","Country":"Austria","Phone":"7675-3425","Fax":"7675-3426"},

{

"CustomerID":"FAMIA","OriginalCustomerID":"FAMIA","CompanyName":"Familia Arquibaldo","ContactName":"Aria Cruz","ContactTitle":"Marketing Assistant","Address":"Rua Orós, 92","City":"Sao Paulo","Region":"SP","PostalCode":"05442-030","Country":"Brazil","Phone":"(11) 555-9857","Fax":{}},

{

"CustomerID":"FISSA","OriginalCustomerID":"FISSA","CompanyName":"FISSA Fabrica Inter. Salchichas S.A.","ContactName":"Diego Roel","ContactTitle":"Accounting Manager","Address":"C/ Moralzarzal, 86","City":"Madrid","Region":{},"PostalCode":"28034","Country":"Spain","Phone":"(91) 555 94 44","Fax":"(91) 555 55 93"},

{

"CustomerID":"FOLIG","OriginalCustomerID":"FOLIG","CompanyName":"Folies gourmandes","ContactName":"Martine Rancé","ContactTitle":"Assistant Sales Agent","Address":"184, chaussée de Tournai","City":"Lille","Region":{},"PostalCode":"59000","Country":"France","Phone":"20.16.10.16","Fax":"20.16.10.17"},

{

"CustomerID":"FOLKO","OriginalCustomerID":"FOLKO","CompanyName":"Folk och f? HB","ContactName":"Maria Larsson","ContactTitle":"Owner","Address":"?kergatan 24","City":"Br?cke","Region":{},"PostalCode":"S-844 67","Country":"Sweden","Phone":"0695-34 67 21","Fax":{}},

{

"CustomerID":"FRANK","OriginalCustomerID":"FRANK","CompanyName":"Frankenversand","ContactName":"Peter Franken","ContactTitle":"Marketing Manager","Address":"Berliner Platz 43","City":"München","Region":{},"PostalCode":"80805","Country":"Germany","Phone":"089-0877310","Fax":"089-0877451"},

{

"CustomerID":"FRANR","OriginalCustomerID":"FRANR","CompanyName":"France restauration","ContactName":"Carine Schmitt","ContactTitle":"Marketing Manager","Address":"54, rue Royale","City":"Nantes","Region":{},"PostalCode":"44000","Country":"France","Phone":"40.32.21.21","Fax":"40.32.21.20"}

]

)

]]>

</initialData>

</dataSource>

<listView id=

"ListView1" itemCssClass="listItemCssClass"

itemTemplateParentElementId=

"ListView1_layoutTemplate"

alternatingItemCssClass=

"alternatingListItemCssClass">

<bindings>

<binding dataContext=

"view" dataPath="filteredData"

property=

"data"/>

</bindings>

<layoutTemplate>

<template layoutElement=

"ListView1_layoutTemplate"/>

</layoutTemplate>

<itemTemplate>

<template layoutElement=

"ListView1_itemTemplate">

<label id=

"CustomerID">

<bindings>

<binding dataPath=

"CustomerID" property="text"/>

</bindings>

</label>

<label id=

"CompanyName">

<bindings>

<binding dataPath=

"CompanyName" property="text"/>

</bindings>

</label>

<label id=

"ContactName">

<bindings>

<binding dataPath=

"ContactName" property="text"/>

</bindings>

</label>

<label id=

"ContactTitle">

<bindings>

<binding dataPath=

"ContactTitle" property="text"/>

</bindings>

</label>

<label id=

"Address">

<bindings>

<binding dataPath=

"Address" property="text"/>

</bindings>

</label>

<label id=

"Region">

<bindings>

<binding dataPath=

"Region" property="text"/>

</bindings>

</label>

<label id=

"PostalCode">

<bindings>

<binding dataPath=

"PostalCode" property="text"/>

</bindings>

</label>

<label id=

"Country">

<bindings>

<binding dataPath=

"Country" property="text"/>

</bindings>

</label>

<label id=

"Phone">

<bindings>

<binding dataPath=

"Phone" property="text"/>

</bindings>

</label>

<label id=

"Fax">

<bindings>

<binding dataPath=

"Fax" property="text"/>

</bindings>

</label>

</template>

</itemTemplate>

<emptyTemplate>

<template layoutElement=

"ListView1_emptyTemplate" />

</emptyTemplate>

</listView>

<dataView id=

"view" pageSize="10">

<bindings>

<binding dataContext=

"customersDataSource"

dataPath=

"data" property="data" />

</bindings>

</dataView>

<dataNavigator id=

"pageNavigator" dataView="view"/>

<button id=

"previousPageButton" parent="pageNavigator" command="previousPage">

<bindings>

<binding property=

"enabled" dataPath="hasPreviousPage"/>

</bindings>

</button>

<label id=

"pageIndexLabel" parent="pageNavigator">

<bindings>

<binding property=

"text" dataPath="pageIndex" transform="Add"/>

</bindings>

</label>

<label id=

"pageCountLabel" parent="pageNavigator">

<bindings>

<binding property=

"text" dataPath="pageCount"/>

</bindings>

</label>

<button id=

"nextPageButton" parent="pageNavigator" command="nextPAGE">

<bindings>

<binding property=

"enabled" dataPath="hasNextPage"/>

</bindings>

</button>

<button id=

"firstPageButton" parent="pageNavigator" command="FIRSTPage">

</button>

<button id=

"lastPageButton" parent="pageNavigator" command="lastpage">

</button>

</components>

</page>

</script>

</

body>

</

html>

hello.

well, i wouldn't say that it's a lot slower...i'd say that with listview you're seeing it being rendered as it's being generated (though in my machine it looks like it's rendering 4 rows at a time). when you use the panel, everything is replaced at once and i think that is why you don't seen it being rendered...


Hi Luis,

in a normal sample you would have to add the time to retrieve the data.

Here render 5 rows at a time by design, but just to render 5 rows take longer than the update panel to connect to the server and render the 10 rows. you call that not slow.

i think the problem it′s with the templates, if you override the render method of the listview control and build table dinamically, it works like a champ.

what make me suspicious is the lack of any information regarding tabular data and tables in the Atlas docs, also there is not substitute for the gridview control what is the most important ASP.NET databound control.

Please, can some one in the Atlas team explain the plans about this matter


hello again.

hum...interesting...the only thing i'm seeing here is that it renders 4 rows at a time, but those 4 rows are rendered as a block (ie, they all appear at the same time). that's why i said it wasn't slow...

ListView SelectedItem problem

I have a ListView object bound to a client-side DataTable. As I add a row to the table, I want the associated ListView item to become the selected item, as displayed using a different CSS.

I set up the listView with the selectedItemCssClass property, and as each item is clicked, it works fine. However, if I add a row to the table, the ListView re-binds correctly, but all items now appear as unselected.

This is all client-side behavior - no UpdatePanels or PageMethod calls.

1 - How do I force the record I added to become the selected item i the ListView?

2 - If I didn't want to do that, how do I ensure that the selected item remains selected when an item is added?

Much Thanks.

Although this might not work in the latest release, you should be able to set the selectedIndex or selectedItem in Javascript.

Yeah... obviously, since the Datatable went Preview some time ago. Closing this post.

ListView vs. UpdatePanel with GridView

I am curious - which is the 'better' approach?

It appears with the listview and itemview you can accomplish much of what the gridview does.

Is there a performance difference?

On a side note - I hope to get some designer support for the listview/itemview/navigation/sorting - something similiar to the listview where you can create item templates - specify data columns from the datasource, etc...

hello.

i guess you'll just have to measure it :) i guess that using a gridview will be easier but you should take into account that when the contents of a panel are refreshed, everything is sent back to the server (this might be the sabe thing as doing a complete postback!)...

ListView, dataContext, and Actions

I'm working with the (client-side) Atlas ListView control, and seeing some behavior I didn't expect. The code is binding the ListView to an XmlDataSource, with item templates that use XPathBindings to populate hyperlinks, labels, etc. The basic stuff works - for example, there's an anchor in the markup with a corresponding Hyperlink component in the XML Script, and using the XpathBinding to populate the Hyperlink text works great.

However, the other thing I'm trying to do is to wire up the click event to a SetPropertyAction, and set properties on the SetPropertyAction using XPathBinding to the same listview data item that the Hyperlink is bound to. That doesn't seem to be working. My general impression is that the dataContext for a component is supposed to be inherited from its parent if it isn't set explicitly on that component. I assumed that would carry over to the action, so the context for bindings on the action would be the ListView item. That doesn't seem to be the case.

Looking at the Atlas code, it seems that an Action always returns itself as its data context. Is there a reason for that? Is there some other way of accomplishing what I'm trying to do?

Kevin

OK, I found a blog post that explains why the dataContext on the Action is set to the action itself, and how to address that. Unfortunately, I'm now running in the problem that I reported before about bindings on Actions. Since Actions always evaluate both the In and Out directions of bindings, they are incompatible with XPathBindings (which throw an error in the evaluateOut call). I think there's a bit of a design problem in this part of Atlas.