The correct idea :)

In tacos.js, in tacos.loadElement we do:
localElement.innerHTML=tacos.getContentAsString(contents);

Do a dojo.debug on this, and you'll see <textarea/> !

In firefox, tacos.getContentAsString calls tacos._getContentAsStringMozilla
which in turn uses the XMLSerializer which is responsible for changing
<textarea></textarea> into <textarea/>.

I haven't been able to find any method that alters the behaviour of the
serializer,
so maybe the simplest fix would be doing a search and replace.

Here's the code - or should I commit since I now have access ? :)

function fixTextarea(content)
{
    var taMatcher = '<textarea(.*?)/>';
    var match = new RegExp(taMatcher);
    content = content.replace(match, "<textarea$1></textarea>");
   
    if (content.match(match))
        return fixTextarea(content);
    else
        return content;
}

and some tests

function tests()
{
  alert(fixTextarea("blah<textarea id='1'/>more <b>content</b>"));
  alert(fixTextarea("<textarea id='1'  />more <b>content</b>"));
  alert(fixTextarea("<textarea id='1'/><textarea id='2'/>"));
  alert(fixTextarea("<textarea id='1'></textarea>more <b>content</b>"));
  alert(fixTextarea("<textarea id='1'>more <b>content</b>
here!</textarea>"));
  alert(fixTextarea("<textarea/>"));
}

Jesse Kuhnert wrote:

>A good idea, but changed the xml doctype to declare xhtml loose instead of
>the strict spec.
>
>I've also double checked the repsonse and it is definitely a complete
>element..Ie <textarea></textarea>.
>
>On 12/7/05, Andreas Andreou <[EMAIL PROTECTED]> wrote:
>  
>
>>Just a thought...
>>In tacos, the content of an xmlhttpresponse is defined to be strict xml.
>>
>>So, if the textarea has no content, the response may probably become
>><textarea ........ /> instead of <textarea .......></textarea>
>>
>>In the first case, FF does not understand that the textarea closes right
>>away,
>>and so adds in that textarea the rest of the page!
>>
>>Don't have the time right now to test but this may be the correct behavior
>>for the html doctype you're using.
>>
>>Can you check that the ajax response indeed contains <textarea/> ?
>>Can you give it a try with another doctype?
>>
>>
>>Cosmin Bucur wrote:
>>
>>    
>>
>>>yes you are right , and by inserting a whitespace as a default value
>>>the textarea renders fine .
>>>
>>>
>>>However it's still  not where I'd like this to be of course :) .
>>>
>>>So my question to you guys is ... how do we tell firefox about the bug
>>>. I mean it only seems to occur with xmlhttprequests in tacos , it's
>>>not like blank textareas never render corectly .
>>>
>>>would i need to prove to them that this is the case ?
>>>
>>>i've just nevevr submited a bug to them .
>>>
>>>Any sugestions would help ,
>>>
>>>Thanks
>>>
>>>
>>>On 12/7/05, Cosmin Bucur <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>      
>>>
>>>>oh really ?
>>>>
>>>>will try it then with some content . at least like this i can work
>>>>arround the bug .
>>>>
>>>>
>>>>
>>>>On 12/7/05, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
>>>>
>>>>
>>>>        
>>>>
>>>>>For clarification, I did look at this yesterday but don't have a "fix"
>>>>>          
>>>>>
>>in
>>    
>>
>>>>>the sense that it was a tapestry or tacos bug.
>>>>>
>>>>>If your textarea in question always has some content then the refresh
>>>>>          
>>>>>
>>works.
>>    
>>
>>>>>For some reason FF is displaying other information when the textarea is
>>>>>empty.
>>>>>
>>>>>I would say that this is definitely a FF bug that should probably be
>>>>>submitted to bugzilla.
>>>>>
>>>>>
>>>>>On 12/6/05, Jesse Kuhnert < [EMAIL PROTECTED]> wrote:
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>I'll be fixing this today. Sorry for the inactivity on my part. Events
>>>>>>            
>>>>>>
>>out
>>    
>>
>>>>>>            
>>>>>>
>>>>>of my control disrupted my attention yesterday and today my day job is
>>>>>requiring a lot of attention.
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>It will be fixed today and beta-1 will come out as well.
>>>>>>
>>>>>>
>>>>>>
>>>>>>On 12/6/05, Tim Downey < [EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>Yes.  That is what I mean.  Any ajax response that contains a
>>>>>>>              
>>>>>>>
>>textarea
>>    
>>
>>>>>>>              
>>>>>>>
>>>>>will fail on FF.  It doesn't matter if the textarea was rendered as a
>>>>>tapestry component or is just a standard HTML textarea.
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>On 12/6/05, Cosmin Bucur < [EMAIL PROTECTED] > wrote:
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>>>yea static page works , i was getting concerned , since i just
>>>>>>>>decidded to start developing for ff and give up msie .
>>>>>>>>
>>>>>>>>looks like it's only when the page is loaded through an ajax
>>>>>>>>                
>>>>>>>>
>>response
>>    
>>
>>>>>>>>                
>>>>>>>>
>>>>>...
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>On 12/6/05, Cosmin Bucur < [EMAIL PROTECTED]> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>>>>>are you saying that a static html page with a textarea in a form
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>>>>>>
>>>>>would
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>produce the same results in Firefox ?
>>>>>>>>>
>>>>>>>>>that sounds ... disturbing
>>>>>>>>>
>>>>>>>>>On 12/6/05, Tim Downey < [EMAIL PROTECTED]> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>>>>>>
>>>>>>>>>>That is what I have seen as well.  If you simply use a plain,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                    
>>>>>>>>>>
>>>>>standard
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>non-Tapestry <textarea> using basic HTML and no javascript you can
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                    
>>>>>>>>>>
>>>>>reproduce
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>the issue.
>>>>>>>>>>
>>>>>>>>>>It's almost as if it is some sort of Firefox bug.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>On 12/6/05, Cosmin Bucur <[EMAIL PROTECTED]> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                    
>>>>>>>>>>
>>>>>>>>>>>Ok so I had to do this mini app and I figure i'd give it a shot
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>with
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>tacos and make it 100% ajax .
>>>>>>>>>>>
>>>>>>>>>>>It all went ... relatively good and i have now finished 99.99 %
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>of it
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>successfully . It helped me find 2 VERY anoying bugs however (
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>one of
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>them i'll talk about later in the tapestry ml a bit ) .
>>>>>>>>>>>
>>>>>>>>>>>the one directly related to tacos is the TextArea bug . At first
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>I
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>thought i'm having  issues with using a TextArea tapestry
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>component in
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>a page that's loaded by an AjaxDirectLink . So I left this
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>detail at
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>the very end , hoping that i'll get a fix by then .
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>Today , when finishing , i figured i'll use a workarround . My
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>ideea
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>was to use this approach :
>>>>>>>>>>>
>>>>>>>>>>><textarea onblur="document.getElementById('notes').value =
>>>>>>>>>>>this.innerHTML"><span
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>>>>>>jwcid="notesValue"/></textarea><span
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                    
>>>>>>>>>>
>>>>>>>>>>>jwcid="notes"/>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>when :
>>>>>>>>>>><component id="notesValue" type="Insert">
>>>>>>>>>>>           <binding name="value" value="sesiune.note"/>
>>>>>>>>>>>       </component>
>>>>>>>>>>>   <component id="notes" type="Hidden">
>>>>>>>>>>>           <binding name="value" value="sesiune.note"/>
>>>>>>>>>>>       </component>
>>>>>>>>>>>
>>>>>>>>>>>as oposed to
>>>>>>>>>>><span jwcid="myNotesTextArea" />
>>>>>>>>>>>
>>>>>>>>>>>Well to my dissapointment it doesn't seem to be a problem with
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>the
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>TextArea tapestry component at all , but the actual rendering of
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>the
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>><textarea> tag . Same problem occurs with the html tag ...
>>>>>>>>>>>
>>>>>>>>>>>When's the beta comming out ? :P
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>-------------------------------------------------------
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>This SF.net email is sponsored by: Splunk Inc. Do you grep
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>through log
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>files
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                    
>>>>>>>>>>
>>>>>>>>>>>for problems?  Stop!  Download the new AJAX search engine that
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>makes
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>searching your log files as easy as surfing the  web.  DOWNLOAD
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>SPLUNK!
>>>>>
>>>>>
>>>>>http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>>_______________________________________________
>>>>>>>>>>>Tacos-devel mailing list
>>>>>>>>>>>[email protected]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>>
>>>>>https://lists.sourceforge.net/lists/listinfo/tacos-devel
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>>>                    
>>>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>-------------------------------------------------------
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>This SF.net email is sponsored by: Splunk Inc. Do you grep through
>>>>>>>>                
>>>>>>>>
>>log
>>    
>>
>>>>>>>>                
>>>>>>>>
>>>>>files
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>for problems?  Stop!  Download the new AJAX search engine that makes
>>>>>>>>searching your log files as easy as surfing the  web.  DOWNLOAD
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>SPLUNK!
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
>>>>>>>>_______________________________________________
>>>>>>>>Tacos-devel mailing list
>>>>>>>>[email protected]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>https://lists.sourceforge.net/lists/listinfo/tacos-devel
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>              
>>>>>>>
>>>>>>            
>>>>>>
>>>>>          
>>>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log
>>>      
>>>
>>files
>>    
>>
>>>for problems?  Stop!  Download the new AJAX search engine that makes
>>>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>>>http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
>>>_______________________________________________
>>>Tacos-devel mailing list
>>>[email protected]
>>>https://lists.sourceforge.net/lists/listinfo/tacos-devel
>>>
>>>
>>>
>>>
>>>      
>>>
>>-------------------------------------------------------
>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log
>>files
>>for problems?  Stop!  Download the new AJAX search engine that makes
>>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>>http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
>>_______________________________________________
>>Tacos-devel mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/tacos-devel
>>
>>    
>>
>
>  
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to