Group Abstract Group Abstract

Message Boards Message Boards

[?] Avoid issue with PopupMenu?

Posted 7 years ago
2 Replies

I would do it this way:

DynamicModule[{inputData = 0, dataSet1 = {0, 1}, popupSelection}, 
 Dynamic@Column[{InputField[Dynamic[inputData]], 
    Button["Plot", dataSet1 = Table[inputData + i^j, {i, 5}, {j, 2}]],
     Spacer[5], 
    PopupMenu[
     Dynamic[popupSelection], {"value1" -> "v1", "value2" -> "v2"}], 
    ListPlot[If[popupSelection === "value1", dataSet1, dataSet1 + 1], 
     Joined -> True, ImageSize -> {300}, Frame -> True, 
     Axes -> False]}],
 SynchronousInitialization -> False]
POSTED BY: Gianluca Gorni

It resolves my problem, Thanks.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard