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.
Hello, my new task is to build a datagrid (without Maintain) where the user can add values(int), and if nesseray collapse a new row to add content. the last row has to build the sum of the added values(int). The grid will have 3 columns and max. 8 rows.
WF Production Version: 7.7.02M WF Test Version: 7.7.02M Developer Studio: 7.7.02 HTML, EXL2K, FLEX, PDF,PPT
Holy Crap, that's awesome JG. I took the initial request to say he wanted to write it back to the table (i.e. the Maintain reference). I'm not seeing any MODIFYs or servelet calls so I'm assuming yours does not.
What would that piece look like (for my own knowledge)?
As a re-entrant focexec it would be something like this, Obviously if you are doing an operation on a data base you will also neeed to pass the key value
you do that using
HREF= HREF + "&|MATCHKEY=!IBI.AMP.MATCHKEY;";
Where MATCHKEY is an & variable that you pass into the focexec initially.
This example is for MRE so you need to change HREF= HREF + "&|IBIMR_drill=X,mredomaine/mredomain.htm"; to match your own domain
-DEFAULTH &STARTAT='DATAGRID';
-DEFAULTH &MATCHKEY='XYZ'
-GOTO &STARTAT.EVAL
-DATAGRID
DEFINE FILE CAR
LOADDATA/A200='<input type=button value="Load" onClick="doLoad();"></input>';
END
TABLE FILE CAR
PRINT
COMPUTE ROWCNT/I1= LAST ROWCNT + 1; NOPRINT
COMPUTE COL1/A200= IF ROWCNT EQ 8 THEN '<input type="text" name="COL1" id="R8C1" />' ELSE
'<input type="text" name="COL1" id="R'||EDIT(ROWCNT)||'C1" onChange="addIt();" />'; AS ''
COMPUTE COL2/A200= IF ROWCNT EQ 8 THEN '<input type="text" name="COL2" id="R8C2" />' ELSE
'<input type="text" name="COL2" id="R'||EDIT(ROWCNT)||'C2" onChange="addIt();" />'; AS ''
COMPUTE COL3/A200= IF ROWCNT EQ 8 THEN '<input type="text" name="COL3" id="R8C3" />' ELSE
'<input type="text" name="COL3" id="R'||EDIT(ROWCNT)||'C3" onChange="addIt();" />'; AS ''
COMPUTE BTN/A200= IF ROWCNT GE 7 THEN '' ELSE
'<input type=button value="+/-" onClick="showHide('||EDIT(ROWCNT)||');"</input>'; AS ''
BY MODEL NOPRINT
ON TABLE SUBFOOT
"<LOADDATA"
WHERE RECORDLIMIT EQ 8
ON TABLE HOLD AS DATAGRID FORMAT HTMTABLE
ON TABLE SET PAGE NOLEAD
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<script javascript>
function initialHide(){
var tbl = document.getElementsByTagName('TABLE');
var rows = document.getElementsByTagName('TR');
for ( i=1; i<7;i++) {
rows[i].style.display='none';
}
}
function showHide(onRow){
var doFrom = onRow;
var tbl = document.getElementsByTagName('TABLE');
var rows = document.getElementsByTagName('TR');
var nextStyle=rows[doFrom].style.display;
if (nextStyle != 'none'){
for ( i=doFrom; i<7;i++) {
rows[i].style.display='none';
}
}
else
rows[doFrom].style.display='';
}
function addIt(){
document.getElementById("R8C1").value = (document.getElementById("R1C1").value -0)
+ (document.getElementById("R2C1").value -0)
+ (document.getElementById("R3C1").value -0)
+ (document.getElementById("R4C1").value -0)
+ (document.getElementById("R5C1").value -0)
+ (document.getElementById("R6C1").value -0)
+ (document.getElementById("R7C1").value -0) ;
document.getElementById("R8C2").value = (document.getElementById("R1C2").value -0)
+ (document.getElementById("R2C2").value -0)
+ (document.getElementById("R3C2").value -0)
+ (document.getElementById("R4C2").value -0)
+ (document.getElementById("R5C2").value -0)
+ (document.getElementById("R6C2").value -0)
+ (document.getElementById("R7C2").value -0) ;
document.getElementById("R8C3").value = (document.getElementById("R1C3").value -0)
+ (document.getElementById("R2C3").value -0)
+ (document.getElementById("R3C3").value -0)
+ (document.getElementById("R4C3").value -0)
+ (document.getElementById("R5C3").value -0)
+ (document.getElementById("R6C3").value -0)
+ (document.getElementById("R7C3").value -0) ;
}
function doLoad(){
var value1=document.getElementById("R8C1").value;
var value2=document.getElementById("R8C2").value;
var value3=document.getElementById("R8C3").value;
HREF="/ibi_apps/WFServlet?";
HREF= HREF + "IBIF_webapp=/ibi_apps";
HREF= HREF + "&|IBIC_server=EDASERVE";
HREF= HREF + "&|IBIWF_msgviewer=OFF";
HREF= HREF + "&|IBIAPP_app=baseapp";
HREF= HREF + "&|IBIMR_drill=X,mredomaine/mredomain.htm";
HREF= HREF + "&|IBIF_ex=app/datagrid";
HREF= HREF + "&|CLICKED_ON=";
HREF= HREF + "&|MATCHKEY=!IBI.AMP.MATCHKEY;";
HREF= HREF + "&|VALUE1="+value1;
HREF= HREF + "&|VALUE2="+value2;
HREF= HREF + "&|VALUE3="+value3;
HREF= HREF + "&|STARTAT=LOADDATA";
HREF= HREF + "&|Random="+(Math.random());
window.open(HREF,'dataload','menubar=1,resizable=1,width=800,height=500');
}
</script>
</head>
<body onLoad="initialHide();">
!IBI.FIL.DATAGRID;
</body>
</html>
-HTMLFORM END
-RUN
-EXIT
-LOADDATA
MODIFY FILE whatever
FIXFORM Statements
MATCH Statements
ON MATCH Statements
ON NOMATCH Statements
DATA
&MATCHKEY.EVAL,&VALUE1.EVAL,&VALUE2.EVAL,&VALUE3.EVAL
END
edit so that you do not have to scroll to view.This message has been edited. Last edited by: <JG>,
thanks a lot so far!!! i am now working with WebFOCUS for 10 months and i am surprised every day about the possibilities. i will check out you code. is it a problem to embed the grid in a normal form?? i think a have a another challenge!!! is it also possible to implement a list box in the first cell of every row. so that the user can choose, for what kind of materials in my case, he fills out the grid. the content of the list_box is always the same.
Christian
WF Production Version: 7.7.02M WF Test Version: 7.7.02M Developer Studio: 7.7.02 HTML, EXL2K, FLEX, PDF,PPT
The problem with the composer is that it does not allow you to insert a table. Controlling the collapse/expand functionality is much easier using a table than trying to do it on the code that the composer generates.
i just ask because i have to add some normal text_boxes and some check_boxes to the form. i think i can just add them by copying the code that the composer generates. i thought it would be the best to start with the difficult part of the form.
Christian
WF Production Version: 7.7.02M WF Test Version: 7.7.02M Developer Studio: 7.7.02 HTML, EXL2K, FLEX, PDF,PPT
To be honest if you are not very comfortable hand coding the html your best option is to generate the code you need using a standard html designer and copying and pasting form that.
The code generated by the composer is very dificult to manipulate.
Okay, i will try it with another html designer!! Last question, how can i add headers to the columns, after i wrote something between the '', the symbol for +/- disapperas.
Thanks a lot again!! For the great stuff!!!
Christian
WF Production Version: 7.7.02M WF Test Version: 7.7.02M Developer Studio: 7.7.02 HTML, EXL2K, FLEX, PDF,PPT