This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes populating data available in menu component in a text area Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "populating data available in menu component in a text area" Watch "populating data available in menu component in a text area" New topic
Author

populating data available in menu component in a text area

Dilip H Pashupathi
Ranch Hand

Joined: Jul 24, 2013
Posts: 33
Hi,

I have work where I need to display a tree view for certain xml in a text area i.e, in need to populate that in <html:textarea> field. Is this possible.

thanks and regards
Dilip
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

You can, but there are a lot of problems. You can't display formatted text in a textarea, so you'd have to add some text cues to represent the XML hierarchy, for example:



And I'm not sure if you are guaranteed a monospace font. If you got a font that didn't respect your spacing your formatting would be all screwed up.
I sure hope you aren't intending to let someone edit an XML file via this text area. That would be a recipe for disaster. Perhaps you could clue us in on what your requirement is.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Dilip H Pashupathi
Ranch Hand

Joined: Jul 24, 2013
Posts: 33
Hi Joe,

This view is not full xml, the xml tags are created in the db as rows with releation to each other like parent and child releation. What I have to do is get the tags from db and then show it as tree view in the text area or if possible a scroll pane not necessarily a frame. frames need to be avoided as page should not be refreshed.


Thanks and regards
Dilip
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

You don't want end users messing around in a text area with XML. XML has a strict form and the users are certain to screw it up.
I'd suggest using the tree widget from the Struts jQuery plugin. You can see a demo here, click on "Widgets" then "Tree". You will have to add some controls to add/edit/delete nodes, but this will help you preserve the integrity of the XML while giving the user an easy-to-use interface to manipulate it.
Dilip H Pashupathi
Ranch Hand

Joined: Jul 24, 2013
Posts: 33
Hi Joe,

Thank you. That was helpful.

Regards
Dilip
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: populating data available in menu component in a text area