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     CHANGING AND REPOITIONING CONTROLS IN RESOURCE LAYOUT

Read-Only Read-Only Topic
Go
Search
Notify
Tools
CHANGING AND REPOITIONING CONTROLS IN RESOURCE LAYOUT
 Login/Join
 
Platinum Member
posted
I want to add a feature to my report to add user specified where clauses( user wants 7 where clauses). I want to :

First user selects a column name from combo box
second user selects relation from combo box

then
1. enter text from a text box or
2. change the control type to a combo box( i don't know to do this) and load a file of options ( I know how to do this)
3. if the column is a date display the calendar tool and reposition it ( i don't know to do this) finally load the text box with the output of a calendar tool.

Since there are seven I wanted to reuse the same date control. Is this logical in this language?

This message has been edited. Last edited by: secret,
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Secret,

I tend to use JavaScript to create controls on the fly as required by the value of a controls event. The basic process is -

// First remove the control if it already exists on the form
       var RemCtrl = document.getElementById("control_id");
       if (RemCtrl) {
         document.form.removeChild(RemCtrl);
       }
       var NewCtrl = document.createElement("select");
       NewCtrl.setAttribute("id", "control_id");
       NewCtrl.setAttribute("name", "wf_variable_name");
       NewCtrl.setAttribute("elementname", "combobox1");
       NewCtrl.setAttribute("elementtype", "combobox");
       NewCtrl.setAttribute("sourcetype", "typeFex");
       NewCtrl.setAttribute("operation", "NONE");
       NewCtrl.setAttribute("datatype", "1");
       NewCtrl.setAttribute("addalloption", "1");
       NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
       NewCtrl.setAttribute("inchainindex", "-1");
       NewCtrl.setAttribute("chainnumber", "-1");
       NewCtrl.setAttribute("cacheruntimedata", "0");
       NewCtrl.setAttribute("displayfield", "");
       NewCtrl.setAttribute("datafield", "");
       NewCtrl.setAttribute("numofrecords", "-1");
       NewCtrl.setAttribute("datasource", "your_select_list.fex");
       NewCtrl.setAttribute("datafieldtype", "CHAR");
       NewCtrl.setAttribute("ibiformat", "");
       NewCtrl.setAttribute("IBIAPP_app", "your_app_folder");
       NewCtrl.setAttribute("IBIC_server", "EDASERVE");
       NewCtrl.style.position='absolute';
       NewCtrl.style.top = 110;
       NewCtrl.style.left = 515;
       NewCtrl.style.width = 145;
       NewCtrl.style.height = 20;
       document.form.appendChild(NewCtrl);
// Once your control has been added to your form you can call IBs routine to load it
// from a fex or master according the the controls sourcetype attribute.
       populateDynamicCtrl(NewCtrl);


You can use this sort of code to create any type of control on your form, although this example is specifically for a Combo box so just adjust it to create your INPUT (text box), calendar control or any other you might want.

Once you get your head around this it becomes easier to understand.

Good luck

T

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
Platinum Member
posted Hide Post
Tony:

Where are all these attributes documented?

I got it to remove the element and re add it.
My code wanted 'body' instead of 'form'?

I am now trying to load the new element and all the naming is unclear.


("datasource", "your_select_list.fex");
i HAVE OCDE THAT LOADS FROM A HIIDEN LABEL, CAN THIS BE DISABLE?

Thank you very much

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Bob,

Where I use this code the name of the form is "form". With the recent movements in the way IB builds the HTML in the painter a form is not always present and so substituting body should be fine.

All the attributes are those that are written out by the HTML painter within version 5.3.2 and, as far as I know, are not documented anywhere. I have found out what most of them are used for by reading the IB JavaScript ibirls.js (sad, I know). I do not have any documentation on them and what I know resides in my head, also I have no plans to create a document.

Finally, I am not sure what you mean when regarding loading your code from a hidden label, can you expand on this?

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
Tony:

I had code that loaded combo boxes from internal tables like:
< !-- Option list 1 hidden -->
< !-- Option list 2 hidden -->
< !-- Option list 2 hidden -->



   


code to load:

function populate(id, fileid) {
var selobj = document.getElementById(id) ;
var fidobj = document.getElementById(fileid) ;
selobj.length = 0 ;
for (var i=0; i selobj.options[i] = new Option(fidobj[i].text,fidobj[i].value);
}


Any wayI was hoping to use a similar method to laoad my new combo box.
But I havent debugged it yet. Since I dont know what all the attributes mean. But your code example was very helpful, I'll figure it out sooner or later.

I was trying to load edit11 using the populate code above. which is what i deleted and recreated . Here is the code i used:

var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "control_id");
NewCtrl.setAttribute("name", "wf_variable_name");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "combobox");
NewCtrl.setAttribute("sourcetype", "typeFex");
NewCtrl.setAttribute("operation", "NONE");
NewCtrl.setAttribute("datatype", "1");
NewCtrl.setAttribute("addalloption", "1");
NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
NewCtrl.setAttribute("inchainindex", "-1");
NewCtrl.setAttribute("chainnumber", "-1");
NewCtrl.setAttribute("cacheruntimedata", "0");
NewCtrl.setAttribute("displayfield", "");
NewCtrl.setAttribute("datafield", "");
NewCtrl.setAttribute("numofrecords", "-1");
NewCtrl.setAttribute("datasource", "your_select_list.fex");
NewCtrl.setAttribute("datafieldtype", "CHAR");
NewCtrl.setAttribute("ibiformat", "");
NewCtrl.setAttribute("IBIAPP_app", "bob");
NewCtrl.setAttribute("IBIC_server", "EDASERVE");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);

populate(NewCtrl,'optrela')

Thnk you very muchb


Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Hi Bob,

You're welcome.

I see what you mean now, you are loading the options from an internal array that you already have set up?

If this is the case then all you need to do is replace the various attributes with those that you would normally want for your combo. The ones I have included are those that are present when you create a combo within the HTML painter in version 5.3.2.

The reason I use these attributes are for conformity with other combos already in use and the fact that I then use IB's js modules to populate the combo using a fex that I already have set up (why reinvent the wheel?).

Good luck with the code.

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
Tony:

I am now attempting to use your dynamic populate routine. It creates the new combo and seems to put about twenty blank lines in it

Is anything obviosly wrong?

How is the fex communicated to the control?

the IBI.fil technique uses a ddname, I don't see that in any of the attributes.

Here is my fex bob22.fex in the bob app folder.

(this is the same output that loaded the first listbox using the !ibi.fil.bob22 technique)
APP HOLD BOB
FILEDEF SELRELA DISK C:\IBI\APPS\BOB\SEL_REL_A.TXT
FILEDEF SELRELN DISK C:\IBI\APPS\BOB\SEL_REL_N.TXT
FILEDEF SELRELD DISK C:\IBI\APPS\BOB\SEL_REL_D.TXT
CHECK FILE V_REPORT1 HOLD

DEFINE FILE HOLD
TYPE1/A1=IF FORMAT EQ 'HYYMDs' THEN 'D'
ELSE IF EDIT(FORMAT,'9$') EQ 'A' THEN 'A' ELSE 'N' ;
FILEL/A8=IF FORMAT EQ 'HYYMDs' THEN ' '
ELSE IF EDIT(FORMAT,'9$') EQ 'A' THEN 'DUMMY' ELSE ' ' ;
LFIELDNAME/A66=LOCASE(66, FIELDNAME, LFIELDNAME);

