コンポーネントの選択可能な値を取得する

/*****
 *** getSelectableValues()
 *** prints all selectable values for a given component, f.e. comboboxes, listboxes etc.
 ***
 *** @params id of component
 *****/
 
function getSelectableValues( id ) {
   var ComboBox = getComponent( id );
   var ChildrenList:java.util.ListIterator;
   ChildrenList = ComboBox.getChildren().listIterator();
   while (ChildrenList.hasNext()) {
      var Child = ChildrenList.next();
 
      /*** process computed / multiple values ***/
      if( typeof( Child ) == 'com.ibm.xsp.component.UISelectItemsEx' ){
         var hlp = Child.getValue();
         for( var i=0; i< hlp.length; i++ ){
 
            /*** print to server console ***/
            print( hlp[i].getLabel() + "|" + hlp[i].getValue() );
         }
      }
 
      /*** process single values ***/
      if( typeof( Child ) == 'com.ibm.xsp.component.UISelectItemEx' ){
 
      /*** print to server console ***/
      print( Child.getItemLabel() + "|" + Child.getItemValue() );
      }
   }
}
 
/*** get all selectable values for element 'comboBox1' ***/
getSelectableValues( 'comboBox1' );





SSJS 経由であるコンポーネントの選択可能な値すべてにアクセスする方法

JavaScript (Server)
katoman
August 19, 2015 at 2:18 PM
Rating
0





No comments yetLogin first to comment...