• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

populating data available in menu component in a text area

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe,

Thank you. That was helpful.

Regards
Dilip
reply
    Bookmark Topic Watch Topic
  • New Topic