Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
allow properties to be hidden from a form - and hide the fieldOrField…
…Excludes from the forms as they are visible in the tree anyway #383
  • Loading branch information
jstrachan committed Jul 9, 2013
1 parent af19608 commit 8e331d8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hawtio-web/src/main/webapp/app/forms/doc/developer.md
Expand Up @@ -20,6 +20,24 @@ You can use "*" to refer to all the other properties not explicitly configured.

In addition you can use regular expressions to bind properties to a particular tab (e.g. so we match foo.* nested properties to Tab Four above).

## Hiding fields

You can add a **hidden** flag on a property in a JSON schema to hide it from the auto-generated forms. Or you can set its type to be **hidden**.

e.g.

properties: {
foo: {
type: "string",
label: "My Foo Thingy"
},
bar: {
type: "string",
hidden: true
}
}

in the above, the _bar_ property will be hidden from the generated form

## Customizing the labels

Expand Down
Expand Up @@ -197,6 +197,10 @@ module Forms {
propSchema = Forms.lookupDefinition(propTypeName, fullSchema);
}

// lets ignore fields marked as hidden from the generated form
if (property.hidden) {
return;
}
var nestedProperties = null;
if (!propSchema && "object" === propTypeName && property.properties) {
// if we've no type name but have nested properties on an object type use those
Expand Down
3 changes: 3 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/dozerMappings.ts
Expand Up @@ -22,6 +22,9 @@ module Wiki {
'To Class': ['class-b\\..*'],
'Class Configuration': ['*']
};
// hide the fields table from the class configuration tab
io_hawt_dozer_schema_Mapping.properties.fieldOrFieldExclude.hidden = true;

Core.pathSet(io_hawt_dozer_schema_Field, ["properties", "a", "properties", "value", "label"], "From Field");
Core.pathSet(io_hawt_dozer_schema_Field, ["properties", "b", "properties", "value", "label"], "To Field");

Expand Down

0 comments on commit 8e331d8

Please sign in to comment.