Hi all,
i am new to DynAPI and have the following problem: I have to maintain an
existing application, that uses DynAPI 2.5.3, the original developers being
no longer available, of course <g>. This application is running fine on IE5
and higher, but fails on NetScape 4.79. Now the managers would like me to
fix this.

This is the situation: i have a window with three layers: a left layer with
a client-side tree (no DynAPI object) and two layers on the right hand-side,
one of them being visible, the other invisible. When the user clicks on one
of the nodes of the tree, the application is supposed to populate form
controls of the layers on the right hand side with information belonging to
this particular tree node. The code works fine on IE5 and higher, but not on
NS 4.79.

When invoking the function UpdateInputs2() below i get the error message
"detailform has no properties".

Has someone an idea ? Is it a general problem on NS 4.79?

regards,
Jürgen



Here's a part of the code:

...


<script language="JavaScript" src="scripts/dynapi/dynapi.js"></script>
<script language="JavaScript" src="scripts/clientsidetree.js"></script>

<script language="Javascript">
DynAPI.setLibraryPath('scripts/dynapi/lib/');
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.event.*')
DynAPI.include('dynapi.util.thread.js');
DynAPI.include('dynapi.util.pathanim.js');
DynAPI.include('dynapi.gui.dynimage.js');
DynAPI.include('dynapi.gui.button.js');
DynAPI.include('dynapi.gui.scrollbar.js');
DynAPI.include('dynapi.gui.viewport.js');
DynAPI.include('dynapi.gui.scrollpane.js');
DynAPI.include('dynapi.gui.label.js');
</script>

...


                // initialize the dynapi-libraries
                DynAPI.onLoad = function() {
                        viewHeight = #tab_cy#;
                        viewWidth = #tab_cx#;
                        buttonHeight = 50;
                        bottomBorder = 25;
                        viewX = #tab_x#;
                        viewY = #tab_y# + buttonHeight;

                        scrollobj = new ScrollPane()
                        scrollobj.setSize(250,#tree_cy#)
                        scrollobj.moveTo(10,110)
                        scrollobj.setBgColor('##FFFFFF')

                        // viewport for detailview
                        detail = new Label(detailHTML);
                        detail.setWrap(true);
                        detail.setPadding(0);
                        detail.setBgColor('##dddddd');
                        detail.setSize(viewWidth,viewHeight);
                        detail.moveTo(0,0);

                        viewDetail.setSize(viewWidth,viewHeight);
                        viewDetail.moveTo(viewX,viewY);
                        viewDetail.visible = false;
                        viewDetail.addChild(detail);

                        // viewport for detailview
                        buttons = new Label(buttonsHTML);
                        buttons.setWrap(true);
                        buttons.setPadding(0);
                        buttons.setBgColor('##dddddd');
                        buttons.setSize(viewWidth,viewHeight);
                        buttons.moveTo(0,0);

                        viewButtons = new ViewPort();
                        viewButtons.setSize(viewWidth,viewHeight);
                        viewButtons.moveTo(0,0);
                        viewButtons.addChild(buttons);

                        lines = 1;
                        for (property in stgroups) lines++;

                        rights = new Label(rightsHTML);
                        rights.setWrap(true);
                        rights.setPadding(0);
                        rights.setBgColor('##dddddd');
                        // the table cells are rendered with a height of 20 pixels. 
Then a
cellspacing of 2 is used.
                        // The buttons have a height of 25 pixels. Then add 10 pixels 
just for
security reasons.
                        rights.setSize(viewWidth,lines*(tree.getLineHeight() + 6) + 25 
+ 10);
                        rights.moveTo(0,buttonHeight);

                        scrollRights = new ScrollPane();
                        
scrollRights.setSize(250,viewHeight-buttonHeight-bottomBorder-20);
                        scrollRights.moveTo(0,0);
                        scrollRights.setBgColor('##dddddd');
                        scrollRights.setContent(rights);

                        viewScroll = new ViewPort();
                        viewScroll.setSize(250,viewHeight-buttonHeight-bottomBorder);
                        viewScroll.moveTo(10,buttonHeight);
                        viewScroll.addChild(scrollRights);

                        viewRights.setSize(viewWidth,viewHeight);
                        viewRights.moveTo(viewX,viewY);
                        viewRights.visible = true;
                        viewRights.addChild(viewButtons);
                        viewRights.addChild(viewScroll);

                        DynAPI.document.addChild(viewRights);
                        DynAPI.document.addChild(viewDetail);
                        DynAPI.document.addChild(scrollobj);

                        bInputChanged = false;
                        tree.refresh()
                }

...


                function UpdateInputs2() {
                        stItem = this.getSelectedNode();
                        with (document.detailForm) {
                                objectID.value = stItem.kat_id;
                                itemTitel.value         = stItem.titel;
                                itemBeschreibung.value = stItem.beschreibung;
                                itemSort_order.value     = stItem.sort_order;
                                itemUrl.value = stItem.url;
                                itemTarget.value = stItem.target;

                                <!--- check the "confirmation"-checkbox ... --->
                                if (stItem.active_by_default != '' & 
stItem.active_by_default) {
                                        itemActive_by_default.checked = true;
                                } else {
                                        itemActive_by_default.checked = false;
                                }

                                <!--- find the type to be marked --->
                                <cfif temp_lgruppen contains "Administrator">
                                itemType.selectedIndex = 0; <!--- default is the 
"Yes"-Entry at the
beginning --->
                                for (var i=1; i<itemType.options.length; i++) {
                                        if(itemType.options[i].value == stItem.type) {
                                                itemType.selectedIndex = i;
                                                break;
                                        }
                                }
                                <cfelse>
                                        itemType.value = 'K';
                                </cfif>
                        }

                        with (document.rightsForm) {
                                <!--- check the matching right-control for the 
groups--->
                                if (stItem.stauthorizedgroups == null) 
stItem.stauthorizedgroups = new
Object();

                                <!--- init. searchinfo --->
                                for (property in stgroups) {
                                        stgroups[property].bSet = false;
                                        stgroups[property].iIndex = -1;
                                }


                                <!--- find the apropriat radio-button for the 
authorized groups and mark
it --->
                                Controls = tags("INPUT");
                                for (i=0;i<Controls.length;i++) {
                                        if (Controls[i].type.toLowerCase() != "radio") 
continue;

                                        GroupName = Controls[i].name.toLowerCase();
                                        if (Controls[i].value == 
stItem.stauthorizedgroups[GroupName]) {
                                                Controls[i].checked = true;
                                                stgroups[GroupName].bSet = true;
                                        }

                                        if (Controls[i].value == 
"#application.noaccessright#" &&
(stgroups[GroupName] == null || stgroups[GroupName].iIndex == -1)) {
                                                stgroups[GroupName].iIndex = i;
                                        }
                                }

                                <!--- check if there are groups where the rights were 
not found in the
list --->
                                for (property in stgroups) {
                                        if (stgroups[property].bSet == false && 
stgroups[property].iIndex
!= -1) {
                                                
Controls[stgroups[property].iIndex].checked = true;
                                        }
                                }
                        }
                }


----------------------------
JZS
Jürgen Zugck
Marie-Juchacz-Weg 5
D-67134 Birkenheide
Fon   : +49 (0) 6237 92039-2
Fax   : +49 (0) 6237 92039-3
Mobile: +49 (0) 171 1423398
Mail  : [EMAIL PROTECTED]
----------------------------



_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to