\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 : Model

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 the Model function to add code to an adapter so that you can cause programmatic updates to your application's View (UI). This may sound contradictory, but the updates to the View are based on changes in your Model (application objects), hence this is Model code.

[edit] Adding Model Code

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

[edit] Variables

Model functions contain two intrinsic variables:

  • var Object context--provides a way to access the object context of the adapter
  • var (adapter type) view--provides a way to access the fields of the adapter

[edit] Example

There is an example of Model code in Example 3 of the DynamicForm control documentation. The code (shown below) updates the View (the form displayed) based on changes to the Model (the value of a string field called formType). Based on the code in the Model function below, changes to the value of formType programmatically determine whether a "read-only" or "editable" form gets displayed to the user.

 

[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

View

 


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