|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
3 C" M' k" Q0 b3 J0 k8 a* ]
, |+ I; e. W1 N' L" A( DTechnique
' X9 C' C/ @4 E- \Use the Item.getNextStates() method to get the next state values. This recipe
# C1 ^ O' t# K2 v" }0 kassumes there is a select input field on the form for us to populate with state values.
: X% G0 |3 ~ G4 THTML 5 e3 g( _# s7 H- E
<select id="mySelect"></select> $ p% x: {( Z& x4 W% y/ s
JavaScript
! y* c: H% ?* _, V1 ovar results = document.thisItem.getNextStates();
: U, {; B5 C" y hvar nextStates = results.getItemsByXPath('//Item[@type="Life Cycle State"]');
# P5 Z- x! M1 G6 Fvar count = nextStates.getItemCount();
/ ?5 D+ |' Y8 W 6 j, [$ B7 X' {" c* `4 I
var oSelect = document.getElementById('mySelect');
, G+ [) e5 v7 {3 q1 F# U" F( s& Y1 K2 mfor (var i=0; i<count; ++i) { ! ?# I' `+ u9 E7 N! w1 E' M2 P
var item = nextStates.getItemByIndex(i);
; M/ L4 F, |/ t) j8 H0 F var opt = document.createElement('option');
+ X- I) C$ p# N5 ^2 c5 M9 n6 l opt.text = item.getProperty('name');
7 S& g! f/ O a3 @3 K* o oSelect.add(opt); ) q2 F, m1 v3 z$ M9 w' ^' s8 E! v
} 6 r3 H0 u: c2 Z4 F
$ L/ b: {. I9 ~1 b" x9 ^& z |
|