0

I have a List with Webservice URL,username and password. I have created a custom tab and ribbon tab. The webservice URL return a large xml file as output. Now when the list item with the URL is selected and ribbon button is clicked i want to process the XML file and save the data in another list.

Should i write it in Javascript using the Button commandUIhandler or is it possible to write as a c# code ?.

could someone help me.

Thank you.

Sebastian 506563
  • 6,980
  • 3
  • 31
  • 56
user1514428
  • 195
  • 1
  • 7

1 Answers1

0

You have two ways:

  1. Simplest: with javascript
  2. Hardest: Create custom .aspx page with webparts and then create your custom ribbon with custom select event.

Best way is to use Javascript because you are using GUI operations, and there is not such property in C# for list item with ListIten.IsSelected.

Edit: I found something than can help you

Get selected items from SharePoint 2010 list

SP.ListOperation.Selection.getSelectedItems() Method

SharePoint 2010 Get ID of Selected List Item using C#

and ofcourse little google effort would help:

Google search result

for xml parsing i recommend to use jquery with jQuery.parseXML()

Sebastian 506563
  • 6,980
  • 3
  • 31
  • 56
  • The problem is not selecting list item but how do i connect to the webservice and process the output xml file and store it in another list. I dont know how easy to process the xml file with javascript. – user1514428 Nov 25 '14 at 10:54
  • "Now when the list item with the URL is selected and ribbon button is clicked" for both this actions you need to do what i said. Second step is to process the xml. "webservice URL" So you call the webservice in browser and you want to do something with that xml that shows in browser? Or you want to call some method from service? What that xml is exacly? – Sebastian 506563 Nov 25 '14 at 10:57
  • The webservice URL i call them in Browser and the output xml will be like this 10000 TEST KH 01 Hospital Orbisstr. 5 - 7 77777 Newyork D 1 I have the same field in a list where i want to save each xml element to list field. – user1514428 Nov 25 '14 at 12:19