DeserializeValue (pre-process selection queue)

Top  Previous  Next

 

DeserializeValue, VIRTUAL

The DeserializeValue virtual method extracts values (separated by the value of the Delimiter property) from the EIP columns USE variable (UseVar) and preloads the items into the Selected queue. DeserializeValue will split the SELF.UseVar contents using the SELF.Delimiter value as a separator, and store the resulting values to the Selected queue if values are in the available list. Any value that is not in the available list is discarded.

 

Implementation:

The DeserializeValue method is called before opening the MultiSelect dialog window from within the TakeEvent method of the EditMultiSelectClass.

Example:

 

EditMultiSelectClass.TakeEvent PROCEDURE(UNSIGNED E)

MSWindow MSWindowClass

MSSelectedIndex LONG

CODE

 

CASE E

OF EVENT:DroppingDown

  IF SELF.Delimiter

   FREE(SELF.Selected)

  SELF.DeSerializeValue()

  END

  MSWindow.Init(SELF)

  OPEN(MultiWindow)

  0{PROP:Text} = SELF.Title

  ?Available{PROP:From} = SELF.Available.Item

  ?Available{PROP:Mark} = SELF.Available.Mark

  ?Selected{PROP:From} = SELF.Selected.Item

  ?Selected{PROP:Mark} = SELF.Selected.Mark

 

 IF SELF.ReadOnly

   DISABLE(?SelectSome)

   DISABLE(?SelectAll)

   DISABLE(?DeselectSome)

   DISABLE(?DeselectAll)

   DISABLE(?MoveUp)

   DISABLE(?MoveDown)

  END

  MSWindow.Run()

 

  CLOSE(MultiWindow)

  DISPLAY(SELF.Feq)

  IF MSWindow.Response=RequestCompleted THEN

   IF SELF.Delimiter

    SELF.SerializeValue()

   END

   SELF.TakeCompletedInit(RECORDS(SELF.Selected))

    LOOP MSSelectedIndex=1 TO RECORDS(SELF.Selected)

     GET(SELF.Selected,MSSelectedIndex)

     SELF.TakeCompletedProcess(MSSelectedIndex,SELF.Selected.Item,SELF.Selected.Mark)

     SELF.Available.Item=SELF.Selected.Item

     SELF.Available.Mark=0

     ADD(SELF.Available)

    END

    FREE(SELF.Selected)

    SORT(SELF.Available,SELF.Available.Item)

  END

  RETURN CHOOSE(MSWindow.Response=RequestCompleted, EditAction:Ignore, EditAction:None)

 ELSE

   RETURN PARENT.TakeEvent(E)

 END

 

See Also: SerializeValue , Delimiter, Selected