Ticket #367 (reopened enhancement)

Opened 3 years ago

Last modified 10 months ago

Problems using Xinha with Tabs

Reported by: mhauptma73@… Owned by: gogo
Priority: low Milestone: 0.96
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

Changed 3 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 :(

Changed 3 years ago by gogo

  • status changed from new to closed
  • resolution set to invalid

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).

Changed 3 years ago by anonymous

  • status changed from closed to reopened
  • resolution deleted

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)

Changed 3 years ago by anonymous

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

Changed 3 years ago by anonymous

  • status changed from reopened to closed
  • resolution set to invalid

Changed 3 years ago by gogo

  • priority changed from high to low
  • version deleted
  • severity changed from major to enhancement
  • milestone changed from Version 1.0 to 2.0

Changed 2 years ago by massimo.azzolini@…

  • status changed from closed to reopened
  • resolution deleted

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

Changed 2 years ago by mokhet

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

Changed 2 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: A. 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.

B. 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

Changed 2 years ago by mokhet

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

Changed 2 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

Changed 2 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.

Changed 2 years ago by massimo.azzolini@…

  • status changed from reopened to closed
  • resolution set to fixed

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

Changed 10 months ago by ray

  • status changed from closed to reopened
  • resolution deleted
  • milestone changed from 2.0 to 0.96

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

Changed 10 months 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

Note: See TracTickets for help on using tickets.