Tung,
Here's a little sample I whipped up to show the refresh
issue. I realize that in this example I'm not explicitly setting the
tabbox withdraw attributes, but I've seen it happen in my larger app even when
the tabbox is set.
To test, change the pulldown to 1, then 2, then back
to 1. You'll note that when you go back the last time, some of the
layout is lost.
This is _similar_ to the functionality I'm seeing, but
not exact. Still, I believe it is related.
encoding="UTF-8"?>
1.0//EN" "xui.dtd">
<window title="Tools" demo"=" width="200px" id="winid" <br="/>xmlns=" xui.dtd" dock="left" enabledocking="any">
<box pack="start" <br="/>orient="vertical">
<combobox <br="/>type="dropdown"
id="myCombo">
<listitem id="lione" label="One" selected="true"/">
<listitem id="litwo" label="Two" <br="/>/>
<script ev:event="DOMActivate" <br="/>type="application/x-javascript">
var xuiWin =
Application.event.view.window;
var xuiDoc =
xuiWin.dialogView.document;
var cBox =
Application.event.target;
xuiDoc.getElementById("boxOne").setAttribute("withdraw","true");
xuiDoc.getElementById("boxTwo").setAttribute("withdraw","true");
xuiDoc.getElementById("box" +
cBox.getAttribute("value")).setAttribute("withdraw","false");
</script>
</combobox>
<box <br="/>withdraw="true" id="boxOne" height="300px"
orient="vertical">
<tabbox <br="/>id="myTbOne">
<tabpanel label="Tab" one"=">
<textbox multiline="true" height="200px" <br="/>/>
</tabpanel>
<tabpanel label="Tab" <br="/>Two">
<textbox multiline="true" height="200px"/>
</tabpanel>
</tabbox>
<box>
<button label="Button" a"=" <br="/>/>
<button label="Button" b"="/>
</box>
<textbox id="myText" multiline="true" <br="/>height="100px">
</textbox>
</box>
<box withdraw="true" <br="/>id="boxTwo" height="400px">
<tabbox <br="/>id="myTbFour">
<tabpanel label="Tab" <br="/>One">
<textbox multiline="true" height="200px" <br="/>/>
</tabpanel>
<tabpanel label="Tab" <br="/>Two">
<textbox multiline="true" height="200px" <br="/>/>
</tabpanel>
</tabbox>
</box>
</box>
</window>
Thanks,
keith
On 2/13/06, Keith
Berard <
keith.berard@milliman.com> wrote:Tung,
Ok,
so I've modified my code to first search for any child tabboxes and set the
withdraw according to your logic and it seems to work for the most
part. Is this a bug with tabbox? Should I need to set
withdraw on other nodes as well?
Now the only issue is that withdrawn
elements still show below the end of other tools if the screen is stretched
(assuming that first element extended past, I'm guessing this is a redraw
issue), but I may be able to get around this by setting some default heights
or something...
public void enable(boolean enable)
{
if (enable)
{
this.rootBox.setAttribute("withdraw","false");
XUIHelper.setChildTabboxWithdraw(this.rootBox, enable);
}
else
{
XUIHelper.setChildTabboxWithdraw(this.rootBox,
enable);
this.rootBox.setAttribute("withdraw","true");
}
}
AND
public static void setChildTabboxWithdraw(Element rootNode,
boolean enable) {
String wdString =
"false";
if (!enable)
{
wdString = "true";
}
if (rootNode.hasChildNodes())
{
NodeList childNodes =
rootNode.getChildNodes();
for(int
i=0; i<childnodes.getlength ();=" i++)=" <br="/> {
Node curChild =
childNodes.item(i);
if (curChild.getNodeType() == Node.ELEMENT_NODE)
{
setChildTabboxWithdraw((Element)curChild, enable);
}
}
}
String nodeName =
rootNode.getNodeName();
if
(nodeName.equals("tabbox"))
{
rootNode.setAttribute
("withdraw",wdString);
}
}
keith
On 2/13/06, Fu,
Tung <- > wrote: Keith,
You
probably can work around this problem by setting the "withdraw" attribute of
the tabbox to "true" before you set the "withdraw" attribute of tool A to
"true". The tabbox "withdraw" can be set back to "false" after the
tool A "withdraw" is set to "true".
Tung
From: - [mailto:
-] On
Behalf Of Keith Berard
Sent: Monday, February 13, 2006 1:38
PM
To: arbortext-adepters
Subject: XUI Sizing and
Withdraw
Hello,
I'm wondering if anyone else is having issues with
the "withdraw" attribute in XUI. I have submitted a Case with
Arbortext on this, but find that it never hurts to post to adepters as
well.
That said, I have a XUI panel that consists of two main
sections and is left-docked on the edit window as a thin vertical dialog
(200px wide). The top is a combobox (pulldown), with a list of
available "tools". The bottom is a box containing the "tool"
selected in the box. This essentially is meant to mimic how the
tabbox works... where each tabpanel would have its own "tool". The
benefit of this approach is that I can have many tools (say, 10-15) without
having to waste real estate on extra tabs.
In order to display the
selected tool, I detect when the pulldown is changed, and set the "withdraw"
attribute to "false" on the selected tool, and "true" on all the
rest. Pretty straight forward approach that I've also used in
Java Swing, Windows Forms, etc.
The problem that I've run into is
that it seems some of the child nodes (specifically, but not limited to
tabpanels) don't seem to want to withdraw properly. This means
that when the pulldown is switched from tool A to tool B, tool B still shows
artifacts from tool A.
I'm wondering if this may have to
do with how XUI allocates space for each child.
Has anyone else come
across strange behavior when hiding nodes, or for that matter, when
resizing?
As a side note, I tested the "withdraw" with a much more
simple example (no pulldown, one tool) and that's how I found that tabpanels
are acting strange.
Keith Berard
XML Systems Analyst
Milliman
Care Guidelines LLC, A Milliman Company
401 Second Avenue South, Suite
400
Seattle, WA 98104
Tel +1 206 381.8166
keith.berard@milliman.com
http://www.careguidelines.com/Delivering
evidence-based knowledge at the point of care
>> To
unsubscribe from the list, send an email to
listmanager@maillist.arbortext.com with the following in
the body: unsubscribe adepters - For additional information on the adepters
list (how to subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com
with the following in
the body: info Adepters - You may also go to
forums.arbortext.com,
enter the Adepters folder and change your subscription options and
preferences.>> >> To unsubscribe from the list, send an email to
listmanager@maillist.arbortext.com with the following in
the body: unsubscribe adepters - For additional information on the adepters
list (how to subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com
with the following in
the body: info Adepters - You may also go to
forums.arbortext.com,
enter the Adepters folder and change your subscription options and
preferences.>>
>> To
unsubscribe from the list, send an email to
listmanager@maillist.arbortext.comwith the following in the body: unsubscribe adepters - For additional
information on the adepters list (how to subscribe or unsubscribe etc), send an
email to:
listmanager@maillist.arbortext.com with the following in the body:
info Adepters - You may also go to
forums.arbortext.com, enter the Adepters
folder and change your subscription options and preferences.>>