Because infopath web browsing does not provide multiple options, the solution is:
Implement with repeating table
Read the data to be displayed from a data connection and display it in the form of a duplicate table.
Routine:
If (! This. New) return;
Xpathnavigator root = maindatasource. createnavigator ();
Datasource mydatasource = This. datasources ["ds1"];
Xpathnavigator T1 = mydatasource. createnavigator ();
Xpathnodeiterator T2S = t1.select ("DFS: myfields/DFS: datafields/D: ds1", namespacemanager );
Xpathnavigator Options = root. selectsinglenode ("/My: myfields/My: Options", namespacemanager );
Xpathnavigator optionfirst = root. selectsinglenode ("/My: myfields/My: Options/My: Option", namespacemanager );
Xpathnavigator mytext;
Mytext = optionfirst. selectsinglenode ("My: Text", namespacemanager );
String C2;
While (T2S. movenext ())
{
Xpathnavigator myoption = optionfirst. Clone ();
Mytext = myoption. selectsinglenode ("My: Text", namespacemanager );
C2 = T2S. Current. getattribute ("C2 ","");
Mytext. setvalue (C2)
Options. appendchild (myoption );
}
Optionfirst. deleteself ();
Options is a duplicate table and contains two nodes: Selected and text. Selected is Boolean, and text is the text corresponding to multiple selection boxes.