Title: Current Table Name Post by: Paul S. on March 14, 2008, 04:21:21 pm Is there a way to get the name of the current table(Display or Input Array).
I have a form which has 3 to 4 tables defined. We allow the user to extract the data from the current table into Excel. The extract process checks for a "Table" in the form and gets the column headings (title/text) of each column,these than become the Column heading in the spreadsheet. If there is more than one table this process gets the first table it finds. I know I could pass the table name to the function in a string and then use selectbypath , but I want to get the Current Table name from the DOM, the same way you can get the Current Window and it attributes. Thanks Paul Title: Re: Current Table Name- Sorted Please Delete Post by: Paul S. on March 14, 2008, 04:59:34 pm Hi ,please delete. I have found a way.
Thanks Paul Title: Re: Current Table Name Post by: Reuben B. on March 16, 2008, 11:04:14 pm Paul,
Don't delete the thread, post the answer, so that the next person along with a similar question can find the answer. I'm guessing it involved using the focus attribute of the UserInterface node of the DOM tree. I wrote a similar routine 'Copy Entire Table' to clipboard a few years ago when I wasn't a 4Js employee and was unable to convince 4Js that 'Copy Visible Table' wasn't very practical. If you get stuck with something else with this routine (catering for sort order, moving columns around, hiding columns etc) I've probably already been there. In fact I should probably try and recreate my routine and make it available. Reuben Title: Re: Current Table Name Post by: Paul S. on March 17, 2008, 08:21:51 am Hi Reuben ,
thanks for the reply. The solution was simple in the end, LET l_file = "//Table[@active='1']" LET nl = root.selectByPath(l_file) This gives me the active table within the current window, which is want I am looking for. This works for both INPUT and DISPLAY ARRAY statements, which I also needed. Is it possible we could have a Code Corner , were we could deposit code for help new people. I have written a number of routines (some bad ,some good) which could help people,many based on code posted by people on the mailing list. Something like the software area on www.iiug.org? Paul Paul, Don't delete the thread, post the answer, so that the next person along with a similar question can find the answer. I'm guessing it involved using the focus attribute of the UserInterface node of the DOM tree. I wrote a similar routine 'Copy Entire Table' to clipboard a few years ago when I wasn't a 4Js employee and was unable to convince 4Js that 'Copy Visible Table' wasn't very practical. If you get stuck with something else with this routine (catering for sort order, moving columns around, hiding columns etc) I've probably already been there. In fact I should probably try and recreate my routine and make it available. Reuben Title: Re: Current Table Name Post by: Reuben B. on March 17, 2008, 09:57:02 pm Hi Reuben , thanks for the reply. The solution was simple in the end, LET l_file = "//Table[@active='1']" LET nl = root.selectByPath(l_file) This gives me the active table within the current window, which is want I am looking for. This works for both INPUT and DISPLAY ARRAY statements, which I also needed. Is it possible we could have a Code Corner , were we could deposit code for help new people. I have written a number of routines (some bad ,some good) which could help people,many based on code posted by people on the mailing list. Something like the software area on www.iiug.org? Paul Paul, Are you aware of http://code.google.com/p/sourcefourjs/ (http://code.google.com/p/sourcefourjs/). I'll be adding some code up there in the next few weeks to try and push it along. Reuben Title: Re: Current Table Name Post by: Paul S. on March 18, 2008, 12:03:05 am Thanks for the link Reuben.
Paul Hi Reuben , thanks for the reply. The solution was simple in the end, LET l_file = "//Table[@active='1']" LET nl = root.selectByPath(l_file) This gives me the active table within the current window, which is want I am looking for. This works for both INPUT and DISPLAY ARRAY statements, which I also needed. Is it possible we could have a Code Corner , were we could deposit code for help new people. I have written a number of routines (some bad ,some good) which could help people,many based on code posted by people on the mailing list. Something like the software area on www.iiug.org? Paul Paul, Are you aware of http://code.google.com/p/sourcefourjs/ (http://code.google.com/p/sourcefourjs/). I'll be adding some code up there in the next few weeks to try and push it along. Reuben |