[prev in list] [next in list] [prev in thread] [next in thread] 

List:       barracuda
Subject:    Barracuda:  Text Area... (Again)
From:       barracuda () enhydra ! org (Kirk Daries)
Date:       2001-11-29 6:22:36
[Download RAW message or body]

Thanx Christian...

That worked great!

-----Original Message-----
From: Christian Cryder [mailto:christianc@granitepeaks.com]
Sent: 23 November 2001 05:56
To: barracuda@enhydra.org
Subject: RE: Barracuda: Text Area... (Again)


Hi Kirk,

> I was quite surprised to note that BInput didn't have
> a 'type' of TEXTAREA...

This is because textarea is defined using <TEXTAREA>, not <INPUT>. Input
only defines the following type attributes (from the 4.01 spec):

<!ENTITY % InputType
  "(TEXT | PASSWORD | CHECKBOX |
    RADIO | SUBMIT | RESET |
    FILE | HIDDEN | IMAGE | BUTTON)"
   >

> Based on a directive in my html file, when the template
> processes the node, I'd like a Text Area returned.

As Jake suggested in his response, the best way to do this would simply to
be to return text, or perhaps a BText component. This of course requires the
template to actually define the textarea element and to put the directive in
there. If you want to do that manually, then you could do something like you
suggested:

> >>Document doc = vc.getElementFactory().getDocument();
> >>Node targetNode = doc.createElement("TEXTAREA");
> >>View view = new DefaultView(targetNode);
> >>return new BText("Some text", view);

Rather than using the element factory to get the document, just use the
default node (which is part of the ViewContext):

Document doc - vc.getDefaultNode().getOwnerDocument()

Hope that helps,
Christian
------------------------------------------------
Christian Cryder [christianc@granitepeaks.com]
Barracuda - MVC Component Framework for Webapps
http://barracuda.enhydra.org
------------------------------------------------
        "What a great time to be a Geek"

> -----Original Message-----
> From: barracuda-admin@enhydra.org [mailto:barracuda-admin@enhydra.org]On
> Behalf Of Kirk Daries
> Sent: Thursday, November 22, 2001 6:53 AM
> To: barracuda@enhydra.org
> Subject: Barracuda: Text Area... (Again)
>
>
> Hiya Guys,
>
> Up to now.. I've just been using BText and BInput as
> far as components are concerned..
>
> I was quite surprised to note that BInput didn't have
> a 'type' of TEXTAREA...
>
> Anyway....
> As the subject of the email suggests.. I'm having a little
> problem with Text Area's.
>
> Based on a directive in my html file, when the template
> processes the node, I'd like a Text Area returned.
>
> I've gone through the archives and come across the following
> piece of code that Christian suggested.
>
> >>Document doc = vc.getElementFactory().getDocument();
> >>Node targetNode = doc.createElement("TEXTAREA");
> >>View view = new DefaultView(targetNode);
> >>return new BText("Some text", view);
>
> I've only got 1 problems with this approach...
>
> 1. It uses the elementFactory... which is due for deprecation.
>
> Does any one have a better/correct way of creating a text area?
> Thanx
> KD
> _______________________________________________
> Barracuda mailing list
> Barracuda@enhydra.org
> http://www.enhydra.org/mailman/listinfo.cgi/barracuda

_______________________________________________
Barracuda mailing list
Barracuda@enhydra.org
http://www.enhydra.org/mailman/listinfo.cgi/barracuda

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic