Opened 14 years ago

Closed 16 months ago

#367 closed enhancement (wontfix)

Problems using Xinha with Tabs

Reported by: mhauptma73@… Owned by: gogo
Priority: low Milestone: 0.97
Component: Xinha Core Version:
Severity: normal Keywords: tab, div
Cc:

Description

When using Xinha with DHTML-Tabs, Xinha stops working after switching to other Tab and then come back to the Tab with Xinha.
The Tab script I'm using is http://webfx.eae.net/dhtml/tabpane/tabpane.html.
The problems show up in both IE and FF.
I'm not too good in JS and I did not find yet a workaround or a way to handle it :-(

Change History (17)

comment:1 Changed 14 years ago by mhauptma73@…

Solved the problem on FF by attaching an eventhandler on switching tabs and executing...

xinha_editors.textareaName.deactivateEditor();

But IE still behaves strange :(

comment:2 Changed 14 years ago by gogo

  • Resolution set to invalid
  • Status changed from new to closed

This won't be a bug in Xinha. You will probably need to deactivate the editor before switching tabs (as you have done for firefox).

comment:3 Changed 14 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to reopened

actually this IS a bug in Xinha.
this happens if you use ANY other tab script.
i tried 2 of them and the tab he wrote about.
it happens everywhere.
so this should be fixed in xinha.or a function that somehow reactivates all xinha editors should be created.(the editors are all visible but DISABLED when using tabs)

comment:4 Changed 14 years ago by anonymous

an onmouse over that activates the editor would be a good idea...

comment:5 Changed 14 years ago by anonymous

  • Resolution set to invalid
  • Status changed from reopened to closed

comment:6 Changed 14 years ago by gogo

  • Milestone changed from Version 1.0 to 2.0
  • Priority changed from high to low
  • Severity changed from major to enhancement
  • Version trunk deleted

comment:7 Changed 13 years ago by massimo.azzolini@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

I still have this problem with divs which simulate tabs.
see:
http://xinha.gogo.co.nz/punbb/viewtopic.php?id=483
the post at 2005-12-27 13:59:34 by generelz

I deactivate every editor each time I switch between tabs. I tried both to reactivate the editor of the current tab and not to reactivate anything (since xinha does it clicking on it). the HTMLArea stills until I resize the window. I didn't find any other trick.

this occurs in both IE and FF.
I tried with releases:
193: ok
461: ko
477: ko
536: ko

any hint?

thanks in advance

comment:8 Changed 13 years ago by mokhet

Any error messages ? But a demo url is a must have if you want some accurate hints.

comment:9 Changed 13 years ago by massimo.azzolini@…

try the URL:
http://comunereggio.redturtle.it/sviluppo/retecivica/manifest.nsf/test?openform&FROM=iMnfstzn
usr: uno
pwd: uno

there are 2 xinha editors in tabs:
"Dati della manifestazione"
"Dove"

click on "Dati della manifestazione" tab
click on xinha field ==> OK (you can also write something..)
click on "Dove" tab
click on xinha field ==> it does not get focus. it seems freezed

NOTE:

  1. clicking on any tab a js function is activated. before doing anything I run:

xinha_editors.Descrizione.deactivateEditor()
xinha_editors.ComeRagg?.deactivateEditor()

but even if I don't deactivate the editors, it freezes.

  1. I tested the not-tabbed version with IE6 and it ran, I didnt try it with FF or opera. Since I introduced the tabs, xinha did not work.

thanks

Max

comment:10 Changed 13 years ago by mokhet

sorry massimo : Error 404 HTTP Web Server: Lotus Notes Exception - File does not exist

comment:11 Changed 13 years ago by massimo.azzolini@…

maybe it's because it's a linux "case-sensitive" server...
try this:
http://comunereggio.redturtle.it/Sviluppo/retecivica/manifest.nsf/test?openform&FROM=iMnfstzn
actually it runs..

thanks

max

comment:12 Changed 13 years ago by mokhet

In the "Dove" tabs, the iframe size in the editor is set to with:0px, height:0px

It is not freezed, it is just non clickable.

It is because when hidden, stuff like offsetWidth and offsetHeight are always set to 0px and so the original textarea and the iframe (width/height) are set to 0px too, I dont have found any way yet to prevent this 0px stuff. So it's not clickable.

However, to make the editor clickable again, just resize your window and the editor content is back. So I can think of a few ways to fix the problem.

If you have a reference to the editor with no content, let's say it's called myEditor

myEditor.sizeEditor();

If you dont have a reference to the editor but you have the reference of the textarea, use the HTMLArea.getEditor() from /branches/mokhet to get back the reference editor and resize it

HTMLArea.getEditor = function(ref)
{
  for ( var i = __htmlareas.length; i--; )
  {
    var editor = __htmlareas[i];
    if ( editor && ( editor._textArea.id == ref || editor._textArea.name == ref || editor._textArea == ref ) )
    {
      return editor;
    }
  }
  return null;
};
// can use id, name or textarea reference here
var myEditor = HTMLArea.getEditor(myTextArea);
myEditor.sizeEditor();

And if you have absolutly no way to get the editors references, then the easiest way is to do a manual resizing of the window, which will triger the editors resizing

window.onresize();

http://mokhet.com/xinha/examples/tabbed.html

This is not a real fix since the editor is not fixed by himself, but at least it's a workaround.

Hope this will help you.

comment:13 Changed 13 years ago by massimo.azzolini@…

  • Resolution set to fixed
  • Status changed from reopened to closed

Thanks!

it works. good workaround

I added a

xinha_editors.NameOfTheTextArea?.sizeEditor();

to the script I launch everytime I open the tab which contains the NameOfTheTextArea? editor

Massimo

comment:14 Changed 11 years ago by ray

  • Milestone changed from 2.0 to 0.96
  • Resolution fixed deleted
  • Status changed from closed to reopened

I'd like to investigate if this can't be done by the editor itself. Maybe check the visibility onUpdateToolbar or so?

comment:15 Changed 11 years ago by ray

btw: I added the getEditor function proposed by mokhet in rev [934]. Great idea, I wonder why we didn't implement it much earlier

comment:16 Changed 10 years ago by nicholasbs

  • Milestone changed from 0.96 to 0.97

comment:17 Changed 16 months ago by gogo

  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.