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] text box in a fex

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] text box in a fex
 Login/Join
 
Platinum Member
posted
I have a report that requires the users to input some values into a text box. I am not using the html layout painter, so I would like the text box to be within the fex. Is this possible?

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


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Virtuoso
posted Hide Post
There are only afew things that you can't do with WebFOCUS. This is not one of them, so yes it can be done. There are basicly two ways: the first means that you code your variables with a list of choices and let the autoprompt facility handle the rest. The second is that you code the html code in your fex, and run it; this means you;ll need a second fex to receieve the selected values.
I'm sure there are a lot of examples to be found, either within this forum, or on the IB tech support site.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
I have a field called forecast which has values
and I need a text box for the users to input suggested forecast
sales: 100 200 300 500 800 900
forecast: 100 200 300 400 500 600
sug fct: ___ ___ ___ ___ ___ ___


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Guru
posted Hide Post
Donald,

Here is an example:

DEFINE FILE CAR
 INFLD/A255='<INPUT value=' | EDIT(RETAIL_COST) | ' name="SALESTEXT">';
END
TABLE FILE CAR
PRINT
CAR
INFLD
END


Use FTOA if you do not want the leading zeros in your value.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Platinum Member
posted Hide Post
THAT LOOKS GREAT!!! except for the leading zeros. I hate to sound ignorant, but can you show me where the FTOA would go in the code.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Expert
posted Hide Post
You would add a field to the define in front of the INFLD to convert the field to alpha and specifiy a format that omits leading zeros. Then use that alpha field in the INFLD definition without the EDIT command.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
... and to learn about using functions such as FTOA, look towards your manuals of use the search function top right Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
It works for thje cars database,but for my application a am getting a blank text box instead of the quantity field.

ALPHA_FCT/A30 = FTOA(CURRQTYF, '(D20)', ALPHA_FCT);
INFLD1/A100='';


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Platinum Member
posted Hide Post
ALPHA_FCT/A30 = FTOA(CURRQTYF, '(D20)', ALPHA_FCT); INFLD1/A100='';


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Expert
posted Hide Post
Make sure that you put your code between the code tags, the red icon to the right of the posting box.

This works:
DEFINE FILE CAR
 ALPHA_FCT/A30 = FTOA(RETAIL_COST, '(D20)', ALPHA_FCT);
 INFLD/A255='<INPUT value=' | ALPHA_FCT | ' name="SALESTEXT">';
-* INFLD/A255='<INPUT value=' | EDIT(RETAIL_COST) | ' name="SALESTEXT">';
END
TABLE FILE CAR
PRINT
CAR
INFLD
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
that works now.. I had "SET SHOWBLANKS = ON" so by textbox was blank.. thanks for the advice.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Platinum Member
posted Hide Post
Last question is can I right justify the values in the text box.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Virtuoso
posted Hide Post
Donald,

There is some residual effects from the FTOA that you need to deal with. The FTOA function leaves leading blanks in the value. If you look at the source code of the report results you will see all the spaces.

Here is some code that eliminates the blanks and adds the right justification for the INPUT box. My original suggestion for adding align=right was incorrect.

DEFINE FILE CAR
ALPHA_FCT/A30 = FTOA(RETAIL_COST, '(D20)', ALPHA_FCT);
LEFTJ_FCT/A30 = LJUST(30,ALPHA_FCT,'A30');
INFLD/A255='<INPUT type="text" value="' || (LEFTJ_FCT || '" name="SALESTEXT" style="text-align:right">');
END
TABLE FILE CAR
PRINT CAR INFLD
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Gold member
posted Hide Post
I know I'm jumping in a little late, but this concept intrigued me and I decided to see if I could bring this a step further and make things update dynamically within the report according to user input using some simple javascript. Here is what I came up with. I don't know if it is useful for anyone but, I found it interesting.

Eric
 DEFINE FILE CAR
RETAIL/A16=FTOA(RETAIL_COST,'(D12CM)',RETAIL);
END
TABLE FILE CAR
PRINT
-* INFLD
 COMPUTE CNT/I4=CNT+1;
 COMPUTE RETAIL_COST/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | ' value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE REBATE/A255='<INPUT id=rebate' | EDIT(CNT) | ' value="" onChange=projectFuture("' | EDIT(CNT) | '")>'; AS 'Rebate %'
 COMPUTE MULT_INFLD/A255='<span id=infld' | EDIT(CNT) | '>calculation</span>';
 BY CAR
END
-HTMLFORM BEGIN
<HTML>
<head>
<SCRIPT>
function projectFuture(num)
{
var costName='cost' + num;
var rebateName='rebate' + num;
var newCost=document.getElementById(costName).value * ((100 - document.getElementById(rebateName).value) / 100);
var idName='infld' + num;
document.getElementById(idName).firstChild.nodeValue=newCost;
}
</SCRIPT>
</HEAD>
-HTMLFORM END 


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
 