MYMODEL/A180=
'' ;
END

TABLE FILE HOLD
PRINT MYMODEL
ON TABLE SAVE AS BOB22 FORMAT ALPHA
END


Here is my Javascript"

function edit6_onchange(ctrl) {
alert("the value is")
document.getElementById('edit11').disabled=false;
var RemCtrl = document.getElementById('edit11');
if (RemCtrl) {
alert("RemCtrl value is" + RemCtrl)
document.body.removeChild(RemCtrl);
}

var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "control_id");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "combobox");
NewCtrl.setAttribute("sourcetype", "typeFex");
NewCtrl.setAttribute("operation", "NONE");
NewCtrl.setAttribute("datatype", "1");
NewCtrl.setAttribute("addalloption", "1");
NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
NewCtrl.setAttribute("inchainindex", "-1");
NewCtrl.setAttribute("chainnumber", "-1");
NewCtrl.setAttribute("cacheruntimedata", "0");
NewCtrl.setAttribute("displayfield", "");
NewCtrl.setAttribute("datafield", "");
NewCtrl.setAttribute("numofrecords", "-1");
NewCtrl.setAttribute("datasource", "bob22.fex");
NewCtrl.setAttribute("datafieldtype", "CHAR");
NewCtrl.setAttribute("ibiformat", "");
NewCtrl.setAttribute("IBIAPP_app", "bob");
NewCtrl.setAttribute("IBIC_server", "EDASERVE");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);

populateDynamicCtrl(NewCtrl);
}
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Hi Bob,

Just had a look through your previous code and made sure I understood what you are trying to achieve. Which is, I believe, to create a control called "edit11" and then popoulate it?

It this is the case then you could probably get away with just using this code :
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "wf_variable_name");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
// Don't use the height especially if you are using a multiple select
NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);

populate(NewCtrl,'optrela')


This would give rise to a dynamic control (although you might not require the style.height - see above) :
<select id="edit11" name="wf_variable_name"
style="position:absolute; top:110; left:515; width:145; height:20;"></select>
This is because all the other attributes are used internally by IB's JavaScript and are not being used by your code?

You might also want to add an event to your control, and if you do you may have problems as the general wish is to just add an event via "attachEvent". Unfortuantely, I don't think you can do this so I resort to adding the event by calling a function using this type of code :
// Add an event handler to the new control using a seperate function
       NewCtrl.attachEvent("onchange", createSelects);

// This function adds an event handler to a control
    function createSelects() {
// You can use this to identify the control to which you are adding the event
       this.displayElement = window.event.srcElement;
// just put your onChange event here - parameterised of course!!
       your_function_name(parm1, parm2, .....);
    }


Hope this helps

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
Tony:

Thank you again for your asssistance:

I am still getting the same result.

The HTML i am using was originally created by resource layout painter (RSP). this is my first attempt at both resource layout and java script.

One of the select was created by RSP as:


Comparison



this control (edit 6) was loaded by the populate function.
Are some of these attributes necesary?

Another question: the first technique you sent me using a fex to load the control
what is the output of the fex supposed to look like?


Thank you

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Platinum Member
posted Hide Post
Tony:

I think I got you techniche working.

Thank you very much

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Bob,

Your main problem is that you refer to your control as edit11 but you haven't changed the dynamic control's id from "control_id". this will need to be "edit11" as you refer to this using document.getElementById('edit11');. That is why your old control is removed but the new one is not populated.

If you want to let the internals of IB's JavaScript do all the dirty work for you via populateDynamicCtrl(NewCtrl); then you need to have your fex creating a two column report in XML format. The ibirls.js module will run this using activex and interpret the XML columns annotated C0 and C1 placing the C0 value in the value and the C1 in the display of the combo. The attributes are used to determine items such as whether an ALL option is added to the control, and if so, what text should be displayed etc. One attribute you will require to retain for this is the datatype and this must be equal to 1.

I remembered that I did write a (sort of) text showing what the attributes were, and you can find them on this post.

I'll write more when time allows.

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
Tony:

I have the remove and recreate and load of the combobox with XML working now. The dialogue manaager variable is not being returned. I set the name attribute to VAL1 which is what is was before.

this is the code that create the xml file.

APP HOLD BOB

TABLE FILE V_REPORT1
SUM PRODUCT_DESC BY PRODUCT_DESC
ON TABLE PCHOLD FORMAT XML
END

Is ther something else that must be set?

VAL1 is returned if i don't execute the drop and recreate code.

the name is set as follows"
NewCtrl.setAttribute("name", "VAL1");

Any ideas?

Thank you very much

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Bob,

If the control is being populated from the XML hold file then the fex is OK.

As to the VAL1 variable not being passed, I do not know. Is there an onsubmit event trigger mentioned in the FORM tag? I have seen previous RLP code specifying each variable to be passed. Not sure if that is your problem without seeing more of the code though.

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
Tony:

I have 2 problems.

1. the value of VAL1 is not set after I drop and recreate the control edit11 as a combobox. edit 11 returns val1 to the focus cade if it is left as a text input control. The code is shown below. see code sample1

note that i display the correct values in function displayValues

2. when i drop and recreate the control edit 11 as a calendar it displays as a list box Not a calendar. see code sample 2 if I change the
document.createElement("select"); to document.createElement("INPUT");
it creates a text box. I tried this since that is what RLP create s in the simplest case.

3. i have uinclderd the hwole html file as cod sample 3


Thank you far any assistance you can provide

bob
-------------------------------------------------------------------------------
code sample1 - val1 problem
-------------------------------------------------------------------------------

function DropAndChangeType (id) {

var selobj = document.getElementById(id) ;
var olpparm =selobj.getAttribute("name");
alert ("the parm is " + olpparm);
var RemCtrl = document.getElementById(id);
if (RemCtrl) {
document.body.removeChild(RemCtrl);
}
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "combobox");
NewCtrl.setAttribute("sourcetype", "typeFex");
NewCtrl.setAttribute("operation", "NONE");
NewCtrl.setAttribute("datatype", "1");
NewCtrl.setAttribute("addalloption", "1");
NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
NewCtrl.setAttribute("inchainindex", "-1");
NewCtrl.setAttribute("chainnumber", "-1");
NewCtrl.setAttribute("cacheruntimedata", "0");
NewCtrl.setAttribute("displayfield", "");
NewCtrl.setAttribute("datafield", "");
NewCtrl.setAttribute("multiple","");
NewCtrl.setAttribute("numofrecords", "-1");
NewCtrl.setAttribute("datasource", "bob22.fex");
NewCtrl.setAttribute("datafieldtype", "CHAR");
NewCtrl.setAttribute("ibiformat", "");
NewCtrl.setAttribute("IBIAPP_app", "bob");
NewCtrl.setAttribute("IBIC_server", "EDASERVE");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
NewCtrl.attachEvent("onchange", displayValues);

document.body.appendChild(NewCtrl);

