Showing posts with label community. Show all posts
Showing posts with label community. Show all posts

Saturday, March 24, 2012

ATLAS to AJAX updating

Hey!

I have built a community site that uses a early version of ATLAS:

When you are looking at a post (like this onehttp://www.znize.se/com/community/communityReplys.aspx?threadId=13)there is buttons for quote on every post. When quote button is pushed aJavacript is used to collect data from the server like this:

onclick="getCommunityQuote(68)"
function getCommunityQuote(replyId)
{  
    dataService.getCommunityQuote(replyId, callBack_getQuote);
}
function callBack_getQuote(result)
{
   var replyTextBox = getObj("txtMainTextBox");
   addTextToTextBox(replyTextBox,result);
}
dataService is a WebService that collect the information regarding the post and sends it back.

I wanted to use the AJAXcontrol toolkit(http://www.codeplex.com/Wiki/View.aspx?ProjectName=AtlasControlToolkit)and to do this i needed to update the ATALS that are called AJAX.NET BETA 2today.

To update the site I followed this steps:

  1. Download AJAX.NET Beta 2 and Ajax control toolkit.
  2. Executed the AJAX.NET setup where I choose remove(remove the old version(ATLAS))
  3. Executed the AJAX.NET setup and choose install
  4. Unpacked and executed the Ajax control toolkit
  5. Removed the references in my project to the old AJAX(ATLAS)
  6. Followed the steps in the AJAX.NET migration doc(http://ajax.asp.net/files/Migration_Guide.doc) witch involved alot of web.config editing and moved the scriptmanager in my masterpage from <HEAD> to form(runat="server").
  7. Included the Ajax control toolkit dll as a reference, the AJAX.net references is not longer needed becource it's placed in the GAC.

I can find all the Ajax controls and i can render the AJAX control toolkit Rating control without problem.

BUT, there is some problems:

  1. web.config have a schema(original) to validate against and it simes like this doesn't support the AJAX.NET syntax? I get allot of information(not varnings or errors just information) (over 100) about this, ex name do not exist. When I look in the example web.config from AJAX.NET there is no schema stated? Should I remove it?
  2. There was stated in the migration doc that the content of a searten tag should be moved to another. The content in my project was 3 dataconverters. After moving this dataconverters they are not working any more (cant compile)?? So I hade to removed them for now to be able to compile the site.
  3. My old Ajax implementation that I explained before isnot working anymore?
  4. When I upload the site to my web hotel the site will not open, instead a error shows? Does the web hotel have to install the AJAX.NET BETA 2?
  5. I have tryed the updatePanel but its dosent simes to work?

Maybe anyone here can help me?

1. Don't worry about the schema issues.

2. The Toolkit prefix used to be atlasToolkit and now it's ajaxToolkit.

3. Not sure what you mean.

4. The hosting web site needs ASP.NET AJAX Beta 2 installed.

5. The SampleWebSite includes numerous instances of UpdatePanels in action.

Wednesday, March 21, 2012

Atlas Safari compatibility layer considered harmful

Not wanting to rehash discussions in the wider community about the use of Object.prototype to extend the native JS objects (see: ), I have found the following inconsitency between the Firefox and Safari compatibility layers that I do not think is intended.

The _loadSafariCompatLayer() function appears to add 'getElementById', 'attachEvent' and 'deleteEvent' functions to every native Object of the window rather than just the HTMLElement prototype Object that it intends.

To replicate:

1. Go to http://atlas.asp.net/atlastoolkit/Accordion/Accordion.aspx in Safari and Firefox (or other Atlas using site)

2. In each enter to following in the address bar to create a new Object and then iterate through its properties:

javascript:var mytest = new Object();mytest.myprop = 'prop';for (var key in mytest){alert(key+' = '+typeof(mytest[key]))}

3. In Firefox there will be one alert with a value of 'myprop = prop'. In Safari there will be 4 alerts, including the extra function names (Tested in Safari 2.0.4 and Firefox 1.5.0.7)

I believe that this manipulation of Objects (in Safari only) is one of the reasons why developers have been having problems integrating custom code or other OS libraries (e.g. Prototype) with Atlas in Safari, and changing this will greatly simplify things.

This may be a Safari JS bug so this is cross-posted to the Surfin' Safari bug tracker here - http://bugs.webkit.org/

However I am aware that there design decisions in the compatibiility layers and I'd like to understand the reasons for adding these functions to every Object. (I'm not an ASP.NET developer, but rather supporting a commercial JS library which will probably be more commonly deployed along with Atlas/Prototype/etc.)

Liam,I have followed up on the bug you reported at <http://bugs.webkit.org/show_bug.cgi?id=11315>. My testing indicates that the issue you observed is most likely caused by the Safari "compatibility" layer in Atlas. When Safari is set to spoof as a Mozilla-based browser in its user-agent string the behaviour is as expected. Changing back to the default user-agent string causes the issue to reappear. I'm not sure where the appropriate place is to file bug reports on the Atlas JS toolkit, but I would appreciate it if you could do so. I would love to see this resolved so it doesn't negatively affect users of Safari.
We have completely redesigned the compat layer so this problem should disappear with the next release, which is imminent. Thanks for reporting this.