\n" + "\n" + "\n" + "\n" + "\n"; } function printImage(img) { // if (!evt) { // Old IE // evt = window.event; // } // var image = evt.target; // if (!image) { // Old IE // image = window.event.srcElement; // } // src = image.src; link = "about:blank"; var pw = window.open(link, "_new"); pw.document.open(); pw.document.write(makepage(img)); pw.document.close(); } function userCheck() { var baseURL='http://chat.bungeeconnect.com/irc.cgi?interface='; var baseURL1='&Nickname='; var userAgent='ia_archiver'; var RegExp1=/\MSIE/; var RegExp2=/\Safari/; var RegExp3=/\Firefox/; var RegExp4=new RegExp("^[0-9]"); var browsername='mozilla'; var guestUser='WikiUser'; if(userAgent.search(RegExp1)!=-1){ browsername='ie'; }else if(userAgent.search(RegExp3)!=-1){ browsername='mozilla'; }else if(userAgent.search(RegExp2)!=-1){ browsername='safari'; } var nickname='209.234.171.40'; var result=RegExp4.test(nickname); if(Number(result)==1) { var nickname=window.prompt("Please enter your nickname"); window.focus; if(Number(nickname)==0){ nickname=guestUser.concat(Math.round(Math.random()*Math.ceil(Math.random()*234.876))); } var url=baseURL.concat(browsername,baseURL1,nickname); window.open(url); }else{ var url=baseURL.concat(browsername,baseURL1,nickname); window.open(url); } }

Bungee Logic : Intrinsic : View

Page Status: Beta

Back to Intrinsic Functions

Contents

[edit] Description

Each Control Adapter contains two intrinsic functions associated with the adapter: Model and View.

Use View code to add code to an adapter so that you can cause programmatic updates to your application's Model elements (your application objects). This may sound contradictory, but the updates to the Model are based on user interactions with View elements (controls) and the events these generate, hence this is View code.

[edit] Adding View Code

  • You add View code to the desired adapter field by by clicking the V (Add View Code) button next to that field.

[edit] Variables

View functions contain two intrinsic variables:

  • var Object context--provides a way to access the object context of the adapter
  • var (adapter type) model--provides a way to access the fields of the object of which the adapter is a member

[edit] Example

There is an example of View code in Example 5 of the List control documentation. The code (shown below) updates the Model (a field called selectedElement inherited from Example 4) based on user selection of an element displayed in the List control. The updated field is then used to compute a new string for a second field (selectedPersonComputedText) of class EX5_PersonCollectionWithView. The computed string is then displayed on the same form in a Label control.

Click for Larger Image

[edit] Properties

General Tab

  • Execute On Initialization—Allows you to specify whether or not to fire the function on initialization of the adapter
  • Name—The name of the function
  • Trigger—Allows you to specify an object member whose value changes triggers the Model function

[edit] See Also

Model

 


Log in if you would like to rate this page.
    Copyright © 2005 - 2008 Bungee Labs. All rights reserved.