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] Setting Input Field Values in Maintain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Setting Input Field Values in Maintain
 Login/Join
 
Gold member
posted
Let's say I have a text box or a label and I want to set its value, in real time, the control updating each time I set it. What I'm trying to do is display the selected row number of a grid control. I tried dragging FocIndex into a text box, which displays the initial value, but doesn't update.

This message has been edited. Last edited by: mbondr,


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report This Post
Virtuoso
posted Hide Post
mbondr

Since no one has had any suggestions I think you should open a case with techsupport if it is still an issue.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Gold member
posted Hide Post
I use javascript to set the value in of my control text box when the grid row is selected using the grid either the OnLClicked or OnRClicked event handlers.

here is an example
var dg = document.FormName.GridName;
var currRow = dg.GetCurrentRow();
document.FormName.TextBoxName.value = currRow + 1;

I apologize for not responding sooner. I was out of the office last week did not see your original post.


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
 
Posts: 89 | Registered: March 19, 2011Report This Post
Gold member
posted Hide Post
I couldn't get to the grid using:

document.Form1.grid1

but I could get to it using:

document.getElementById('grid1');

but then I couldn't get to dg.GetCurrentRow();
Using the automatically defined 'ctrl' object seems to work, but then document.Form1.edit1.value fails to find the attribute 'value'.


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report This Post
Master
posted Hide Post
When using the grid, we can get information using JavaScript or by heading back to the Maintain code. If you just want to see the current row number you can do this:

1) Create your grid and populate it with a stack
2) Create a variable in your Maintain code and drag it onto the form
compute showme/i3;
by default, this field is named edit1. You can change it in the properties panel if you want.

3) Click in the grid, display it's properties panel and click on the lightening bolt.
4) Select an event. I chose Left Clicked
5) Add the line: edit.value = row+1;
edit1 is the name of your field, while row is a variable passed into this event (alone with col, etc...)
We add 1 because JavaScript starts on row 0.

function grid1_onlclicked(event, col, row, updn, processed) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
// TODO: Add your event handler code here
edit1.value = row+1;
}

That's it. When you run now, when you click on the form, the value changes and you can use the value of showme back in your Maintain code.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
I have figured out a rhyme or reason for using document.Form1.grid1 vs document.getElementById('grid1');

If the first way doesn't work, I try the second and am usually successful. Have you tried setting the value using

document.getElementById("edit1").value

I hope this is helpful.


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
 
Posts: 89 | Registered: March 19, 2011Report This Post
Gold member
posted Hide Post
Although I get no error, I can't get the text in the textbox to appear. This is what I'm trying now:

//Begin function grid1_onrowchange
function grid1_onrowchange(event, row, newRow) {
document.getElementById('text1').value = newRow + 1;
}
//End function grid1_onrowchange

It might be setting it. Is there a "refresh" method?


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report This Post
Gold member
posted Hide Post
Ah! I figured it out. "value" doesn't cut it. A text box manifests on the page as a span. I switched to "innerHTML" and it worked!


WebFOCUS 8.2.04 (and climbing)
Windows 10, AppStudio
 
Posts: 84 | Registered: February 08, 2018Report 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] Setting Input Field Values in Maintain

Copyright © 1996-2020 Information Builders