Message Boards Message Boards

0
|
2015 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Getting a form called from an ActionMenu in a Palette?

Posted 2 years ago

Dear All,

Impossible to have a form to run when called from ActionMenu in a Palette:

I create a FormFunction "form":

Clear[form];
form = FormFunction[
   "Information" ->
    RepeatingElement[
     CompoundElement[
      <|
       {"Property", Style["Property", 16, Black, Bold]} -> "String",
       {"Unit", Style["Unit", 16, Black, Bold]} -> "String"
       |>
      ]
     ],
   AppearanceRules ->
    <|
     "Title" -> " ",
     "Description" -> 
      Column[{Style["Enter your information", Bold, 20, Red]}]
     |>
   ];

1 (of 2). The following evaluates the FormFunction directly in the notebook (which is what I want)

form[]

2 (of 2). But the next code do not return in the notebook the FormFunction evaluated as I want, it returns instead a unevaluated FormFunction[___], which is not the same as 1.

CreatePalette[
  Grid[
   {
    {Style["Data", FontSize -> 14, FontWeight -> Bold],
     ActionMenu[
      "Create",
      {
       "Create an element" :>
        NotebookApply[
         SelectedNotebook[],
         Cell[
          BoxData[
           ToBoxes[form]
           ],
          "Output"]
         ]
       }
      ]
     }
    }
   ]
  ];

Thank you beforehand for some help because I have been struggling with that, trying many many possibilities, for more than two weeks.

Regards.

Gianni Mocellin

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

Group Abstract Group Abstract