Possible to highlight a row in a text area which in turn would fire an event in Java?
I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?
I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
TIA
Oh, and the reason that I think I want to do this in a text area is because there could be a huge list of problems (like 200) yet the GUI can only show so much at a time and I know that a text area can have scroll bars to browse the list. If there is an easier way (i.e. w/o the use of a text area but can "scroll" please let me know. TIA.
I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
TIA

Oh, and the reason that I think I want to do this in a text area is because there could be a huge list of problems (like 200) yet the GUI can only show so much at a time and I know that a text area can have scroll bars to browse the list. If there is an easier way (i.e. w/o the use of a text area but can "scroll" please let me know. TIA.
I just made a very complex cross-browser DOM compliant GUI in javascript/dhtml for administering web content. dynamic page sizing, drag and drop, dhtml popups, the works. too bad it's my company's property or i'd show you.
as for your question:
you can't highlight a row in a text area. suggestion: use a div and put each line in a span. then you can change the span's style when the span gets an onClick. i.e.:
<span id="row1" style="background-color:white" onClick="doPopup('row1');this.style.backgroundColo r='red';">row text goes here</span>
you can put it all in an iframe instead of a div if you want scrolling.
as for your question:
you can't highlight a row in a text area. suggestion: use a div and put each line in a span. then you can change the span's style when the span gets an onClick. i.e.:
<span id="row1" style="background-color:white" onClick="doPopup('row1');this.style.backgroundColo r='red';">row text goes here</span>
you can put it all in an iframe instead of a div if you want scrolling.
[QUOTE]Originally posted by SiDriver
[B]I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?
I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
[B]I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?
I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
Thread
Thread Starter
Forum
Replies
Last Post