populateDynamicCtrl(NewCtrl);
}
function displayValues (ctrl) {
var selobj1 = document.getElementById('edit11');
var i = document.getElementById('edit11').selectedIndex;
alert("the value is" + " " + selobj1[i].value);
alert("the text is" + " " + selobj1[i].text);
}
-------------------------------------------------------------------------------
code sample2 - calendar problem
-------------------------------------------------------------------------------
function DropAndChangeDate (id) {

var selobj = document.getElementById(id) ;
var olpparm =selobj.getAttribute("name");
alert ("the date parm is " + olpparm);
var RemCtrl = document.getElementById(id);
if (RemCtrl) {
document.body.removeChild(RemCtrl);
}
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "14");
NewCtrl.setAttribute("calendardata", "0/0/-10;0/0/10");
NewCtrl.setAttribute("calendardatatype","1");
NewCtrl.setAttribute("ibiformat","YMD");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);


}

-------------------------------------------------------------------------------
code sample3 - the whole html file cust1
-------------------------------------------------------------------------------
 < !-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<TITLE>HtmlPage
</TITLE>
<BASE href=HTTP://localhost:8080>
<script id=clientEventHandlersJS type=text/javascript>
function button1_OnClick(ctrl) {
// TODO: add validation code here

 
 
OnExecute(ctrl)
 
}
function populate(id, fileid) {
        var selobj = document.getElementById(id) ;
        var fidobj = document.getElementById(fileid) ;
        selobj.length = 0 ;
        for (var i=0; i<fidobj.length; i++)
          selobj.options[i] = new Option(fidobj[i].text,fidobj[i].value);
      }
 
function report1_onfocus(ctrl) {
 
}
//
function edit1_onchange(ctrl) {
//
document.getElementById('edit6').disabled=false;
var selobj1 = document.getElementById('edit1');
var i = document.getElementById('edit1').selectedIndex;
var reltype = selobj1[i].value.substring(0, 1);
//alert("the value is" +  reltype + " " + selobj1[i].value);
        
 
if (reltype == "A") {
 populate('edit6','optrela')
}  else if (reltype  == "D") {
 populate('edit6','optreld')
}  else {
 populate('edit6','optreln')};
}
//
function window_onload() {
//
 
document.getElementById('edit2').disabled=true;
document.getElementById('edit3').disabled=true;
document.getElementById('edit4').disabled=true;
document.getElementById('edit5').disabled=true;
document.getElementById('edit6').disabled=true;
document.getElementById('edit7').disabled=true;
document.getElementById('edit8').disabled=true;
document.getElementById('edit9').disabled=true;
document.getElementById('edit10').disabled=true;
document.getElementById('edit11').disabled=true;
document.getElementById('edit12').disabled=true;
document.getElementById('edit13').disabled=true;
document.getElementById('edit14').disabled=true;
//document.getElementById('edit15').disabled=true;
}
//
function edit6_onchange(ctrl) {
var selobj1 = document.getElementById('edit1');
var i = document.getElementById('edit1').selectedIndex;
var reltype = selobj1[i].value.substring(0, 1);
//alert("the value is" +  reltype + " " + selobj1[i].value);
        
document.getElementById('edit11').disabled=false;
if (reltype == "A") {
 DropAndChangeType('edit11')
}  else if (reltype  == "D") {
 DropAndChangeDate('edit11')
}  ;
}
 
 
function DropAndChangeType (id) {
 
var selobj = document.getElementById(id) ;
var olpparm  =selobj.getAttribute("name");  
alert ("the parm is " +  olpparm);
var RemCtrl = document.getElementById(id);
       if (RemCtrl) {
           document.body.removeChild(RemCtrl);
       }
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "combobox");
NewCtrl.setAttribute("sourcetype", "typeFex");
NewCtrl.setAttribute("operation", "NONE");
NewCtrl.setAttribute("datatype", "1");
NewCtrl.setAttribute("addalloption", "1");
NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
NewCtrl.setAttribute("inchainindex", "-1");
NewCtrl.setAttribute("chainnumber", "-1");
NewCtrl.setAttribute("cacheruntimedata", "0");
NewCtrl.setAttribute("displayfield", "");
NewCtrl.setAttribute("datafield", "");
NewCtrl.setAttribute("multiple","");
NewCtrl.setAttribute("numofrecords", "-1");
NewCtrl.setAttribute("datasource", "bob22.fex");
NewCtrl.setAttribute("datafieldtype", "CHAR");
NewCtrl.setAttribute("ibiformat", "");
NewCtrl.setAttribute("IBIAPP_app", "bob");
NewCtrl.setAttribute("IBIC_server", "EDASERVE");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
NewCtrl.attachEvent("onchange", displayValues);
 
document.body.appendChild(NewCtrl);
 
populateDynamicCtrl(NewCtrl);
}
function  displayValues (ctrl) {
var selobj1 = document.getElementById('edit11');
var i = document.getElementById('edit11').selectedIndex;
alert("the value is" +  " " + selobj1[i].value);
alert("the text  is" +   " " + selobj1[i].text);
}
function DropAndChangeDate (id) {
 
var selobj = document.getElementById(id) ;
var olpparm  =selobj.getAttribute("name");  
alert ("the date parm is " +  olpparm);
var RemCtrl = document.getElementById(id);
       if (RemCtrl) {
           document.body.removeChild(RemCtrl);
       }
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "14");
NewCtrl.setAttribute("calendardata", "0/0/-10;0/0/10");
NewCtrl.setAttribute("calendardatatype","1");
NewCtrl.setAttribute("ibiformat","YMD"); 
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);
 
 
}
 
 
function edit6_oldchange(ctrl) {
 
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("readOnly","false");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
// Don't use the height especially if you are using a multiple select
//NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);
 
populate(NewCtrl,'optrela')
 
 
}
</SCRIPT>

<script for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>

<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
</HEAD>
<BODY style="OVERFLOW: auto">
<iframe language=javascript id=report1 style="Z-INDEX: 33; LEFT: 20px; WIDTH: 460px; POSITION: absolute; TOP: 290px; HEIGHT: 110px" onfocus=report1_onfocus(this) tabIndex=1 name=report1 align=top scrolling=no elementtype="2" autoExecute="False" requests_list="0" executebuttonId="button1">
</IFRAME>
<SPAN id=text1 style="Z-INDEX: 2; LEFT: 60px; WIDTH: 64px; POSITION: absolute; TOP: 30px; HEIGHT: 16px" tabIndex=2>Field 
</SPAN>
<SELECT language=java_script id=edit1 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 70px" tabIndex=3 onchange=edit1_onchange[this) size=1 name=FLD1 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text1" start="fileopen" readOnly="false" height="92947284" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION> !IBI.FIL.BOB22;
</SELECT> 
<SELECT id=edit2 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 100px" tabIndex=5 size=1 name=FLD2 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text2" start="fileopen" readOnly="false" height="93210308" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit3 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 130px" tabIndex=7 size=1 name=FLD3 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text3" start="fileopen" readOnly="false" height="93328380" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit4 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 160px" tabIndex=9 size=1 name=FLD4 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text4" start="fileopen" readOnly="false" height="93405052" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit5 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 190px" tabIndex=11 size=1 name=FLD5 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text5" start="fileopen" readOnly="false" height="93200132" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SPAN id=text6 style="Z-INDEX: 12; LEFT: 200px; WIDTH: 65px; POSITION: absolute; TOP: 30px; HEIGHT: 16px" tabIndex=12>Comparison 
</SPAN>
<SELECT language=java_script id=edit6 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 70px" tabIndex=13 onchange=edit6_onchange[this) size=1 name=REL1 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text6" start="fileopen" readOnly="false" height="59290532" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit7 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 100px" tabIndex=15 size=1 name=REL2 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text7" start="fileopen" readOnly="false" height="59290612" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit8 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 130px" tabIndex=17 size=1 name=REL3 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text8" start="fileopen" readOnly="false" height="93384500" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit9 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 160px" tabIndex=19 size=1 name=REL4 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text9" start="fileopen" readOnly="false" height="93384580" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit10 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 190px" tabIndex=21 size=1 name=REL5 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text10" start="fileopen" readOnly="false" height="93384660" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<INPUT id=edit11 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 70px" tabIndex=23 hspace=0 accept=0 indeterminate=-1 value=" " name=VAL1 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text11" multiple="false"> 
<SPAN id=text12 style="Z-INDEX: 24; LEFT: 340px; WIDTH: 62px; POSITION: absolute; TOP: 30px; HEIGHT: 16px" tabIndex=24>Value 
</SPAN>
<INPUT id=edit12 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 100px" tabIndex=25 readOnly hspace=0 accept=0 indeterminate=-1 value=" " name=VAL2 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text12" multiple="false"> 
<INPUT id=edit13 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 130px" tabIndex=27 readOnly hspace=0 accept=0 indeterminate=-1 value=" " name=VAL3 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text13" multiple="false"> 
<INPUT id=edit14 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 160px" tabIndex=29 readOnly hspace=0 accept=0 indeterminate=-1 value=" " name=VAL4 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text14" multiple="false"> 
<INPUT id=edit15 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 190px" tabIndex=31 hspace=0 accept=0 indeterminate=-1 value=" " name=VAL5 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text15" multiple="false" ibiformat="YMD" calendardatatype="1" calendardata="0/0/-10;0/0/10"> 
< !-- Option list 1 hidden -->
< !-- Option list 2 hidden -->
< !-- Option list 2 hidden -->
<INPUT language=java_script id=button1 style="Z-INDEX: 32; LEFT: 360px; WIDTH: 120px; POSITION: absolute; TOP: 230px; HEIGHT: 30px" onclick=button1_OnClick[this) tabIndex=32 type=button value="Run report1" name=button1 requests_list="0"> 
<SELECT id=optrela style="DISPLAY: none; LEFT: 85px; POSITION: absolute; TOP: 244px"> !IBI.FIL.SELRELA;
</SELECT> 
<SELECT id=optreld style="DISPLAY: none; LEFT: 140px; POSITION: absolute; TOP: 240px"> !IBI.FIL.SELRELD;
</SELECT> 
<SELECT id=optreln style="DISPLAY: none; LEFT: 190px; POSITION: absolute; TOP: 240px"> !IBI.FIL.SELRELN;
</SELECT>    
<xml id=ibi_requests>
<requests>
	
<request requestid="0" targetname="report1" ibif_ex="report1" targettype="0" sourcetype="typeAdhocfex" ibiapp_app="" paramremovedbyuser="WFFMT">
		
< ![CDATA[-* File custom1.fex
-SET &ECHO='ALL';
-DEFAULT &FLD1='FOC_NONE';
-DEFAULT &FLD2='FOC_NONE';
-DEFAULT &FLD3='FOC_NONE';
-DEFAULT &FLD4='FOC_NONE';
-DEFAULT &FLD5='FOC_NONE';
-DEFAULT &REL1=' ';
-DEFAULT &REL2=' ';
-DEFAULT &REL3=' ';
-DEFAULT &REL4=' ';
-DEFAULT &REL5=' ';
-DEFAULT &VAL1=' ';
-DEFAULT &VAL2=' ';
-DEFAULT &VAL3=' ';
-DEFAULT &VAL4=' ';
-DEFAULT &VAL5=' ';
-DEFAULT &WFFMT='PDF';
-*SET &FLD1 = 'ACCEPTANCEFEE' ;
-*SET &REL1 = 'GE' ;
-*SET &VAL1= 100 ;
-SET &WHERE1= IF &FLD1 NE 'FOC_NONE' THEN 'WHERE ' | &FLD1 | ' ' | &REL1 | ' ' | &VAL1 | ';'  ELSE ' ';
-SET &WHERE2= IF &FLD2 NE 'FOC_NONE' THEN 'WHERE ' | &FLD2 | ' ' | &REL2 | ' ' | &VAL2 | ';'  ELSE ' ';
-SET &WHERE3= IF &FLD3 NE 'FOC_NONE' THEN 'WHERE ' | &FLD3 | ' ' | &REL3 | ' ' | &VAL3 | ';'  ELSE ' ';
-SET &WHERE4= IF &FLD4 NE 'FOC_NONE' THEN 'WHERE ' | &FLD4 | ' ' | &REL4 | ' ' | &VAL4 | ';'  ELSE ' ';
-SET &WHERE5= IF &FLD5 NE 'FOC_NONE' THEN 'WHERE ' | &FLD5 | ' ' | &REL5 | ' ' | &VAL5 | ';'  ELSE ' ';
TABLE FILE V_REPORT1
PRINT *
&WHERE1
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML,HTML>,<PDF,PDF>,<Excel 2000,EXL2K>,<Excel Formula,EXL2K FORMULA>).Select type of display output.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
TOPMARGIN=0.055556,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
RIGHTGAP=0.055556,
LEFTGAP=0.027778,
LINES-PER-PAGE=20,
TARGET=_blank,$
END]]>
		
<variables>
			
<variable field="FLD1" file="v_report1.mas" desc="FLD1" datatype="0" operation="" default="FOC_NONE" name="FLD1" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD2" file="v_report1.mas" desc="FLD2" datatype="0" operation="" default="FOC_NONE" name="FLD2" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD3" file="v_report1.mas" desc="FLD3" datatype="0" operation="" default="FOC_NONE" name="FLD3" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD4" file="v_report1.mas" desc="FLD4" datatype="0" operation="" default="FOC_NONE" name="FLD4" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD5" file="v_report1.mas" desc="FLD5" datatype="0" operation="" default="FOC_NONE" name="FLD5" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL1" file="v_report1.mas" desc="REL1" datatype="0" operation="" default=" " name="REL1" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL2" file="v_report1.mas" desc="REL2" datatype="0" operation="" default=" " name="REL2" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL3" file="v_report1.mas" desc="REL3" datatype="0" operation="" default=" " name="REL3" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL4" file="v_report1.mas" desc="REL4" datatype="0" operation="" default=" " name="REL4" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL5" file="v_report1.mas" desc="REL5" datatype="0" operation="" default=" " name="REL5" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL1" file="v_report1.mas" desc="VAL1" datatype="0" operation="" default=" " name="VAL1" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL2" file="v_report1.mas" desc="VAL2" datatype="0" operation="" default=" " name="VAL2" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL3" file="v_report1.mas" desc="VAL3" datatype="0" operation="" default=" " name="VAL3" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL4" file="v_report1.mas" desc="VAL4" datatype="0" operation="" default=" " name="VAL4" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL5" file="v_report1.mas" desc="VAL5" datatype="0" operation="" default=" " name="VAL5" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="WFFMT" file="v_report1.mas" desc="Select type of display output" datatype="0" operation="" default="PDF" name="WFFMT" accept="0" type="default" select="0" controltype="7">
<value value="HTML" display="HTML"/>
<value value="PDF" display="PDF"/>
<value value="EXL2K" display="Excel 2000"/>
<value value="EXL2K FORMULA" display="Excel Formula"/> 
</variable>
</variables>
	
