RE: TEXTAREA element and Barracuda
Kirk Daries <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <D09B591872D1D611AF2B0010B5A1AAD05D4212@WCSMAIL> |
Hi Jake,
Yes...of course...your're correct.
I did think of this.
But there was a reason I implemented my TextArea's this way(and all other
controls for that matter).
I reuse a single XMLC page... and render the page differently deppending on
the user's rights.
These pages are used strictly for data entry..
E.g.
A user needs to enter company information...
let's say ...Company Name...
<span class="Dir::Get_Data.ExampleModel.p_companyName">[THE COMPANY]</span>
On the 'New' Screen... I'd might have a simple textBox...
When the user edit's the record on the 'Edit' screen.. I might display a
list(drop down) of registered Companies...
(terrible example)...
So.
Instead of having 2 or 3 (New/Edit/View) Tags for a single field on the same
page..
I have a single tag..
I have a interface that my all my dataAware models implement with mainly 3
methods.
public interface HandlePresentation {
public Object handleDefault(ViewContext vc,String key);
public Object handleFind(ViewContext vc,String key);
public Object handleNew(ViewContext vc,String key);
public Object handleEdit(ViewContext vc,String key, BusinessRule
businessRule);
public Object handleView(ViewContext vc,String key, BusinessRule
businessRule);
.
.More methods follow
.
}
Depending on the 'event'.... I call the relevant method...
(handleNew/handleEdit), etc
This works great... and really cuts down on the number of tags I need to
define.
The only drawback is that I do hardcode things like javascript and css
styles.
That's about it.
Regards
KD
-----Original Message-----
From: Jacob Kjome [mailto:[email protected]]
Sent: 02 May 2003 06:19
To: [email protected]
Subject: RE: [Barracuda] TEXTAREA element and Barracuda
Hi Kirk,
Why not have a <textarea> element with a BTemplate directive and return null
if the condition says that it shouldn't be displayed? That should remove
the element from the output, if I'm not mistaken.
Jake
At 03:55 PM 5/2/2003 +0200, you wrote:
Hi,
In the example.. I needed to conditionally create the textArea within the
HTML page.
It depends on the users rights..
E.g.
A user with create or edit rights... would be presented with the textArea
for updating..
A user with only 'View' rights would just see the 'text' without the
textArea being rendered for updating.
Here's the HTML snippet..
<span class="Dir::Get_Data.ExampleModel.Note">[TEXT AREA HERE]</span>
Regards
KD
-----Original Message-----
From: Diez B. Roggisch [ mailto:[email protected]
<mailto:[email protected]> ]
Sent: 02 May 2003 03:47
To: [email protected]
Subject: Re: [Barracuda] TEXTAREA element and Barracuda
Hi,
Kirk Daries wrote:
> } else if (key.equals("Note")) {
> Document doc = vc.getTemplateNode().getOwnerDocument();
> Node targetNode = doc.createElement("TEXTAREA");
> View view = new DefaultView(targetNode);
> BComponent b = new BComponent();
> b.setView(view);
> b.setName("p_note");
> b.setAttr("class","TextBox");
> b.setAttr("id","M,NOTE");
> b.setAttr("cols","30");
> b.setAttr("rows","3");
> return b;
Thats really complicated. In my TextAreaFormElement from the
repopulation-package I simply return a BText (as Christian pointed out
before). Then all this rows/cols/whatever stuff can be put in the html.
<textarea class="Dir::Get_Data.ExampleModel.TEXTAREA" rows="3"
cols="30"></textarea>
Diez
_______________________________________________
Barracuda mailing list
[email protected]
http://barracudamvc.org/lists/listinfo/barracuda
<http://barracudamvc.org/lists/listinfo/barracuda>
_______________________________________________
Barracuda mailing list
[email protected]
http://barracudamvc.org/lists/listinfo/barracuda
<http://barracudamvc.org/lists/listinfo/barracuda>