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 Js Grid dropdown not working

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Maintain Js Grid dropdown not working
 Login/Join
 
Gold member
posted
In my 7703 application, I am trying to add a drop-down list to a js grid.

Based on a previous post [SOLVED by IB] help with maintain JS Grid dropdown- character limit?, I have the following code:

Maintain
Compute R/I11=1;
Compute List1/A0= ' ';
repeat StkAssessmentType.FocCount
compute List1 = List1 || StkAssessmentType(R).SCOREDESCRIPTION | ',';
compute R=R+1;
endrepeat

javascript for OnGrid1_OnRowChange:
var DynamList=document.frmDetail.EditBox1.value;
// Replace the "," with "\n"
var myRegExp = /,/gi;
DynamList=DynamList.replace(myRegExp,"\n");
document.frmDetail.Grid1.GetCell(2,newRow);
document.frmDetail.Grid1.QuickSetCellType(2, newRow, 1);
document.frmDetail.Grid1.QuickSetLabel (2, newRow, DynamList);

List1 is correctly bound to an editbox on my form. To debug the javascript, I placed alerts after each line. The javascript appears to work until it reaches document.frmDetail.Grid1.GetCell(2,newRow); when it stops returning the alert statements.


Any clues on how to get the drop-down list to overlay the grid?

Thank you, Deana

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


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
Master
posted Hide Post
Deana
This technique uses HTML to create the drop down list in the JS Grid. This is a static list but we could create a dynamic list as well.

Notice that when a selection is made, we perform a JS function called getval. I have included that function at the end of the code. It copies the selection into the answer field.

Your JS Grid should have a column called app that is Content Type HTML and another column, Answer, for the selection to reside.

My example has App in column 2 and Answer in column 3. If you move the columns you will have to adjust saver / getval. If you would like this example please send me your email and I will send it to you.

Mark

MAINTAIN FILE empdata

$$Declarations

Case Top
for 10 next pin into stk
compute i/i2=1;
repeat stk.foccount
  
compute stk(i).app/a300 = 
  "<select onchange='getval[this, " || I ||")' name=list " || I || ">" |
		"  <option value=' '>  </option> 		"  |
		"  <option value='Approve'>Approve</option> 		"  |
		"  <option value='Wait'>Wait</option> 		"  |
		"  <option value='Reject'>Reject</option> 	" |
		"</select>";

compute i=i+1;
endrepeat
Winform Show Form1;
EndCase

case saver
compute i=1;
repeat stk.foccount
Compute Stk(I).answer/a10 = Form1.GetHTMLField('list' || I);
compute i=i+1;
endrepeat
endcase

END

saver.js

function getval(sel, I)
{
Form1.Grid1.CellSetText(2, I-1, sel.value);
Form1.Grid1.CellSetText(3, I-1, "Y");
}
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
Mark,

The code samples you sent worked great. I am looking forward to using this functionality as I move forward with my project.

Thank you,
Deana


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
  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 Js Grid dropdown not working

Copyright © 1996-2020 Information Builders