</request>
</requests>
</xml>
</BODY>
</HTML>

This message has been edited. Last edited by: secret,
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Bob,

You will have to enclose your code using the forum tags of [ code] and [ /code] (without spaces) for us to see it properly.

For info, as an when I get enough time, I am creating an example for you which should help you follow the flow. At the moment it is not passing the variable from the dynamic control!!

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
Here the code


<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<TITLE>HtmlPage
</TITLE>
<BASE href=HTTP://localhost:8080>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
function button1_OnClick(ctrl) {
// TODO: add validation code here

 
 
OnExecute(ctrl)
 
}
function populate(id, fileid) {
        var selobj = document.getElementById(id) ;
        var fidobj = document.getElementById(fileid) ;
        selobj.length = 0 ;
        for (var i=0; i<fidobj.length; i++)
          selobj.options[i] = new Option(fidobj[i].text,fidobj[i].value);
      }
 
function report1_onfocus(ctrl) {
 
}
//
function edit1_onchange(ctrl) {
//
document.getElementById('edit6').disabled=false;
var selobj1 = document.getElementById('edit1');
var i = document.getElementById('edit1').selectedIndex;
var reltype = selobj1[i].value.substring(0, 1);
//alert("the value is" +  reltype + " " + selobj1[i].value);
        
 
if (reltype == "A") {
 populate('edit6','optrela')
}  else if (reltype  == "D") {
 populate('edit6','optreld')
}  else {
 populate('edit6','optreln')};
}
//
function window_onload() {
//
 
document.getElementById('edit2').disabled=true;
document.getElementById('edit3').disabled=true;
document.getElementById('edit4').disabled=true;
document.getElementById('edit5').disabled=true;
document.getElementById('edit6').disabled=true;
document.getElementById('edit7').disabled=true;
document.getElementById('edit8').disabled=true;
document.getElementById('edit9').disabled=true;
document.getElementById('edit10').disabled=true;
document.getElementById('edit11').disabled=true;
document.getElementById('edit12').disabled=true;
document.getElementById('edit13').disabled=true;
document.getElementById('edit14').disabled=true;
//document.getElementById('edit15').disabled=true;
}
//
function edit6_onchange(ctrl) {
var selobj1 = document.getElementById('edit1');
var i = document.getElementById('edit1').selectedIndex;
var reltype = selobj1[i].value.substring(0, 1);
//alert("the value is" +  reltype + " " + selobj1[i].value);
        
document.getElementById('edit11').disabled=false;
if (reltype == "A") {
 DropAndChangeType('edit11')
}  else if (reltype  == "D") {
 DropAndChangeDate('edit11')
}  ;
}
 
 
function DropAndChangeType (id) {
 
var selobj = document.getElementById(id) ;
var olpparm  =selobj.getAttribute("name");  
alert ("the parm is " +  olpparm);
var RemCtrl = document.getElementById(id);
       if (RemCtrl) {
           document.body.removeChild(RemCtrl);
       }
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "combobox");
NewCtrl.setAttribute("sourcetype", "typeFex");
NewCtrl.setAttribute("operation", "NONE");
NewCtrl.setAttribute("datatype", "1");
NewCtrl.setAttribute("addalloption", "1");
NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
NewCtrl.setAttribute("inchainindex", "-1");
NewCtrl.setAttribute("chainnumber", "-1");
NewCtrl.setAttribute("cacheruntimedata", "0");
NewCtrl.setAttribute("displayfield", "");
NewCtrl.setAttribute("datafield", "");
NewCtrl.setAttribute("multiple","");
NewCtrl.setAttribute("numofrecords", "-1");
NewCtrl.setAttribute("datasource", "bob22.fex");
NewCtrl.setAttribute("datafieldtype", "CHAR");
NewCtrl.setAttribute("ibiformat", "");
NewCtrl.setAttribute("IBIAPP_app", "bob");
NewCtrl.setAttribute("IBIC_server", "EDASERVE");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
NewCtrl.attachEvent("onchange", displayValues);
 
document.body.appendChild(NewCtrl);
 
populateDynamicCtrl(NewCtrl);
}
function  displayValues (ctrl) {
var selobj1 = document.getElementById('edit11');
var i = document.getElementById('edit11').selectedIndex;
alert("the value is" +  " " + selobj1[i].value);
alert("the text  is" +   " " + selobj1[i].text);
}
function DropAndChangeDate (id) {
 
var selobj = document.getElementById(id) ;
var olpparm  =selobj.getAttribute("name");  
alert ("the date parm is " +  olpparm);
var RemCtrl = document.getElementById(id);
       if (RemCtrl) {
           document.body.removeChild(RemCtrl);
       }
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("elementname", "edit11");
NewCtrl.setAttribute("elementtype", "14");
NewCtrl.setAttribute("calendardata", "0/0/-10;0/0/10");
NewCtrl.setAttribute("calendardatatype","1");
NewCtrl.setAttribute("ibiformat","YMD"); 
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);
 
 
}
 
 
function edit6_oldchange(ctrl) {
 
var NewCtrl = document.createElement("select");
NewCtrl.setAttribute("id", "edit11");
NewCtrl.setAttribute("name", "VAL1");
NewCtrl.setAttribute("readOnly","false");
NewCtrl.style.position='absolute';
NewCtrl.style.top = 110;
NewCtrl.style.left = 515;
NewCtrl.style.width = 145;
// Don't use the height especially if you are using a multiple select
//NewCtrl.style.height = 20;
document.body.appendChild(NewCtrl);
 
populate(NewCtrl,'optrela')
 
 
}
</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>

<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
</HEAD>
<BODY style="OVERFLOW: auto">
<IFRAME language=javascript id=report1 style="Z-INDEX: 33; LEFT: 20px; WIDTH: 460px; POSITION: absolute; TOP: 290px; HEIGHT: 110px" onfocus=report1_onfocus(this) tabIndex=1 name=report1 align=top scrolling=no elementtype="2" autoExecute="False" requests_list="0" executebuttonId="button1">
</IFRAME>
<SPAN id=text1 style="Z-INDEX: 2; LEFT: 60px; WIDTH: 64px; POSITION: absolute; TOP: 30px; HEIGHT: 16px" tabIndex=2>Field 
</SPAN>
<SELECT language=javascript id=edit1 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 70px" tabIndex=3 onchange=edit1_onchange(this) size=1 name=FLD1 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text1" start="fileopen" readOnly="false" height="92947284" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION> !IBI.FIL.BOB22;
</SELECT> 
<SELECT id=edit2 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 100px" tabIndex=5 size=1 name=FLD2 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text2" start="fileopen" readOnly="false" height="93210308" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit3 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 130px" tabIndex=7 size=1 name=FLD3 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text3" start="fileopen" readOnly="false" height="93328380" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit4 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 160px" tabIndex=9 size=1 name=FLD4 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text4" start="fileopen" readOnly="false" height="93405052" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit5 style="LEFT: 20px; WIDTH: 130px; POSITION: absolute; TOP: 190px" tabIndex=11 size=1 name=FLD5 sourcetype="typeMaster" datafieldtype="INTIGER" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text5" start="fileopen" readOnly="false" height="93200132" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=FOC_NONE selected displaytext>
</OPTION>
</SELECT> 
<SPAN id=text6 style="Z-INDEX: 12; LEFT: 200px; WIDTH: 65px; POSITION: absolute; TOP: 30px; HEIGHT: 16px" tabIndex=12>Comparison 
</SPAN>
<SELECT language=javascript id=edit6 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 70px" tabIndex=13 onchange=edit6_onchange(this) size=1 name=REL1 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text6" start="fileopen" readOnly="false" height="59290532" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit7 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 100px" tabIndex=15 size=1 name=REL2 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text7" start="fileopen" readOnly="false" height="59290612" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit8 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 130px" tabIndex=17 size=1 name=REL3 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text8" start="fileopen" readOnly="false" height="93384500" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit9 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 160px" tabIndex=19 size=1 name=REL4 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text9" start="fileopen" readOnly="false" height="93384580" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<SELECT id=edit10 style="LEFT: 180px; WIDTH: 130px; POSITION: absolute; TOP: 190px" tabIndex=21 size=1 name=REL5 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text10" start="fileopen" readOnly="false" height="93384660" hspace="0" maxLength="2147483647" loop="1" width="0" CHECKED="false" accept="0" indeterminate="false" vspace="0"> 
<OPTION value=" " selected displaytext>
</OPTION>
</SELECT> 
<INPUT id=edit11 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 70px" tabIndex=23 hspace=0 accept=0 indeterminate=-1 value=" " name=VAL1 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text11" multiple="false"> 
<SPAN id=text12 style="Z-INDEX: 24; LEFT: 340px; WIDTH: 62px; POSITION: absolute; TOP: 30px; HEIGHT: 16px" tabIndex=24>Value 
</SPAN>
<INPUT id=edit12 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 100px" tabIndex=25 readOnly hspace=0 accept=0 indeterminate=-1 value=" " name=VAL2 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text12" multiple="false"> 
<INPUT id=edit13 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 130px" tabIndex=27 readOnly hspace=0 accept=0 indeterminate=-1 value=" " name=VAL3 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text13" multiple="false"> 
<INPUT id=edit14 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 160px" tabIndex=29 readOnly hspace=0 accept=0 indeterminate=-1 value=" " name=VAL4 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text14" multiple="false"> 
<INPUT id=edit15 style="LEFT: 340px; WIDTH: 100px; POSITION: absolute; TOP: 190px" tabIndex=31 hspace=0 accept=0 indeterminate=-1 value=" " name=VAL5 sourcetype="typeMaster" datafieldtype="CHAR" datatype="0" requiredfield="96118856" operation addalloption="0" labelid="text15" multiple="false" ibiformat="YMD" calendardatatype="1" calendardata="0/0/-10;0/0/10"> 
<!-- Option list 1 hidden -->
<!-- Option list 2 hidden -->
<!-- Option list 2 hidden -->
<INPUT language=javascript id=button1 style="Z-INDEX: 32; LEFT: 360px; WIDTH: 120px; POSITION: absolute; TOP: 230px; HEIGHT: 30px" onclick=button1_OnClick(this) tabIndex=32 type=button value="Run report1" name=button1 requests_list="0"> 
<SELECT id=optrela style="DISPLAY: none; LEFT: 85px; POSITION: absolute; TOP: 244px"> !IBI.FIL.SELRELA;
</SELECT> 
<SELECT id=optreld style="DISPLAY: none; LEFT: 140px; POSITION: absolute; TOP: 240px"> !IBI.FIL.SELRELD;
</SELECT> 
<SELECT id=optreln style="DISPLAY: none; LEFT: 190px; POSITION: absolute; TOP: 240px"> !IBI.FIL.SELRELN;
</SELECT>    
<xml id=ibi_requests>
<requests>
	
<request requestid="0" targetname="report1" ibif_ex="report1" targettype="0" sourcetype="typeAdhocfex" ibiapp_app="" paramremovedbyuser="WFFMT">
		
<![CDATA[-* File custom1.fex
-SET &ECHO='ALL';
-DEFAULT &FLD1='FOC_NONE';
-DEFAULT &FLD2='FOC_NONE';
-DEFAULT &FLD3='FOC_NONE';
-DEFAULT &FLD4='FOC_NONE';
-DEFAULT &FLD5='FOC_NONE';
-DEFAULT &REL1=' ';
-DEFAULT &REL2=' ';
-DEFAULT &REL3=' ';
-DEFAULT &REL4=' ';
-DEFAULT &REL5=' ';
-DEFAULT &VAL1=' ';
-DEFAULT &VAL2=' ';
-DEFAULT &VAL3=' ';
-DEFAULT &VAL4=' ';
-DEFAULT &VAL5=' ';
-DEFAULT &WFFMT='PDF';
-*SET &FLD1 = 'ACCEPTANCEFEE' ;
-*SET &REL1 = 'GE' ;
-*SET &VAL1= 100 ;
-SET &WHERE1= IF &FLD1 NE 'FOC_NONE' THEN 'WHERE ' | &FLD1 | ' ' | &REL1 | ' ' | &VAL1 | ';'  ELSE ' ';
-SET &WHERE2= IF &FLD2 NE 'FOC_NONE' THEN 'WHERE ' | &FLD2 | ' ' | &REL2 | ' ' | &VAL2 | ';'  ELSE ' ';
-SET &WHERE3= IF &FLD3 NE 'FOC_NONE' THEN 'WHERE ' | &FLD3 | ' ' | &REL3 | ' ' | &VAL3 | ';'  ELSE ' ';
-SET &WHERE4= IF &FLD4 NE 'FOC_NONE' THEN 'WHERE ' | &FLD4 | ' ' | &REL4 | ' ' | &VAL4 | ';'  ELSE ' ';
-SET &WHERE5= IF &FLD5 NE 'FOC_NONE' THEN 'WHERE ' | &FLD5 | ' ' | &REL5 | ' ' | &VAL5 | ';'  ELSE ' ';
TABLE FILE V_REPORT1
PRINT *
&WHERE1
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML,HTML>,<PDF,PDF>,<Excel 2000,EXL2K>,<Excel Formula,EXL2K FORMULA>).Select type of display output.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
TOPMARGIN=0.055556,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
RIGHTGAP=0.055556,
LEFTGAP=0.027778,
LINES-PER-PAGE=20,
TARGET=_blank,$
END]]>
		
<variables>
			
<variable field="FLD1" file="v_report1.mas" desc="FLD1" datatype="0" operation="" default="FOC_NONE" name="FLD1" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD2" file="v_report1.mas" desc="FLD2" datatype="0" operation="" default="FOC_NONE" name="FLD2" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD3" file="v_report1.mas" desc="FLD3" datatype="0" operation="" default="FOC_NONE" name="FLD3" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD4" file="v_report1.mas" desc="FLD4" datatype="0" operation="" default="FOC_NONE" name="FLD4" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="FLD5" file="v_report1.mas" desc="FLD5" datatype="0" operation="" default="FOC_NONE" name="FLD5" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL1" file="v_report1.mas" desc="REL1" datatype="0" operation="" default=" " name="REL1" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL2" file="v_report1.mas" desc="REL2" datatype="0" operation="" default=" " name="REL2" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL3" file="v_report1.mas" desc="REL3" datatype="0" operation="" default=" " name="REL3" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL4" file="v_report1.mas" desc="REL4" datatype="0" operation="" default=" " name="REL4" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="REL5" file="v_report1.mas" desc="REL5" datatype="0" operation="" default=" " name="REL5" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL1" file="v_report1.mas" desc="VAL1" datatype="0" operation="" default=" " name="VAL1" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL2" file="v_report1.mas" desc="VAL2" datatype="0" operation="" default=" " name="VAL2" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL3" file="v_report1.mas" desc="VAL3" datatype="0" operation="" default=" " name="VAL3" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL4" file="v_report1.mas" desc="VAL4" datatype="0" operation="" default=" " name="VAL4" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="VAL5" file="v_report1.mas" desc="VAL5" datatype="0" operation="" default=" " name="VAL5" accept="0" type="default" select="0" controltype="7"> 
</variable>
<variable field="WFFMT" file="v_report1.mas" desc="Select type of display output" datatype="0" operation="" default="PDF" name="WFFMT" accept="0" type="default" select="0" controltype="7">
<value value="HTML" display="HTML"/>
<value value="PDF" display="PDF"/>
<value value="EXL2K" display="Excel 2000"/>
<value value="EXL2K FORMULA" display="Excel Formula"/> 
</variable>
</variables>
	
</request>
</requests>
</xml>
</BODY>
</HTML>
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Hi Bob,

Various sources on t'internet relate the DHTML controls as HTML From controls implying that they should be created in a from. We know that the later versions of IB's RLP do not use forms but then the only "dynamic" sort of control that is used is the calendar. I've yet to "play" with the new output of RLP to learn how it ddoes things (one of those rainy day past-times Wink).

However, it may be that if you enclose your controls within a pair of form tags, and change your references from document.body.xxxx to document.[form name].xxxx you should be able to pass the variable from your dynamic controls.

I have an example for you that will create one of four controls dynamically using reuseable code. Unfortunately the dynamic calendar control doesn't quite work ... yet. Once I have it working I will update the code -
<html>
 <head>
  <title>Dynamic control example</title>
<SCRIPT id=IbiOptionsScript type=text/javascript>
var cgipath = "cgipath";
var ibirls = "ibirls";
var multidrill = "multidrill";
var mntFormValidate = "mntFormValidate";
var dyncalendar = "dyncalendar";
var ibiOptions = new Array(cgipath,ibirls,mntFormValidate,dyncalendar,multidrill);
</SCRIPT>
<SCRIPT id=nls src="/ibi_html/javaassist/nls.js" type=text/javascript>
</SCRIPT>
<SCRIPT id=ibigbl src="/ibi_html/javaassist/ibi/html/js/ibigbl.js" type=text/javascript>
</SCRIPT>
<SCRIPT id=ibigblloadCss type=text/javascript>
ibigblloadCss(null);
</SCRIPT>
 </head>
 <body style="background-color: rgb(240,245,255)" onload="OnLoad();">
  <form method=get name="form" TARGET="_blank" onsubmit="generate_random();">
    <INPUT type=hidden value="showvals" name="IBIF_ex">
    <INPUT id=IBIAPP_app type=hidden value="anthony" name="IBIAPP_app">
    <INPUT type=hidden value=0 name="IBIMR_random">
    <SELECT ID="Column1" onChange=show_ctrl("Column1","Oper1");
              STYLE="position:absolute; top:50px; left:50px;" name="Column1">
     <OPTION value="FOC_NONE">--- Select ---
     <OPTION value="Column1">Column 1
     <OPTION value="Column2">Column 2
     <OPTION value="Column3">Column 3
     <OPTION value="Column4">Column 4
   </SELECT>
   <SELECT ID="Oper1" onChange=what_ctrl("Oper1");
             STYLE="visibility:hidden; position:absolute; top:50px; left:150px; width:170px;" name="Oper1">
     <OPTION value="FOC_NONE">--- Select ---
     <OPTION value="select-one">Single Select
     <OPTION value="select-multiple">Multi Select
     <OPTION value="text">Text Input
     <OPTION value="calendar">Calendar
   </SELECT>
    <SELECT ID="Column2" onChange=show_ctrl("Column2","Oper2");
              STYLE="position:absolute; top:80px; left:50px;" name="Column2">
     <OPTION value="FOC_NONE">--- Select ---
     <OPTION value="Column1">Column 1
     <OPTION value="Column2">Column 2
     <OPTION value="Column3">Column 3
     <OPTION value="Column4">Column 4
   </SELECT>
   <SELECT ID="Oper2" onChange=what_ctrl("Oper2");
             STYLE="visibility:hidden; position:absolute; top:80px; left:150px; width:170px;" name="Oper2">
     <OPTION value="FOC_NONE">--- Select ---
     <OPTION value="select-one">Single Select
     <OPTION value="select-multiple">Multi Select
     <OPTION value="text">Text Input
     <OPTION value="calendar">Calendar
   </SELECT>
    <SELECT ID="Column3" onChange=show_ctrl("Column3","Oper3");
              STYLE="position:absolute; top:110px; left:50px;" name="Column3">
     <OPTION value="FOC_NONE">--- Select ---
     <OPTION value="Column1">Column 1
     <OPTION value="Column2">Column 2
     <OPTION value="Column3">Column 3
     <OPTION value="Column4">Column 4
   </SELECT>
   <SELECT ID="Oper3" onChange=what_ctrl("Oper3");
             STYLE="visibility:hidden; position:absolute; top:110px; left:150px; width:170px;" name="Oper3">
     <OPTION value="FOC_NONE">--- Select ---
     <OPTION value="select-one">Single Select
     <OPTION value="select-multiple">Multi Select
     <OPTION value="text">Text Input
     <OPTION value="calendar">Calendar
   </SELECT>
   <INPUT style="POSITION: absolute; TOP: 480px; HEIGHT: 30px; LEFT: 180px; WIDTH: 80px;" type=submit value=Submit>
  </form>
<script type=text/javascript>
  function show_ctrl(ctrl,next_ctrl) {
    this.ctrlElement = document.getElementById(ctrl);
    this.nextElement = document.getElementById(next_ctrl);
    if (this.ctrlElement.selectedIndex == 0) {
      this.nextElement.style.visibility = "hidden";
      this.nextElement.selectedIndex = 0;
    } else {
      this.nextElement.style.visibility = "visible";
    }
  }

  function what_ctrl(ctrl) {
    this.ctrlElement = document.getElementById(ctrl);
    var ctrlNum = ctrl.substring(4);
    var ctrlTop = this.ctrlElement.style.top;
    var RemCtrl = document.getElementById('Edit'+ctrlNum);
    remove_ctrl(RemCtrl);
// A select control
    if (this.ctrlElement.selectedIndex==1 || this.ctrlElement.selectedIndex==2) {
      create_select(ctrlNum,ctrlTop);
    } else {
// A text input control
      if (this.ctrlElement.selectedIndex==3) {
          create_text(ctrlNum,ctrlTop);
      } else {
// A calendar control
        if (this.ctrlElement.selectedIndex==4) {
          create_calendar(ctrlNum,ctrlTop);
        } else {
// The root option has been selected so just remove the control
          return;
        }
      }
    }
  }

  function create_select(ctrlNum,ctrlTop) {
    var NewCtrl = document.createElement("SELECT");
    NewCtrl.setAttribute("id", "Edit"+ctrlNum);
    NewCtrl.setAttribute("name", "Edit"+ctrlNum);
    NewCtrl.setAttribute("elementname", "combobox"+ctrlNum);
    NewCtrl.setAttribute("elementtype", "combobox");
    NewCtrl.setAttribute("sourcetype", "typeFex");
    NewCtrl.setAttribute("operation", "NONE");
    NewCtrl.setAttribute("datatype", "1");
    NewCtrl.setAttribute("addalloption", "1");
    NewCtrl.setAttribute("dynalldisplayvalue", "-- Select --");
    NewCtrl.setAttribute("inchainindex", "-1");
    NewCtrl.setAttribute("chainnumber", "-1");
    NewCtrl.setAttribute("cacheruntimedata", "1");
    NewCtrl.setAttribute("displayfield", "");
    NewCtrl.setAttribute("datafield", "");
    NewCtrl.setAttribute("numofrecords", "-1");
    NewCtrl.setAttribute("datasource", "selctry1.fex");
    NewCtrl.setAttribute("datafieldtype", "CHAR");
    NewCtrl.setAttribute("ibiformat", "");
    NewCtrl.setAttribute("IBIAPP_app", "anthony");
    NewCtrl.setAttribute("IBIC_server", "EDASERVE");
    NewCtrl.style.position="absolute";
    NewCtrl.style.top = ctrlTop;
    NewCtrl.style.left = 325;
    NewCtrl.style.width = 250;
    document.form.appendChild(NewCtrl);
    if (this.ctrlElement.selectedIndex==2) {
      NewCtrl.multiple=true;
      NewCtrl.size=5;
    }
    populateDynamicCtrl(NewCtrl);
  }

  function create_text(ctrlNum,ctrlTop) {
    var NewCtrl = document.createElement("INPUT");
    NewCtrl.setAttribute("id", "Edit"+ctrlNum);
    NewCtrl.setAttribute("name", "Edit"+ctrlNum);
    NewCtrl.setAttribute("type", "text");
    NewCtrl.setAttribute("value","Nothing");
    NewCtrl.style.position="absolute";
    NewCtrl.style.top = ctrlTop;
    NewCtrl.style.left = 325;
    NewCtrl.style.width = 250;
    document.form.appendChild(NewCtrl);
  }

  function create_calendar(ctrlNum,ctrlTop) {
    var NewCtrl = document.createElement("INPUT");
    NewCtrl.setAttribute("id", "Edit"+ctrlNum);
    NewCtrl.setAttribute("value","dd/mm/yy");
    NewCtrl.setAttribute("name", "Edit"+ctrlNum);
    NewCtrl.setAttribute("elementname", "Edit"+ctrlNum);
    NewCtrl.setAttribute("elementtype", "editcalendar");
    NewCtrl.setAttribute("labelid", "");
    NewCtrl.setAttribute("caption", "editcalendar");
    NewCtrl.setAttribute("operation", "NONE");
    NewCtrl.setAttribute("ibiformat", "DMY");
    NewCtrl.setAttribute("datasource", "");
    NewCtrl.setAttribute("datafieldtype", "CHAR");
    NewCtrl.setAttribute("calendardatatype", "0");
    NewCtrl.setAttribute("calendardata", "01/01/1990;02/01/2015");
    NewCtrl.style.position="absolute";
    NewCtrl.style.top = ctrlTop;
    NewCtrl.style.left = 325;
    document.form.appendChild(NewCtrl);
//    setupCtrlCalendar(NewCtrl);
  }

  function remove_ctrl(ctrl) {
    if (ctrl) {
       document.form.removeChild(ctrl);
    }
  }

// Nothing more than assigning a random number to an input to force a rerun of a report
// as opposed to recalling it from browser cache .
  function generate_random() {
    var Random_No = Math.floor((Math.random()*100000));
    Rand = document.getElementById("IBIMR_random");
    Rand.value = Random_No;
    show_vars();
 }

// Show all variables that should be passed
  function show_vars() {
    var varlist = "";
    for (i=0;i<document.all.length;i++) {
      if (document.all(i).name!="" && document.all(i).name!=undefined && document.all(i).value!=undefined) {
        varlist += document.all(i).name + " : " + document.all(i).value + "\r\n ";
      }
    }
    alert(varlist);
  }
</script>
<SCRIPT id=OnloadHandler>
function OnLoad() {
<!--startibilines-->
UpdateData();
<!--endibilines-->
}
</SCRIPT>
 </body>
<SCRIPT id=loadcalendar type=text/javascript>
if(ibigblInitInfo.testOptions(dyncalendar)){
     setDateRange();
     setupDocCalendars();
}
</SCRIPT>
</html>

Remember that the IB specific code includes originate from version 5.3.2 and have changed significantly in 7.1.x. However, the HTML will still run OK in those versions (I'm using 7.1.3).

One thing that I normally add to my code is the generation of a random number to implant into IBIMR_Random, hopefully to force a refresh of the page and not use a cached version. Within this example I have added a call to a show_vars function that just looks through the document and lists all the controls that have real names and values and therefore should be passed as variables.

Hope you can understand it!

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
Tony:

Thank you for your efforts. I pasted your code into a developer studio .htm file and hit the run button and got stack overflow at line 147 error in a msgbox.

I assume this ran on your computer. I will see if I can figure it out.

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Hi Bob,

Yes, it runs fine in an HTML file from Dev Studio 7.1.3.

The fex that is used to populate the combo boxes (both single and multiple) is -

-* File selctry1.fex
TABLE FILE CAR
SUM FST.COUNTRY
BY COUNTRY
ON TABLE PCHOLD FORMAT XML
END

and the showvals.fex just has -

-* showvals.fex
-? &

To show all the currently known variables.

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
Tony:

I am still getting the same error.

I am also running 713 developer studio

Is it possible the copying the code didn't work?

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report This Post
Expert
posted Hide Post
Hi Bob,

It's possible but I checked myself by copying the code and pasting into a new htm file before I last posted.

Did you change the values of "anthony" to a value for your own app? There are only two occurences, one in the hidden INPUT for IBIAPP_app and the second in the script for the select, again for the IBIAPP_app. This alone shouldn't cause a stack overflow, so I'm not too sure where to suggest checking. I'll have a think and see if there are any known issues on this error when I have the time.

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
Tony:

Yes I changed 2 occcurances of anthony to bob,

Thnak you again for all your efforts, I have to goto a meeting then I will be out till Monday.

Bob
 
Posts: 103 | Location: ricmmond va | Registered: September 30, 2004Report 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     CHANGING AND REPOITIONING CONTROLS IN RESOURCE LAYOUT

Copyright © 1996-2020 Information Builders