Atlas ItemViewhttp://forums.asp.net/t/926196.aspx/1?Atlas+ItemViewTue, 11 Oct 2005 15:47:45 -04009261961075806http://forums.asp.net/p/926196/1075806.aspx/1?Atlas+ItemViewAtlas ItemView Hi, I'm trying to work from one of the demo's and expand the functionality of an itemview to include a response that's saved to the data element that the item view represents.<br> <br> what I have is an ItemView that's bound to a data object (via a webservice.asmx) that displays perfectly. I can display an element in a textbox via something like this:<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:TextBox runat=&quot;server&quot; ID=&quot;Answer&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Bindings&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:Binding DataPath=&quot;visible&quot; Property=&quot;visible&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:Binding DataPath=&quot;answer&quot; Property=&quot;text&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Bindings&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/atlas:TextBox&gt;<br> <br> ....<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:Button runat=&quot;server&quot; ID=&quot;nextButton&quot; Text=&quot;&gt;&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Bindings&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:Binding DataContext=&quot;itemView1&quot; DataPath=&quot;canMoveNext&quot; Property=&quot;enabled&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Bindings&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Click&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Actions&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:InvokeMethodAction Target=&quot;itemView1&quot; Method=&quot;moveNext&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Actions&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Click&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/atlas:Button&gt;<br> <br> <br> What I'd like to be able to do is change the &quot;next button&quot; to post what's IN that text box back to the data element at the webservice. So can I do that? Do I have to modify my webservice to put that data-object in a session element? (Which is fine) And what changes do I need to make to the button method to call what methods at the webservice?<br> <br> I thought it might be something like<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:InvokeMethodAction Target=&quot;itemView1&quot; Method=&quot;Update&quot; /&gt;<br> <br> but probably not.<br> <br> I'd love to have a look and see what methods are supported by these objects (say an itemView control, or even a simple button, or textbox etc.) but I don't see anything in the documentation, any suggestions? (I'll be happy to send any of you my e-mail if you'd like to continue a discussion)<br> <br> <br> Thank you<br> <br> Doug<br> <br> 2005-10-07T16:08:10-04:001075889http://forums.asp.net/p/926196/1075889.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView If I got it, you want to update datasource, not datalist. Datasources have update method, but you must declare it same way as select method you probably have.<br> Adam 2005-10-07T17:48:10-04:001075949http://forums.asp.net/p/926196/1075949.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView You're right, I Do want to udate the datasource, not the list (although I'd love for the view to change as well)<br> <br> So in what way can I declare it? There's already an update function on the asmx... I'd like to tie that into the itemview control via that update function...<br> <br> <br> <br> 2005-10-07T18:36:59-04:001075998http://forums.asp.net/p/926196/1075998.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView King.Fisher is right. Be sure that you invoke the method &quot;update&quot; (lower case) though, and not &quot;Update&quot;.<br> 2005-10-07T19:38:00-04:001076130http://forums.asp.net/p/926196/1076130.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView Thanks for the suggestions, but I still am beating my head against the wall (fortunately padded cubicle walls don't hurt)<br> <br> <br> I have the datasource set up as so:<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:DataSource runat=&quot;server&quot; ID=&quot;dataSource1&quot; ServiceUrl=&quot;questiondata.asmx&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DataAvailable Handler=&quot;traceDataAvailable&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/atlas:DataSource&gt;<br> &nbsp;<br> The datasource has an update function:<br> <br> &nbsp;&nbsp;&nbsp; &lt;DataObjectMethod(DataObjectMethodType.Update)&gt; _<br> &nbsp;&nbsp;&nbsp; Public Sub UpdateRow(ByVal updateRow As Question2)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim row As Question2<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each row In _data<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If row.Id = UpdateRow.Id Then<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row.Name = UpdateRow.Name<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row.Question= UpdateRow.Question<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next row<br> &nbsp;&nbsp;&nbsp; End Sub<br> <br> but this update function takes an object as a parameter, so how do I call it from the button? I have the button set up like so:<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:Button runat=&quot;server&quot; ID=&quot;update&quot; Text=&quot;update&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Click&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Actions&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atlas:invokeMethodAction Target=&quot;dataSource1&quot; method=&quot;update&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Actions&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Click&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/atlas:Button&gt;<br> <br> Now, the part where the item view comes in is that the itemView is the template for displaying the &quot;Question2&quot; data structure (an array of which is returned from the select method in the datasource)<br> I can put break points in the webservice method, and they never get there.<br> <br> 2005-10-07T22:38:30-04:001076302http://forums.asp.net/p/926196/1076302.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView <p><font face="Arial" size="2">Heh,near same problem here. I found how to for parametrized call in tasks example at Shanku's blog - </font><a href="http://weblogs.asp.net/shankun/archive/2005/09/21/425750.aspx"><font face="Arial" size="2">http://weblogs.asp.net/shankun/archive/2005/09/21/425750.aspx</font></a><font face="Arial" size="2">, its nead end of page in javascript. I hope there is a simpler way, but I tried </font></p> <p><font face="Arial" size="2"><font color="#a52a2a">&lt;dataSource id=&quot;xmlCommentDataSource&quot; serviceURL=&quot;comments.asmx&quot; selectMethodName=&quot;GetComments('1')&quot;/&gt;</font> <br> <br> for parametrized select, and this doesn't work. It will be fine to have some example how to make parametrized call to dataservice and how to pass value from itemlist control binding (if it can be done without javascript callback). My wall hurts, please help [:D]</font></p> 2005-10-08T07:23:14-04:001076333http://forums.asp.net/p/926196/1076333.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView qfx: I haven't personally tried to actually do updates with data sources, but as far as I know, your update method should accept the same thing as what your select method returns. I believe the data source either sends back the all the data, including new rows and updated rows, or it sends back a diff (ie. updated and new rows only). Anyway, you should definitely not have to pass anything to the update method that you invoke using the invokeMethodAction. When you invoke that method, the client-side data source will take care of actually invoking YOUR service's update method with the correct argument.<br> <br> 2005-10-08T09:27:26-04:001076334http://forums.asp.net/p/926196/1076334.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView King.Fisher: An easy way to pass arguments is to bind them. See also my <a href="http://www.wilcob.com/Wilco/Default/158/showpost.aspx#8"> post of a demo</a> which explains and demonstrates this.<br> <br> 2005-10-08T09:29:44-04:001079439http://forums.asp.net/p/926196/1079439.aspx/1?Re+Atlas+ItemViewRe: Atlas ItemView Thanks Wilco. It don't work, so either it's unimplemented, or I'm doing something wrong. Thanks for your examples, After seeing yours, I'm thinking of doing a little map demo!<br> 2005-10-11T15:47:45-04:00