FIX: DhDocument.setTitle() Does Not Work From initForm()
ID: Q194767
|
The information in this article applies to:
-
Microsoft Visual J++, version 6.0
SYMPTOMS
When you try to set the title of DhDocument from initForm(), the new
title is not displayed in the title bar of the browser.
RESOLUTION
Do one of the following to work around this issue:
- Do not call setTile() in initForm(). Call it only after the document has been loaded.
- Call setTile(getTitle()) in the onDocumentLoad() method.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
MORE INFORMATION
Steps to Reproduce Behavior
- In Visual J++, select New Project from the File menu.
- In the New Project dialog box, click the New tab.
- In the Visual J++ Projects tree, click Web Pages.
- Click Code-Behind HTML.
- Click Open to create the project.
- 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()
{
setTitle("My Title");
}
protected void onDocumentLoad(Object sender, Event e)
{
// Workaround: uncomment the following line or only set the title
// in the onDocumentLoad.
// setTitle(getTitle());
}
}
- Modify Page1.html as follows:
<HTML>
<BODY>
<hr>
<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>
<!-- Insert HTML here -->
</BODY>
</HTML>
- Run the project.
RESULT: The title of the browser is not "My Title."
REFERENCES
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java,
please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Derek Jamison, Microsoft Corporation
Additional query words:
Keywords : kbJava kbVJ600bug kbVS600sp3fix kbwfchtml kbwfccontrol
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug