This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populating data available in menu component in a text area

 
Dilip H Pashupathi
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dilip H Pashupathi
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9280
10
Linux Mac OS X Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,

Thank you. That was helpful.

Regards
Dilip
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic