Why do InfoPath browser forms with managed code behave differently in IE and Firefox?

Alexey Krasheninnikov
  • Why do InfoPath browser forms with managed code behave differently in IE and Firefox? Alexey Krasheninnikov

    Symptoms:

    You develop a browser-compatible InfoPath form with managed code for business logic.

    You use ContactSelector ActiveX control to look up and resolve users from the SharePoint site Users lists (UserInfo table in the Content database).

    You then validate list of resolved users and copy some of them to another node in the primary data source. The field displays copied contacts as a concatenated string.

    Your logic works when tested in the rich InfoPath client.

    Resolved contacts are not copied when tested with Internet Explorer. IE does more postbacks than other browsers. In my case only third request contained the lookup token for contact resolution.

    Resolved contacts are copied multiple times in a single postback (even before you are prompted for resolution) when tested with Firefox and other level 2 browsers. When you begin resolving for the first time you are presented a picker window for the first empty node, which you have to delete. The first occurrence of a given contact is never resolved automatically, while the second and others usually are.

    FireFox

    8;_0_;aabc78a4-2c90-4eb4-b907-efdde6081724;9d08e01d-9d57-4e85-ad88-e7e177dc85e4:ver:1.0.0.69;0;;http%3A%2F%2Fspdev%2FFormServerTemplates%2FtrySZ.xsn;http%3A%2F%2Fspdev%2FFormServerTemplates%2FtrySZ.xsn;http%3A%2F%2Fspdev%2FInForms%2F;http%3A%2F%2Fspdev;http%3A%2F%2Fspdev%2FInForms%2FForms%2FAllItems.aspx;1;1;0;2;1;633988049367884000;;+age6upPf7USGkrCI/yi9kTSjvA6i5NVYPoOO9r4ST0zr2dYVKtUP1eB1ZbMDExztOK7lNa+8W8IF3Jt+yuSyQ==|633988049367728266 18;V1_I1_CP2;;T%252F%252F0%252F%252F%253B_sdja_%252F%252F0%252F%252F 
    
    [4,["\n     \n  sdja",["\n      \n  sdja","","",-1],[true,[["","",0,"",0,[]],["sdja","",0,"",1,[["John Doe","CONTOSO\\sdja",1,"John Doe",""]]]],false],false,false,false],-1,false,false],[5,["\n       sdja\n  ",["\n      sdja\n  ","","",-1],[false,[["sdja","",0,"",0,null]],false],false,false,false],-1,false,false],
    

    Internet Explorer

    8;_2_;0387bf44-e9a8-48eb-bf89-a31736034aee;9d08e01d-9d57-4e85-ad88-e7e177dc85e4:ver:1.0.0.69;0;;http%3A%2F%2Fspdev%2FFormServerTemplates%2FtrySZ.xsn;http%3A%2F%2Fspdev%2FFormServerTemplates%2FtrySZ.xsn;http%3A%2F%2Fspdev%2FInForms%2F;http%3A%2F%2Fspdev;http%3A%2F%2Fspdev%2FInForms%2FForms%2FAllItems.aspx;1;1;0;2;1;633988006159329000;;k1ayFO2PmR324jVtDEih3Z9aMGrEduuo5q/4JVt5AH0kw6Sd6ynEw5wmqck1Q+GkXniEM+OuLjXrDUC9rIAlQw==|633988006210373259 18;V1_I1_CP2;;T_sdja_%252F%252F0%252F%252F 
    
    [4,["\n     \n  sdja",["\n      \n  sdja","","",-1],[true,[["sdja","",0,"",0,[["John Doe","CONTOSO\\sdja",1,"John Doe",""]]]],true],false,false,false],-1,false,false],[5,["\n      \n  ",["\n      \n  ","","",-1],[false,[],true],false,false,false],-1,false,false],
    

    Contact Selector

    Information about the control can br found on the InfoPath team blog:

    Using the Contact Selector Control

    I can add that it is rendered in the browser (Firefox) as HTML table, div and span elements handling events with functions declared in Core.js for all ContactPicker controls.

    <TABLE><TBODY>
    <TR>
    <TD vAlign=top><BUTTON style="FONT-STYLE: normal; FONT-FAMILY: Segoe UI; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none" id=V1_I1_CP2_AddressButton onfocus="return (ContactPicker.OnButtonFocus(this, event));" title="Add contacts from address book" onclick="return (ContactPicker.OnShowAddressBookClick(this, event));"><NOBR><IMG style="VERTICAL-ALIGN: middle" alt="" src="http://spdev/_layouts/inc/contactPickerSelectNames.png?rev=azqd2BNDQfZJX%2Bi5rXdMhQ%3D%3D"> <SPAN style="VERTICAL-ALIGN: middle">Кому: </SPAN></NOBR></BUTTON></TD>
    <TD style="WIDTH: 100%"><SPAN onmouseover="return (LeafControl.OnMouseOver(this, event));" onmouseout="return (LeafControl.OnMouseOut(this, event));"><SPAN id=V1_I1_CP2_SignIcon></SPAN><SPAN id=V1_I1_CP2_ErrorTip></SPAN>
    <DIV onkeydown="return (ContactPicker.OnKeyDown(this, event));" id=V1_I1_CP2 class="h_ m_ " onfocus="return (ContactPicker.OnFocus(this, event));" onmouseover="return (ContactPicker.OnMouseOver(this, event));" onmouseout="return (ContactPicker.OnMouseOut(this, event));" onclick="return (ContactPicker.OnClick(this, event));" viewDataNode="3" scriptclass="ContactPicker" maxlines="4" name="V1_I1_CP2" alt>
    <DIV ondragover="return (ContactPicker.OnEditBoxDragOver(this, event));" oncontrolselect="return (ContactPicker.OnEditBoxControlSelect(this, event));" onblur="return (ContactPicker.OnEditBoxBlur(this, event));" hideFocus style="OVERFLOW-Y: auto; HEIGHT: 15px; WORD-BREAK: break-all" id=V1_I1_CP2_RecipientsList onactivate="return (ContactPicker.OnEditBoxActivate(this, event));" class=hideChildAnchors onfocus="return (ContactPicker.OnEditBoxFocus(this, event));" title="" ondrop="return (ContactPicker.OnEditBoxDrop(this, event));" tabIndex=0 contentEditable=true onmousedown="return (ContactPicker.OnEditBoxMouseDown(this, event));" maxHeight="60"><SPAN class=recipientResolvedUser tabIndex=-1 contentEditable=false ownerid="V1_I1_CP2" displayname="John Doe" objectid="CONTOSO\sdja" objecttype="1" realname="Djaarbekov Stanislav M." orgindex="0"><SPAN tabIndex=-1 contentEditable=true>Doe John Jr.</SPAN></SPAN>; <SPAN class=recipientResolvedUser tabIndex=-1 contentEditable=false ownerid="V1_I1_CP2" displayname="Mary Kay" objectid="LITWARE\mar" objecttype="1" realname="Mary Kay" orgindex="1"><SPAN tabIndex=-1 contentEditable=true>Mary C. Kay</SPAN></SPAN></DIV>
    <DIV style="DISPLAY: none" id=V1_I1_CP2_NCEContactPicker>
    <DIV style="OVERFLOW: auto" id=V1_I1_CP2_NCERecipientsList 4?em?></DIV><INPUT onblur="return (ContactPicker.OnEditBoxBlur(this, event));" style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 100%; BORDER-TOP: 0px; BORDER-RIGHT: 0px" id=V1_I1_CP2_EditBox onfocus="return (ContactPicker.OnEditBoxFocus(this, event));" title="" tabIndex=0></DIV></DIV></SPAN></TD>
    <TD vAlign=top><BUTTON id=V1_I1_CP2_ResolveButton onfocus="return (ContactPicker.OnButtonFocus(this, event));" title="Resolve names" onclick="return (ContactPicker.OnResolveAllClick(this, event));"><IMG style="VERTICAL-ALIGN: middle" alt="Resolve names" src="http://spdev/_layouts/inc/contactPickerCheckNames.png?rev=ReirwPoq%2Fu%2BOSZA9X276Gg%3D%3D"></BUTTON></TD></TR></TBODY></TABLE>
    

  • You use ContactSelector ActiveX control to look up and resolve users from the SharePoint site Users lists (UserInfo table in the Content database).

    Firefox does not officially support ActiveX

    Could have something to do with it I guess

