Pre-populating ui_form

In the D2 docs here Form ui-form | Node-RED Dashboard 2.0, an example is given on how to pre-populate a ui-form. Has this actually been implemented? No matter what I have tried I cannot get a form to populate with the given example.

Cheers
Bob

I can get form to prepopulate using latest 1.12.4, there a few issues though.

  • When prepopulated you have to click on all fields before submit button works
  • the prepopulation object is passed through the node without a submit, which seems a bad idea.

example flow

[{"id":"0872583c36c11d85","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"name\":\"aaa\",\"phone\":\"1234\"}","payloadType":"json","x":110,"y":200,"wires":[["4e2122c1d3d77fd9"]]},{"id":"4e2122c1d3d77fd9","type":"ui-form","z":"d1395164b4eec73e","name":"","group":"9d83cd8b3d5ee33c","label":"","order":1,"width":0,"height":0,"options":[{"label":"Name","key":"name","type":"text","required":true,"rows":null},{"label":"Phone","key":"phone","type":"number","required":true,"rows":null}],"formValue":{"name":"","phone":""},"payload":"","submit":"submit","cancel":"clear","resetOnSubmit":true,"topic":"topic","topicType":"msg","splitLayout":"","className":"","x":310,"y":160,"wires":[["c6708522f7441ae1"]]},{"id":"c6708522f7441ae1","type":"debug","z":"d1395164b4eec73e","name":"debug 2561","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":470,"y":160,"wires":[]},{"id":"9d83cd8b3d5ee33c","type":"ui-group","name":"Group1","page":"c694d0ebe0d2b702","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"c694d0ebe0d2b702","type":"ui-page","name":"Page1","ui":"1805777f90e92057","path":"/page1","icon":"home","layout":"grid","theme":"a965ccfef139317a","order":2,"className":"","visible":"true","disabled":"false"},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#5c5c5c","primary":"#00fdff","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

I have raised an issue on above ui-form passing prepopulated and submit not clickable · Issue #1069 · FlowFuse/node-red-dashboard · GitHub

3 Likes

Thanks for raising, will address when back at work on Tueday

This was implemented in 1.12.4 which only came out this week

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.