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] Java code in the HTML Painter - WF717, Windows XP Operating System

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Java code in the HTML Painter - WF717, Windows XP Operating System
 Login/Join
 
Gold member
posted
I created a list box in the html painter that has only two values, a Y or an N. The list box should only be enabled if any one of six customer ids (example: 9999999900) are entered into another box on the form that has the name IDEnter in the Properties window. The value for the IDEnter box says Enter an ID in the Properties window. The IDEnter box is where the user types in the customer id, such as 9999999900. The name of the list box is lstnatl. I came up with the following pasted code that doesn't work. I'm thinking that I do need to do an if then else logic. Does anyone know the correct Java code? Thanks.

< !--National flag validation--MBrooks-->
if (document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999900')
{
document.hmirform.lstnatl.disabled=true;
}
else
{
document.hmirform.lstnatl.disabled=false;
}
}

This message has been edited. Last edited by: Kerry,
 
Posts: 70 | Registered: April 04, 2007Report This Post
Virtuoso
posted Hide Post
Michele,

Your piece of Javascript code (not Java) seems OK but it does nothing unless you "attach" it to a specific event. If you need that piece of code to run right after the value of IDEnter is changed by the user, then you need to say so in the IDEnter definition itself. Something like:

<input type="text" id="IDEnter" onchange="checkStatus();" />


Your sample code could then be defined as a Javascript function at the beginning of your HTML document:

<script type="text/javascript">
function checkStatus() {
// Paste your code here!
}
</script>


Mind you, the technique illustrated is the standard behaviour and shows the connection with a "regular" HTML document and Javascript. When using the Layout Painter, there are some extra Javascript and XML definitions that get added to the HTML document by the tool as they are needed to automate their functionality thus making the document not so "regular" anymore. You need to be careful as to where to plug your Javascript function and which event needs to be adjusted.

Perhaps someone with more experience in the Layout Painter tools might be able to give more useful hints.



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
Gold member
posted Hide Post
Your reply was exactly what I was looking for. I do however have an additional question. There is already an INPUT statement in the html code that reads as follows:
<INPUT id=enter style="LEFT: 10px; WIDTH: 200px; POSITION: absolute; TOP: 400px" onfocus=select[) tabIndex=10 value="Enter an ID" name=IDEnter> 

How would I incorporate the INPUT statement you put in your reply? Thanks a million!!!!!!!!!!!!!1
 
Posts: 70 | Registered: April 04, 2007Report This Post
Gold member
posted Hide Post
Your one of the best. The code you sent me works fine. One last question. I need to enable five additional customer ids in addition to the 9999999900 id. How do I incorporate the additional five customer ids into the logic? I tried the following logic, but it does not work. Thanks a million!!!
<!--National flag validation--MBrooks-->
if (document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999900')
     document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999990')
     document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999991')
     document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999992')
     document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999993')
     document.hmirform.IDEnter.value=='Enter an ID' || document.hmirform.IDEnter.value=='9999999994')    
{
document.hmirform.lstnatl.disabled=false;
}
else
{
document.hmirform.lstnatl.disabled=true;
    }
}
 
Posts: 70 | Registered: April 04, 2007Report This Post
Gold member
posted Hide Post
njsden, thanks for the javascript sample code. I found out was I was doing wrong and was finally able to add additional customer ids into my 'if then else' statements and got the code to work. Disregard my previous two messages.


This case can be closed!!!!!!!!!!!!!!!!!!!!11
 
Posts: 70 | Registered: April 04, 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] Java code in the HTML Painter - WF717, Windows XP Operating System

Copyright © 1996-2020 Information Builders