Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Current Table Name  (Read 15110 times)
Paul S.
Posts: 45


« 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
Paul S.
Posts: 45


« Reply #1 on: March 14, 2008, 04:59:34 pm »

Hi ,please delete. I have found a way.

Thanks

Paul
Reuben B.
Four Js
Posts: 1071


« Reply #2 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

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Paul S.
Posts: 45


« Reply #3 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
Reuben B.
Four Js
Posts: 1071


« Reply #4 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/.  I'll be adding some code up there in the next few weeks to try and push it along.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Paul S.
Posts: 45


« Reply #5 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/.  I'll be adding some code up there in the next few weeks to try and push it along.

Reuben
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines