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] Default dropdown to current user id

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Default dropdown to current user id
 Login/Join
 
Gold member
posted
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.
 
Posts: 59 | Registered: June 18, 2009Report This Post
Expert
posted Hide Post
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?


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
Virtuoso
posted Hide Post
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.

Regards,
-Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
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:

.
.
-MRNOEDIT -INCLUDE HTML_RPTYEAR
.
.
-HTMLBEGIN
<HTML>
.
.
<FORM ....
.
<BODY ....
.
<TABLE ....
.
.
 <tr
    <td align="left">
       <select size="1" name="RPTYEAR"
          onChange='runlaunch()'
          onFocus='window.status="Choose a Report Year"'
          onBlur='window.status="Press Submit to run report"'>
        <option value="All">All</option>
        !IBI.FIL.RYHTML;
       </select>
    </td>
 </tr>
.
.
</TABLE>
</FORM>
</BODY>
</HTML>
-HTMLFORM END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Amber,

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
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 Eeker

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, 2004Report This Post
Expert
posted Hide Post
.... and just because it's Friday Smiler, 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, 2004Report This Post
Gold member
posted Hide Post
Great!!
Thank you all for your help!


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
 
Posts: 59 | Registered: June 18, 2009Report 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] Default dropdown to current user id

Copyright © 1996-2020 Information Builders