Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Others
cms.evaluation
cms.general
comm.businessdesk
comm.campaigns_csf
comm.catalog
comm.datawarehousing
comm.deploy.
comm.general
comm.sdk
comm.solutionsites
comm.userprofilemgt
commerce.analysis
crm
crm.deployment
crm.developer
hiserver.general
mobility.miserver
sharep.portal.config
sharep.portal.dev
sharep.portal.docmgmt.
sharep.portal.installation
sharep.portal.sdk
sharep.portal.search
sharep.team.caml
sharep.teamservices
sharep.windowsservices
sharep.winservices.dev
sharepoint.portalserver
siteserv.knowledgemgr
siteserver.analysis
siteserver.commerce
siteserver.css
siteserver.general
siteserver.publishing
siteserver.sdk
siteserver.search
site-server.site-mgmt
site-server.webpost
  
 
date: Mon, 7 Jul 2008 02:56:25 -0700 (PDT),    group: microsoft.public.sharepoint.windowsservices.development        back       


Sharepoint changes my value inside a SPListItem on its own!   
Dear sharepoint developers,

I am facing a weird issue when updating an item in a custom list.
One filed I have in a list is of type HTML; I have some CSS classes
associated with java script that read certain HTML tags and produce a
tool tip by a mouse over;
the structure of this HTML script is XML-wise as follows:
<snippet>
<a href="#" class="tt">
keyword<div class="ttcontainer">
<span class="tooltip">
<span class="bottom">
<span class="middle">definition</span>
<span class="top"></span>
</span>
</span>
</div>
</a>
</snippet>
My List Item; let's call it 'item' gets updated in a similar way as
follows:
<snippet>
item["field_name"] = "<a href=\"#\" class=\"tt\">keyword<div class=
\"ttcontainer\"><span class=\"tooltip\"><span class=\"bottom\"><span
class=\"middle\">definition</span><span class=\"top\"></span></span></
span></div></a>";
</snippet>
During debug time and before updating, I trace the value and it's as
expected, I confirm that the saved value inside the item["field_name"]
matches exactly the one above; however, after updating:
<snippet>
item.Update();
</snippet>
The value gets changed automatically from sharepoint; my HTML code
above misses two span closing tags and the surrounding double quotes
of the classes are missing as well as follows:
<snippet>
<a href="#" class=tt>
keyword<div class=ttcontainer>
<span class=tooltip>
<span class=bottom>
<span class=middle>definition</span>
<span class=top></span>
</div>
</a>
</snippet>
Concerning the surrounding double quotes, it's not that bad, I can
live without them! but the missing span closing tags! offfff ..., I
had some rough time figuring out how it happens and I had been
reviewing my code for weeks doubting my logic and finally it seemed
that sharepoint changes it from its own!

Any idea on how to fix this? Is this a bug? do I need to pay extra
attention when dealing with fields of HTML type?
I'm puzzled!

Regards
date: Mon, 7 Jul 2008 02:56:25 -0700 (PDT)   author:   coosa

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us