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.
I have an an html page, currently, with two procedures. Controlled by a drop down with user id's. (passing value of drop down to amper in procedures). I need for the procedures to default to the current user. I have tried doing a -DEFAULT in the individual procedures. This works for them, individually, but on the html, control is by the drop down. Which is defaulting to ALL.
I have a XML procedure populating the drop down. I'm thinking I need this procedure to default to whomever is signed on, but still list the other values.
Any ideas?This message has been edited. Last edited by: Kerry,
WebFOCUS 768 OS/400 HTML, also quite a few active reports and excel.
I haven't tried this so don't know if it would work. Can you put a GETUSER in your load procedure and match the results of that to your userid file. If an entry matches, make it be first in the list followed by the rest of the ids?
I've worked a little example using the CAR table implementing Ginny's suggestion:
-DEFAULT &MYCOUNTRY = 'JAPAN';
DEFINE FILE CAR
SORT_SQ/I2 = IF COUNTRY EQ '&MYCOUNTRY' THEN 0 ELSE 1;
END
TABLE FILE CAR
PRINT
CAR
BY SORT_SQ NOPRINT
BY COUNTRY
ON TABLE PCHOLD FORMAT XML
END
You'll get a list of values ordered alphabetically by country except for the one that matches your choice (&MYCOUNTRY) which, if found, will appear first in the list.
Since you are using XML to populate the dropdown list, I don't know if this will be useful. But maybe it can be more food for thought.
We often use -MRNOEDIT -INCLUDE to call common procedures at the top (before the -HTMLBEGIN) of our HTML launch pages to populate standard dropdown lists. These common procedures will extract the necessary data for the dropdown list and then use code similar to the following (HTML_RPTYEAR.fex) to generate the HTML code for the dropdown and set the default value to an existing value. The current value of variable &RPTYEAR, whether by default or as previously chosen by the user, is "selected" as the default for the generated HTML code.
-DEFAULT &RPTYEAR = &DATEYY
-*
DEFINE FILE <filename>
RYOPTION/A50 = IF (RPT_YEAR EQ '&RPTYEAR')
THEN ('<option selected value="' | RPT_YEAR || '">' || RPT_YEAR || '</option>')
ELSE ('<option value="' | RPT_YEAR || '">' || RPT_YEAR || '</option>');
END
-*
TABLE FILE <filename>
PRINT RYOPTION
BY RPT_YEAR NOPRINT
ON TABLE SAVE AS RYHTML
END
The launch page uses the HTML code generated above to populate the dropdown list for report year:
If you're using Dev Studio HTML Layout Painter, this might be easy.
You already have the User ID. Simply add the JS function called "onInitialUpdate()" to the code (as per instructions within the html code generated by HTML Layout Painter), and JS to select the User Id from the drop-down.
for (var i = 0; i < SelectObject.length; i++)
{
if (SelectObject[i].value == TextValue)
{
SelectObject.selectedIndex = i;
break;
}
}
This is old-fashioned JS code, there may be better examples out there.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
If you think about this logically then you will see that Neftali's Ginny's suggestion will suit you completely(?)
When your fex is called to create the XML return file, the fex is executed using the current users credentials so all you have to do in your fex is to capture the user id (using GETUSER or CNCTUSER) and then apply Ginny's / Neftali's logic to ensure that the userid is at the top of the list.
Also, set the "addalloption" attribute to 0 if you use the editor,
or
in HTML painter, select the combo box and then in the properties dialogue click the parameters tab, then deselect the Add "ALL" option.
T
Edited to correctly attribute the original suggestion by Ginny This message has been edited. Last edited by: Tony A,
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, 2004
.... and just because it's Friday , here's an example -
APP PREPENDPATH IBISAMP
FILEDEF USERLIST DISK USERLIST.FTM (APPEND
-SET &Userid = GETUSER('A25');
-RUN
-WRITE USERLIST &Userid
TABLE FILE BROKERS
BY BROKER_NAME
ON TABLE HOLD AS USERLIST FORMAT ALPHA
END
DEFINE FILE USERLIST
SORT_ORD/I1 = IF BROKER_NAME EQ '&Userid' THEN 0 ELSE 1;
END
TABLE FILE USERLIST
SUM FST.BROKER_NAME
BY SORT_ORD NOPRINT
BY BROKER_NAME
ON TABLE PCHOLD FORMAT XML
END
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, 2004