Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Maintain-Add records by using Grid

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Maintain-Add records by using Grid
 Login/Join
 
Member
posted
Does anyone know that if a record can be added through the Grid Control(Active or JS).
For example:
There is an add button and the grid will add a new blank row when I click it.

This message has been edited. Last edited by: Elaine,
 
Posts: 22 | Registered: May 13, 2011Report This Post
Master
posted Hide Post
Hi Elaine,
For the most part the grid only displays how ever many rows are in the stack bound to it. If you would like to have empty rows for input, add extra rows to the stack. For example, if STK is bound to the grid then:
COMPUTE STK.FOCCOUNT = 10;
Would place 10 rows in the stack. If you wanted to press a button to add a blank line you could have:
COMPUTE STK.FOCCOUNT=STK.FOCCOUNT+1;
That would add the blank row to the bottom of the grid. You could then sort the stack if you wanted the blank row on the top.

FOCCOUNT is the number of rows in the stack. So, adding to that value will add extra rows.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
Thanks,Mark.It works and I found another way to add a blank row by javascript.
  
function OnAddRecordBtn_Click ( )  {
var obj = document.getElementsByName('Grid1');
var table = obj[0];
table.insertRow(0);
}

A blank row will be added on the top of the grid. But I don't know how to insert the new value into the database. I'm not queit understand about the stack. But I think it is also possible in this way,right?
 
Posts: 22 | Registered: May 13, 2011Report This Post
Master
posted Hide Post
I am actually getting an error with that code. I am concerned that even though you CAN enter data into a blank row, that it may not get back to the application.

Stacks are VERY important to understand in Maintain. We use them to load data from the database and display that data on the form. A Grid displays the Database (or computed) fields as columns and data from the database on the rows. When you add / edit data into the grid, it goes into the stack and therefore back to the database.

Please review the help file on NEXT for loading the stack and concepts like FOCINDEX and FOCCOUNT.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Maintain-Add records by using Grid

Copyright © 1996-2020 Information Builders