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.
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
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
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
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, 2003
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