Comments (7)
But why the data I pass is marked valid? (An object containing an array of array of string.)
This means the schema is the right one (or at least the schema and data are ok, maybe the layout is wrong).
from ajsf.
Removing the layout definition altogether displays the form as I think you expect it to be.
from ajsf.
Something is wrong with your schema..
You're saying array1 is array type its inside object is array type and in subarray there is a string object..
Array
_____subArray
______________string(inside the sub array)
And you're using layout to adjust the schema.. Layout is used to adjust the form widgets like input fields drop down.. Youre schema is invalid please get help from test examples first before writing ur schema
from ajsf.
But why the data I pass is marked valid? (An object containing an array of array of string.)
This means the schema is the right one (or at least the schema and data are ok, maybe the layout is wrong).
as by my thoughts of this library ,, layout is used to adjust the positioning and somethings like that kindly i refer you to check its given examples.
from ajsf.
This problem is being caused by a tandem of these two things inside of buildLayout:
code piece 1:
var nodeValue = JsonPointer.get(jsf.formValues, newNode.dataPointer.replace(/\/-/g, '/1'));
and code piece 2:
// Add any additional default items
if (!newNode.recursiveReference || newNode.options.required) {
var arrayLength = Math.min(Math.max(newNode.options.tupleItems + newNode.options.listItems, isArray(nodeValue) ? nodeValue.length : 0), newNode.options.maxItems);
for (var i = newNode.items.length; i < arrayLength; i++) {
newNode.items.push(getLayoutNode({
$ref: itemRefPointer_1,
dataPointer: newNode.dataPointer,
recursiveReference: newNode.recursiveReference,
}, jsf, widgetLibrary));
}
}
Based on how this parses layouts, it goes bottom up. If you have a child array, it will create its layout first. Then when it gets to the parent array, it will use code piece 2 to add items to the parent array based on the child it already created. It only creates one version of the child, which is where code piece 1 comes in. If you create data that has two elements in the parent and the second parent item has elements in the child array, the child array of the first parent element will have the same number of items as the second element. (This is because it's replacing the dataPointer dashes with a 1 always and not 0 or a correct index).
I am currently investigating a fix for this! Will respond back soon!
from ajsf.
Stale issue
from ajsf.
Another issue unresolved and closed by a bot .... @hamzahamidi Can you please reopen this issue?
from ajsf.
Related Issues (20)
- Error/Validation messages don't appear in red in bootstrap-4. Using CSS did not resolve issue.
- Angular 13 support HOT 1
- validationErrors: submit is enabled even if function return false HOT 1
- Reset Json Schema form
- support bootstrap 5
- Some performances issues with recent versions of Edge ?
- Warnings due to CommonJS or AMD dependencies which can cause optimization bailouts
- additionalProperties aren't displayed HOT 2
- customized widget doesn't return a value HOT 1
- The `None` item in enum dropdown lists considered as `"null"`
- [Question] How to implement your own UI components along with custom styling?
- NullInjectorError: No provider for Framework! HOT 1
- Angular 15 material design support HOT 2
- Get rid of deprecated FlexModule dependency HOT 2
- multipleOf validator uses default remainder operator to validate which results in incorrect result
- Invalid appearance "standard", valid values are "fill" or "outline".
- providing default values to components
- "defautWidgetOptions" typo
- Nested array, last element controls surfaced data
- Fieldset along with the Select all checkbox.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ajsf.