Posts: 95 | Registered: July 31, 2007Report This Post
Platinum Member
posted Hide Post
WOW,this is interesting... The users acually want 12 text boxes where they can input a 12 month forecast and then start changing some numbers to see what that does to the total..After going to summit this year I thought I was ready for anything but this had me stuck until now.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Expert
posted Hide Post
That's great Eric, I can't wit till I need it...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
I need to save those values in the text box and send to someone for review. When I save the cars report with the javascript logic for calculations it opens with a blank text box instead of the value that was put into the text box.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Platinum Member
posted Hide Post
I still need someone to chime in on this..Is there a way to save this report with the calculated values?


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Master
posted Hide Post
I think you are going to have to treat it like an input screen and write it to a file. You will need to incorporate a save button into the report.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
Can you give me an example using this cars report?

 DEFINE FILE CAR
RETAIL/A16=FTOA(RETAIL_COST,'(D12CM)',RETAIL);
END
TABLE FILE CAR
PRINT
-* INFLD
 COMPUTE CNT/I4=CNT+1;
 COMPUTE RETAIL_COST1/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_1 value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE RETAIL_COST2/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_2 value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE RETAIL_COST3/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_3 value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE REBATE/A255='<INPUT id=rebate' | EDIT(CNT) | ' value="" onChange=projectFuture("' | EDIT(CNT) | '")>'; AS 'Rebate %'
 COMPUTE MULT_INFLD/A255='<span id=infld' | EDIT(CNT) | '>calculation</span>';
 BY CAR
END
-HTMLFORM BEGIN
<HTML>
<head>
<SCRIPT>
function projectFuture(num)
{
for (i=1; i<4; i++)
{
 var costName='cost' + num + '_'+i;
 var rebateName='rebate' + num;
 var newCost=document.getElementById(costName).value * ((100 - document.getElementById(rebateName).value) / 100);
 var idName='infld' + num;
}
document.getElementById(idName).firstChild.nodeValue=newCost;
}
</SCRIPT>
</HEAD>
-HTMLFORM END
 


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Expert
posted Hide Post
Donald, try this out.

I called the fex FP_DB_UPDATE

You will have to code the modify to do the update, and also pass back any key values.

-DEFAULT &PART='FORM';

-GOTO PGM_&PART

-PGM_UPDATE

-? &

-EXIT

-PGM_FORM
DEFINE FILE CAR
RETAIL/A16=FTOA(RETAIL_COST,'(D12CM)',RETAIL);
END
TABLE FILE CAR
PRINT
-* INFLD
 COMPUTE CNT/I4=CNT+1;
 COMPUTE RETAIL_COST1/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_1 name=cost' | EDIT(CNT) | '_1 value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE RETAIL_COST2/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_2 name=cost' | EDIT(CNT) | '_2 value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE RETAIL_COST3/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_3 name=cost' | EDIT(CNT) | '_3 value=' | EDIT(RETAIL_COST) | '>';
 COMPUTE REBATE/A255='<INPUT type=text id=rebate' | EDIT(CNT) | ' name=rebate' | EDIT(CNT) | ' value="" onChange=projectFuture("' | EDIT(CNT) | '")>'; AS 'Rebate %'
 COMPUTE MULT_INFLD/A255='<span id=infld' | EDIT(CNT) | '>calculation</span><INPUT type=hidden id=outfld' | EDIT(CNT) | ' name=outfld' | EDIT(CNT) | ' value="")>';
 BY CAR
ON TABLE HOLD AS RPT FORMAT HTMTABLE
END

-RUN

-HTMLFORM BEGIN
<HTML>
<head>
<SCRIPT>
function projectFuture(num)
{
for (i=1; i<4; i++)
{
 var costName='cost' + num + '_'+i;
 var rebateName='rebate' + num;
 var newCost=document.getElementById(costName).value * ((100 - document.getElementById(rebateName).value) / 100);
 var idName='infld' + num;
 var outName='outfld' + num;
}
document.getElementById(idName).firstChild.nodeValue=newCost;
document.getElementById(outName).value=newCost;
}
</SCRIPT>
</HEAD>
<body>
<form action="/ibi_apps/WFServlet" method="get">
<input type="hidden" name="IBIF_ex" value="FP_DB_UPDATE">
<input type="hidden" name="PART" value="UPDATE">
!IBI.FIL.RPT;
<br>
<input type="submit">
</form>
</body>
</html>
-HTMLFORM END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Thanks for responding, I was starting to get worried that nobody could help with this one. I am not trying to save the values to a database,the users will be in a hotel plugging in values and then saving it to their local drive for later review. When they open the saved report they need to still see the values they put into the text box.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Gold member
posted Hide Post
If they want to save it to their local computers, why not just dump it into excel? you could always create a blank field and write your formula into the compute so that they don't need to worry about it. But if they want to be able to save and work with it locally, that would be the way I would go.


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
 
Posts: 95 | Registered: July 31, 2007Report 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] text box in a fex

Copyright © 1996-2020 Information Builders