Microsoft KB Archive/197568

= PRB: bindNewElements of DhTable Changes to "" in Cell =

Article ID: 197568

Article Last Modified on 8/25/2005

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition
 * Microsoft Software Development Kit for Java 3.1

-



This article was previously published under Q197568



SYMPTOMS
The non-breaking spaces in a table's cells are removed from the cells after binding to the table.



CAUSE
When a DhTable object is bound through a call to setBoundElements, all non-breaking spaces are converted to empty strings "".



RESOLUTION
To workaround this issue, you can bind to the DhTable using findElement instead of using setBoundElements. For example, if you had a DhTable named "table" you could do the following:   table = (DhTable)findElement("table");



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a default Code-Behind HTML project in Visual J++ 6.0 as follows:  From the File menu, click New Project. Click the New tab in the New Project dialog box. Click Web Pages from Visual J++ Projects. Click Code-Behind HTML.</li> Click Open to create the project.</li></ol> </li>  Modify Class1.java as follows: import com.ms.wfc.html.*; import com.ms.wfc.core.*; import com.ms.wfc.ui.*; public class Class1 extends DhDocument {  public Class1 {     initForm; }  private void initForm {  }   protected void onDocumentLoad(Object sender, Event e)   { DhTable t;     t = new DhTable; t.setBindID("table"); this.setBoundElements(new DhElement[] { t }); // Workaround: comment out the above 3 lines and uncomment the // following: //   t = (DhTable)findElement("table"); //   t.setBackColor(Color.RED); DhCell cell=(DhCell)findElement("cell"); addText("Contents of DhCell is '"+cell.getText+"'"); } }                   </li>  Modify page1.html as follows: <HTML> <BODY> <OBJECT classid="java:com.ms.wfc.html.DhModule" height=0 width=0 ... VIEWASTEXT> <PARAM NAME=__CODECLASS VALUE=Class1> <PARAM NAME=CABBASE VALUE=Project1.CAB> </OBJECT>

</BODY> </HTML> </li> Run the project.</li></ol>

RESULT: The Web page contains a table with one cell containing a "*". The text "Contents of DhCell is '*'". Notice there is no space before the asterisk.

<div class="references_section">