Hi Graham,

Indeed, your version worked, not shure why mine did not, anyhow
it still doesnt solve the problem with in the cases where there are
no spaces in the text to make the textarea drop down to the next line.

I posted the same q on the Dijit mailing list, fyi, heres the response:

We are dealing with this on a current project with a widget that
extends dijit.textarea.

In our case, the layout doesn't break, it just stretches. We are
trying to argue that's good enough.

Possible workarounds:

Use CSS to hide the over-long textarea with overflow:hidden. We
attempted this, but it didn't work because our CSS is so complex
(rounded corners supported by IE6 - ugh).

Capture the onkeypress, which fires an event on every character. Then
use a RegExp or some other method to check between spaces of the text
for overly-long words (you might do:
dojo.forEach( widget.attr("value").split(" "), function(str){
       if(str.length > TOOLONG) ...
}

...then insert a intermittent spaces, line breaks, or a <wbr/>. You
could also do a dojo.stopEvent(evt) at some point. This is obviously
going to be processor intensive.

Maybe you could get fancy and just capture the amount of keypresses in
between keyup/keydowns, and you'd know that someone is holding down a
key. Also check that the character is a letter and not some sort of
punctuation that may be legit, like a series of periods.


I just thought of that last one. I might try it myself :)

Thanks

2008/11/24 Graham Anderson <[EMAIL PROTECTED]>:
> On Monday 24 November 2008 17:01:46 you wrote:
>> Hi Graham,
>>
>> Thanks for the reply.
>>
>> Im new to ZF and have added the following line as you suggested, this
>> is what I now have:
>>
>> $this->addElement(
>>               'Textarea',
>>               'message',
>>                       array(
>>                               'label' => 'Message * (will grow 
>> automatically)',
>>                               'required' => true,
>>                               'style'    => 'width: 200px'
>>                       )
>>                          )->addDecorator('HtmlTag', array('tag' => 'div'));
>>
>> But this just wraps the whole form in a div tag, I guess I need to
>> remove/overwrite the default decorator? Would be
>> grateful of any help
>
> I'm not quite sure why it wraps the whole form using the method above, but
> this should work on the single textarea element.
>
> $this->addElement('Textarea', 'message', array(
>        'label' => 'Message * (will grow automatically)',
>        'required' => true,
>        'style'    => 'width: 200px'
>    )
> );
> $this->getElement('message')
>     ->getDecorator('HtmlTag')
>     ->setOption('tag', 'div');
>
>
> Graham
>



-- 
Thank You
Daniel Latter

Reply via email to