PDA

View Full Version : [CLOSED] Tooltip Does not Update



amitpareek
May 28, 2013, 2:31 PM
Hi,
I have the following Tooltip for a Label. When I update it, it does'nt update the text.


<ext:Label runat="server" ID="lblSearchName" ItemID="lblSearchName" Text="">
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="abcd" ForceRendering="true"></ext:ToolTip>
</ToolTips>
</ext:Label>


I use App.Tooltip1.update("Testing this Search...");

Thanks,

Daniil
May 28, 2013, 3:37 PM
Hi @amitpareek,

I see

ID="ToolTip1"
and

App.Tooltip1

The different cases of the second "t".

Does not your update code throw a JavaScript error?

amitpareek
May 28, 2013, 3:58 PM
Hi @amitpareek,

I see

ID="ToolTip1"
and

App.Tooltip1

The different cases of the second "t".

Does not your update code throw a JavaScript error?

Hey Dennis,
Thats just a typo. It would basically not update. Try it with App.ToolTip1.update("Test"); It will not update.

Daniil
May 28, 2013, 4:02 PM
Well, actually, before posting I checked it out. It works well in the test case below.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Label runat="server" Text="Some Label">
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="Initial text" />
</ToolTips>
</ext:Label>

<ext:Button runat="server" Text="Update" Handler="App.ToolTip1.update('Dynamic text');" />
</form>
</body>
</html>

amitpareek
May 28, 2013, 4:13 PM
Well, actually, before posting I checked it out. It works well in the test case below.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Label runat="server" Text="Some Label">
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="Initial text" />
</ToolTips>
</ext:Label>

<ext:Button runat="server" Text="Update" Handler="App.ToolTip1.update('Dynamic text');" />
</form>
</body>
</html>



Hey Dennis,
Can you try by setting Text="" on label. And then update Label and update tooltip.

Baidaly
May 29, 2013, 3:11 AM
Hello!

The following sample updates Label's text and Tooltip's Html:



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Label runat="server" ID="Label1" Text="Some Label">
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="Initial text" />
</ToolTips>
</ext:Label>

<ext:Button runat="server" Text="Update" Handler="App.Label1.setText('New text'); App.ToolTip1.update('Dynamic text');" />
</form>
</body>
</html>

amitpareek
May 29, 2013, 12:55 PM
Hi Guys,
The issue existed because of id of another tooltip being the same. There was some rendering happening on a button click, after which the old tooltip object wud get replaced with some other object.

I will add another post regarding this issue. I have already discussed with Vlad on this issue after upgrading to 2.2

http://forums.ext.net/showthread.php?24224-Namespace-and-ID-issue-in-v2-2

May be you guys should look at it too. The new changes related to ID and ItemID has added a lot of confusion in 2.2.

amitpareek
May 29, 2013, 1:00 PM
I am using the following override now to fix the issue. It's a little different from the one VLad had suggested the the post link I sent you in previous thread.

The following code will ensure uniqueness of the component within a namespace, if no id is specified and we mention on itemId. We don't specify ID on any component until we have to use Ext.getCmp which is not useful as all the components are available in their respective namespaces.



Ext.net.ComponentManager.registerId = function (cmp) {
if (cmp.initDirectEvents) {
cmp.initDirectEvents();
}




if (cmp.initialConfig || cmp.isStore || cmp.proxyId) {
var cfg = cmp.initialConfig || {},
id = cmp.isStore ? cmp.storeId : (cmp.proxyId || cfg.proxyId || cfg.id),
itemId = cmp.isStore ? cmp.itemId : cfg.itemId,
itemId = itemId == undefined ? id : itemId;
ns = cmp.ns || (Ext.isArray(Ext.net.ResourceMgr.ns) ? Ext.net.ResourceMgr.ns[0] : Ext.net.ResourceMgr.ns),
//hasId = (!Ext.isEmpty(id, false) && id.indexOf("ext-comp-") !== 0);
hasId = !Ext.isEmpty(itemId, false);
if (cmp.isStore) cmp.storeId = itemId;


if (cmp.forbidIdScoping !== true && (hasId || (cmp.ns && !Ext.isEmpty(cmp.itemId, false)))) {
if (ns) {
(Ext.isObject(ns) ? ns : Ext.ns(ns))[hasId ? (itemId == undefined ? id : itemId) : id] = cmp;
(Ext.isObject(ns) ? ns : Ext.ns(ns))[hasId ? id : id] = cmp;
cmp.nsId = (Ext.isObject(ns) ? "" : (ns + ".")) + (hasId ? id : itemId);
} else {
window[id] = cmp;
cmp.nsId = id;
}
}
}
};

Daniil
May 30, 2013, 4:19 AM
It would be nice if you can update that thread with this related information.

I know there are some your posts which have been not answered. Just I think the last Geoffrey's post is still actual. Briefly, we are still very reluctant to add a new id property, but considering a possibility to implement a new option for IDMode.

Marking this thread as closed.

amitpareek
May 30, 2013, 6:56 AM
I have updated.

http://forums.ext.net/showthread.php?24224-OPEN-257-Namespace-and-ID-issue-in-v2-2&p=110294&posted=1#post110294