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.
Thanks, Mark, I got the highlighting to work with this code:
function OnSearchTable_ClickLink ( ) {
var selrow =document.FindEdit.SearchTable_ClickRow.value;
var k = selrow -1;
var TableDiv = document.getElementById("SearchTable");
var DivChildren = TableDiv.children;
var TableObj;
for (i=0; i<DivChildren.length; i++)
if (DivChildren(i).tagName == "TABLE") {
TableObj = DivChildren(i);
break;
}
for (i=0; i<TableObj.rows.length; i++) {
for (j=0; j<TableObj.rows(i).cells.length; j++) {
if(k == i){
TableObj.rows(i).style.backgroundColor = "rgb(248, 225, 150)";
TableObj.rows(i).style.fontWeight = "bold";
}
}
}
BUT ! I now realize that just doing this in client side JavaScript is not enough.
I need to have maintain respond to the HTMLTable selection by populating a number of form controls, and sending back a new page to the users browser, with the selected row highlighted.
What I just accomplished was only to Highlight a row on in the browser page. Now I'm faced with the problem of how to do this again when the page is refreshed by Maintain with the field values, on a whole new page !
There will be no ClickLink event on the 2nd pageload to trigger the row highlight. I know I can pass a variable with the selected row number, and perhaps a 'selected' state var., but not sure what to do with it from there. I've never been a big fan of trying to add stuff into the Maintain (7.6.8 btw) onLoad code.
Any ideas ?
The overall idea I am working on is to present a single page that has a record search capability, and all the records data fields, to be able to add a new record, update, or delete an existing one (selected from the Search Table). The selected row highlighting is a necessary user interface function.
One-stop shopping for all db functions for a small record This message has been edited. Last edited by: Dave Ayers,
In order to make the row highlighed when the form refreshes, you have to add two steps.
1) Save the selected row number in an field on your form 2) Perform the highlighting code when the form refreshes.
Saving the value is no problem. When a selection is made, just do: var form.obj.value =document.FindEdit.SearchTable_ClickRow.value;
Where form is the name of your form and obj is the name of the variable containing the selected value. Remember to preset this value to 1 and you can make it visible No.
Next you need to create a JavaScript procedure containing your highlighting code AND a small wrapper. Once you create this, add it to your project and embed it onto your form.
var OriginalOnload = document.body.onload; document.body.onload = LoadFunct; //assign your custom onload
function LoadFunct() { if (OriginalOnload) OriginalOnload (); //first run the OriginalOnload // Custom onload code can now follow
var selrow =form.obj.value; var k = selrow -1; var TableDiv = document.getElementById("SearchTable"); var DivChildren = TableDiv.children; var TableObj; -* and add the rest of your code here... }
Notice that I have YOUR code pulling the value from the object on the form (form.obj.value) instead of from the htmltable. Now when the form refreshes, the proper line SHOULD be highlighted. The only caveat here is that at some point you no longer needed to use the wrapper on the code. So, if for some reason you get an error on LoadFunct, just remove the wrapper AND your function name and just place the code in the JS file.
Mark
Posts: 663 | Location: New York | Registered: May 08, 2003