@ScopeParam"

From Documentation
(Created page with "{{ZKDevelopersReferencePageHeader}} = Syntax = <source lang="java"> @ScopeParam("keyString") @ScopeParam(scopes=Scope.APPLICATION, value="keyString") </source> '''A list ...")
 
m ((via JWB))
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
 +
{{Deprecated | url=[http://books.zkoss.org/zk-mvvm-book/8.0/syntax/scopeparam.html zk-mvvm-book/8.0/syntax/viewmodel/parameters/scopeparam]|}}
  
  
Line 15: Line 16:
  
 
enum Scope {
 
enum Scope {
     COMPONENT, SPACE, PAGE, DESKTOP, SESSION, APPLICATION, // single scope
+
     EXECUTION, COMPONENT, SPACE, PAGE, DESKTOP, SESSION, APPLICATION// single scope
 
     AUTO //find by comp.getAttribute(name,true)
 
     AUTO //find by comp.getAttribute(name,true)
 
}
 
}
  
 
</source>
 
</source>
 +
 +
{{versionSince|8.6.0}}
 +
Note: EXECUTION is added into the Scope enumeration
  
 
= Description =  
 
= Description =  
  
'''Target:''' A method's parameter (initial method and command method)
+
'''Target:''' A method's parameter (for initial and command methods)
  
 
'''Purpose:''' Tell binder to retrieve a value with specified scope
 
'''Purpose:''' Tell binder to retrieve a value with specified scope
  
The default scope: '''AUTO''' means searching the value from COMPONENT to SPACE, PAGE, DESKTOP, SESSION, APPLICATION one bye one automatically until find a non-null value.  If you specified the '''scopes''' element, binder will search the only scope you specified.
+
The default scope: '''AUTO''' means searching the value from EXECUTION to COMPONENT, SPACE, PAGE, DESKTOP, SESSION, APPLICATION one by one automatically until find a non-null value.  If you specified the '''scopes''' element, binder will search the only scope you specified.
  
 
= Example =
 
= Example =
Line 41: Line 45:
  
 
</source>
 
</source>
 +
 +
 +
 +
 +
=Version History=
 +
 +
{| class='wikitable' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| 6.0.0
 +
| February 2012
 +
| The MVVM was introduced.
 +
|-
 +
| 8.6.0
 +
| October 2018
 +
| EXECUTION is added into the Scope enumeration.
 +
|}
 +
 +
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 07:36, 8 July 2022

Stop.png This article is out of date, please refer to zk-mvvm-book/8.0/syntax/viewmodel/parameters/scopeparam for more up to date information.


Syntax

@ScopeParam("keyString") 

@ScopeParam(scopes=Scope.APPLICATION, value="keyString")

A list of all scopes enumeration:

enum Scope {
    EXECUTION, COMPONENT, SPACE, PAGE, DESKTOP, SESSION, APPLICATION// single scope
    AUTO //find by comp.getAttribute(name,true)
}

Since 8.6.0 Note: EXECUTION is added into the Scope enumeration

Description

Target: A method's parameter (for initial and command methods)

Purpose: Tell binder to retrieve a value with specified scope

The default scope: AUTO means searching the value from EXECUTION to COMPONENT, SPACE, PAGE, DESKTOP, SESSION, APPLICATION one by one automatically until find a non-null value. If you specified the scopes element, binder will search the only scope you specified.

Example

public class ScopeParamVM {

	@Init
	public void init(@ScopeParam(scopes=Scope.APPLICATION , value="config") String sysConfig,
			@ScopeParam(scopes=Scope.SESSION,value="user") String userCredential){
	}



Version History

Version Date Content
6.0.0 February 2012 The MVVM was introduced.
8.6.0 October 2018 EXECUTION is added into the Scope enumeration.




Last Update : 2022/07/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.