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     [CASE-OPENED] Want to change event trigger for a chain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE-OPENED] Want to change event trigger for a chain
 Login/Join
 
Guru
posted
Hi,

I'm chaining a dropdown list control to a listbox control. I don't want the listbox control to update on the onChange event of the dropdown list control. I want the listbox control to update when the user clicks a button.

This is the code for the button I found in some other post...
//Begin function button1_onclick
function button1_onclick(ctrl) {
var obj = document.getElementById('listbox1');
populateDynamicCtrl(obj);
}
//End function button1_onclick
</SCRIPT>


I get an 'object expected' error.

What am I missing?

Thanks!

Dan

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


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Guru
posted Hide Post
It looks like the populateDynamicCtrl function is in ibirls2.js. I looked at ibirls3.js and it would appear that the function is now called doPopulateDynamicControls().

I changed my code and the 'object expected' error went away but my listbox control never did change values.

I'm doing something a bit unusual with the fexes that populate my controls. Perhaps that is where the problem lies. Although, when I have them chained in the Composer they work properly.

Anyway, here is the code for my dropdown list control
CHECK FILE CAR HOLD
TABLE FILE HOLD
SUM FST.FIELDNAME
BY FIELDNAME
ON TABLE PCHOLD FORMAT XML
END


Here is the code for the listbox control
SET ASNAMES = ON
-DEFAULT &FIELDNAME = 'CAR'
TABLE FILE CAR
SUM &FIELDNAME AS VALUES
BY  &FIELDNAME AS VALUES
ON TABLE PCHOLD FORMAT XML
END


Any thoughts?

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Gold member
posted Hide Post
I am having a simlar issue in 7.6.9. I am not getting the error Dan describes, but populateDynamicControl seems to have no affect.

H_YEAR_ACCT is a hidden control that is chained to a list box. It is populated when ever the user changes ComboBox22.

The reason I am not chaining combobox22 directly is because it would need to chain to as many as seven other controls which I believe would present issues. So instead whenever combobox22 changes, its value will populate other hidden controls which are chained individually to separate controls.

Code snippets:

The following code remaps the onchange event which does not fire in 7.6.9.
---------------
//Begin function combobox22_onclick
function combobox22_onclick(ctrl) {
//To Remap onchange Event
combobox22.onchange=combobox22_onchange;

}
//End function combobox22_onclick
---------------

The following code assigns the changed value to the hidden control H_YEAR_ACCT. It attempts to repopulate listbox 'customselect1_selectfrom' which is chained to the hidden control.
----------
//Begin function combobox22_onchange
function combobox22_onchange(ctrl) {

H_YEAR_ACCT.value = combobox22.value;
myctrl = document.getElementById('customselect1_selectfrom');
//alert (H_YEAR_ACCT.value)
populateDynamicCtrl(myctrl);
alert (H_YEAR_ACCT.value)
}
//End function combobox22_onchange

---------

I determined that it is executing the code up to the PopulateDynamicCtrl through theh alert which is commented out. The alert following that statement never gets executed which indicates that the populateDynamicCtrl is failing. I tried doPopulateDynamicCtrl and same thing.

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


WebFOCUS 769
Windows
all
 
Posts: 53 | Registered: April 29, 2009Report This Post
Guru
posted Hide Post
I have a case open on this. I'll update when I learn something.


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Gold member
posted Hide Post
I have found a resolution for my issue.

I rplaced the populateDynamicCtrl call with the following code I found on the forum to simulate the onchange event. I also switched from using a hidden textbox to a visible text box to chain. I will hide it behind a form tab. And my controls are now chaining!

My onchange function for the user input control now looks like this

//Begin function combobox22_onchange
function combobox22_onchange(ctrl) {

P_YEAR_ACCT.value = combobox22.value;
myctrl = document.getElementById("P_YEAR_ACCT");
var evt = document.createEventObject();
myctrl.fireEvent('onchange',evt);

}
//End function combobox22_onchange

This may help with your issue if you replace that code. And make sure that listbox1 is both the name and the unique identifier for that control.

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


WebFOCUS 769
Windows
all
 
Posts: 53 | Registered: April 29, 2009Report This Post
Guru
posted Hide Post
knegrotto,

Thanks for this tip. Let me see if I understand what you are doing.

When the onchange event occurs for combobox22 you are setting the value of P_YEAR_ACCT to the same value as the one selected in combobox22.

Then you fire the onchange event for P_YEAR_ACCT which is chained (using the GUI) to some other controls that are triggered as part of the chain.

Is that right?

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Gold member
posted Hide Post
Yes. I read lots of posts and finally found this which is working for me. I am trying to implement "1-To_many" chaining and it has been a challenge.

I am receiving messages upon load of the form indicating a problem with populating the chained controls. EX: "Error retrieving data for customselect1". But then the issue must resolve itself because the controls populate and are properly chained (data is limted as expected).

I would like to get rid of the message and may post that issue later. But for now I am proceeding.

Hope this helps.


WebFOCUS 769
Windows
all
 
Posts: 53 | Registered: April 29, 2009Report This Post
Guru
posted Hide Post
It's not working for me but I think that's because I have a different goal. I want the onchange event from combobox1 to do nothing. I only want listbox1 to re-populate when a button is pressed.

In your case you are still triggering the onchange event. Only you are doing it on the hidden control.

I tried breaking it into two steps. For combobox1_onchange I passed the selected value to combobox2. Then, when the button is clicked I triggered combobox2_onchange. This should cause listbox1 to populate but it is not.

I'll keep trying...


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Gold member
posted Hide Post
Are you sure that the onchange of combobox1 is firing? There is a Webfocus bug where the onchange event is ignored. I use the following code to remap the onchange event in the onclick event (also from the forum). You can place alert in the code to make sure it is firing.

//Begin function combobox22_onclick
function combobox22_onclick(ctrl) {
//To Remap onchange Event
combobox22.onchange=combobox22_onchange;


WebFOCUS 769
Windows
all
 
Posts: 53 | Registered: April 29, 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     [CASE-OPENED] Want to change event trigger for a chain

Copyright © 1996-2020 Information Builders