Tags
infopath forms-services browser-compatibility
Related questions and answers
  • ;xsl:param name="Pos" /&gt; &lt;tr>; &lt;td>; &lt;table border="0" cellspacing="0" width="100%"&gt;&lt;tr>;&lt;td class="ms-formlabel" valign="top" nowrap="true...; &lt;xsl:param name="dvt_RowCount" /&gt; &lt;xsl:param name="RealLastRow" /&gt; &lt;table cellspacing="0" cellpadding="4" border="0" width="100%"&gt; &lt;tr>..." border="0" width="100%"&gt; &lt;tr>; &lt;td class="ms-vb"&gt; &lt;xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes"&gt;&amp;nbsp;&lt

  • " class="header"&gt; &lt;tr>; &lt;td>;&lt;img src="http://URLtomylogo.jpg" width="579" height="108" alt="Logo"/&gt; &lt;/td>; &lt;/tr>; &lt;/table>; &lt;/td>; &lt;/tr>; &lt;/table>; &lt;table width="579" border="0" cellspacing="0" cellpadding="0" class="bg"&gt; &lt;tr>...; } &lt;table width="579" border="0" cellspacing="0" cellpadding="0"&gt; &lt;tr>; &lt;td class="permission"&gt; &lt;p>You're

  • Hiding Left Nav user1155

    ="0" cellspacing="0" border="0"&gt; &lt;tr>; &lt;td>; &lt;table class="ms-navheader" width="100%" cellpadding="0" cellspacing="0...="LeftNavTableCell" runat="server"&gt; &lt;table cellpadding="0" cellspacing="0" id="LeftNav"&gt; &lt;tr>; &lt;td style="width:301px; text-align:left; vertical-align:top...%" cellpadding="0" cellspacing="0" border="0" class="s4-die"&gt; &lt;tbody> &lt;tr>;&lt;td>; &lt;table class="ms-recyclebin" width

  • ','')} } }); }); &lt;/script>&lt;div id="dialog" title="Question" style="display:none"&gt;&lt;span>;&lt;/span>;&lt;span>;What is the Capital of Massachusetts ?&lt;/span>;&lt;table id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02" border="0"&gt; &lt;tr>; &lt;td>;&lt;input id="ctl00_m_g_583145bb_3463_40cc_b5ef_6f42c371f376_ctl02_0...;Lawrence</label>&lt;/td>; &lt;/tr>; &lt;/table>;&lt;input type="submit" name="ctl00$m$g_583145bb_3463_40cc_b5ef_6f42c371f376$btnAnswer" value="Answer" id

  • as the current user. &lt;xsl:if test="@MyField = $UserID"&gt; ... code here ... &lt;/xsl:if> But the compare fails because the content from the MyField is something like : &lt;span>; &lt;A HREF="/sites/121579/MySite/_layouts/userdisp.aspx?ID=452"&gt;***, Stef</A> &lt;img border="0" height="1" width="3" src="/_layouts/images/blank.gif"/&gt; &lt;a href='javascript:' onclick='IMNImageOnClick();return false;' class='ms-imnlink'&gt; &lt;img name='imnmark' title='' border='0' height='12' width='12' src='/_layouts/images/blank.gif' alt

  • us that the authentication method might matter. UPDATE 2: Another piece of info I should have included in the first place: The reason that I'm asking this is that the $().SPServices.SPGetCurrentUser in SPServices sometimes returns the previous user. All I'm doing in that function is loading the _layouts/userdisp.aspx?Force=True page and pulling the Name from the page. It's the column...In some instances of WSS or MOSS when you use the "Sign in as Different User" option, the new login doesn't "take". Is there any known issue here? Usually logging out and then logging back

  • ;SharePointWebControls:AggregateDataSource runat="server" IsSynchronous="false" SeparateRoot="true" id="New_x0020_Data_x0020_Source1"&gt;&lt;sources>&lt;SharePointWebControls:spdatasource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;ID&quot;/&gt;&lt..." id="0" Type="SPList"/&gt;&lt;datasource name="Comments" id="1" Type="SPList"/&gt;&lt;/concat>&lt;/aggregate>&lt;/SharePointWebControls:AggregateDataSource>&lt;/DataSources> Parameter

  • I have a content type defined in Elements.xml and I want to add an Event Receiver. My Elements.xml looks like this: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements xmlns="http...="_Hidden" Type="Note" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" DisplayName="Body" Sortable="FALSE" NumLines="15" Customization="" /&gt; &lt;Field ID... version="1.0" encoding="utf-16"?&gt; &lt;ContentType ID="0x0104008A424DE98660457481EB7D8DDB5161EE" Name="News Posting" Group="News" Description="A News Posting" Sealed="TRUE" Version="1"&gt; &lt;Folder

  • security warning in browser (at the top of the page in IE) when browse a page -- "An add-on for this web site failed to run. Check the security settings in Internet Options for potential conflicts." The function I developed works fine besides the security warnings. I am using IE 8. Any ideas why there is security warnings and how to resolve? Here is the code I added to BlueBand.master to refer the js...? &lt;link type="text/css" href="_layouts/test/themes/base/ui.all.css" rel="stylesheet" /&gt; &lt;script type="text/javascript" src="_layouts/test/jquery-1.3.2.js"&gt;&lt;/script> &lt;script type

Data information