If I understand correctly dashboard2 Form doesn't have option to be populated with input.
It shows that there should be dynamic properties, but
node doesn't have inputs:
Am I missing option similar to MQTT dynamic input possibilities?
I've tried to use template node, and managed to submit my data, but how do I populate it dynamically?
My code:
[{"id":"705bc06bb8220e7c","type":"debug","z":"42df28f38b7015cb","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":300,"wires":[]},{"id":"f0646820af75eaee","type":"ui-template","z":"42df28f38b7015cb","group":"049df7ce25695955","page":"","ui":"","name":"","order":0,"width":0,"height":0,"head":"","format":"<template>\n <v-sheet class=\"mx-auto\" width=\"300\">\n <v-form v-model=\"valid\">\n <v-container>\n <v-row>\n <v-col cols=\"15\" md=\"5\">\n <v-text-field\n v-model=\"barcode\"\n :counter=\"10\"\n label=\"Barcode\"\n hide-details\n required\n ></v-text-field>\n </v-col>\n </v-row>\n <v-row>\n <v-col cols=\"15\" md=\"5\">\n <v-text-field\n v-model=\"firstname\"\n :counter=\"10\"\n :rules=\"nameRules\"\n label=\"First name\"\n hide-details\n required\n ></v-text-field>\n </v-col>\n </v-row>\n <v-btn class=\"mt-2\" @click=\"submitForm\" block>Submit</v-btn>\n </v-container>\n </v-form>\n </v-sheet>\n</template>\n\n<script>\nexport default {\n data: () => ({\n valid: false,\n barcode: '',\n firstname: '',\n nameRules: [\n value => {\n if (value) return true\n return 'Name is required.'\n },\n value => {\n if (value?.length <= 10) return true\n return 'Name must be less than 10 characters.'\n },\n ],\n }),\n\n methods: {\n submitForm() {\n if (this.valid) {\n // Trigger the send method with the payload 'Submitted'\n let form = {\n \"barcode\": this.barcode,\n \"firstname\": this.firstname\n }\n this.send({ payload: form });\n }\n },\n\n watch: {\n msg: function(){ \n const formIn = this.msg.payload \n this.form = formIn\n this.barcode = formIn.barcode \n }\n } \n // Define send method here or ensure it's available in your component\n // Example: send(payload) { ... }\n },\n};\n</script>\n","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":360,"y":300,"wires":[["705bc06bb8220e7c"]]},{"id":"73465afa9ec8ceee","type":"inject","z":"42df28f38b7015cb","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"barcode\":\"10101055\",\"name\":\"John\"}","payloadType":"json","x":230,"y":300,"wires":[["f0646820af75eaee"]]},{"id":"049df7ce25695955","type":"ui-group","name":"Set Management","page":"33f90bfd302476bf","width":"6","height":"5","order":-1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"33f90bfd302476bf","type":"ui-page","name":"TestGroup","ui":"6f45e2d6304310fc","path":"/pageN","icon":"home","layout":"grid","theme":"015f2f066ac65dee","order":-1,"className":"","visible":"true","disabled":"false"},{"id":"6f45e2d6304310fc","type":"ui-base","name":"My Dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"navigationStyle":"default"},{"id":"015f2f066ac65dee","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]
I've tried to adapt @hotNipi Tank Volume example
watch: {
msg: function(){
const v = this.validate(this.msg.payload)
this.value = v
}
}
but no success