Skip to content

Support for number inputs (Numeric and Integer field types). #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Document name="restforms2-ui.zpm">
<Module>
<Name>restforms2-ui</Name>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Description>Client for restforms2</Description>
<Packaging>module</Packaging>
<SourcesRoot>src</SourcesRoot>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/ui/form/form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<!-- Numeric -->
<ng-container *ngSwitchCase="FieldType.Numeric">
<input
type="text"
type="number"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type="text" was purposefully, because styling of numeric controls on different browsers/platforms can be different. If you want this type, I'll check it later

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to send Integer/Numeric fields as numbers, not strings which input type text did.

Specific input type can be anything you think is right.

[id]="'prop' + idx"
[class.invalid]="!vs.get(prop).isValid"
[(ngModel)]="data[prop.name]"
Expand All @@ -95,7 +95,7 @@
<!-- Integer -->
<ng-container *ngSwitchCase="FieldType.Integer">
<input
type="text"
type="number"
[id]="'prop' + idx"
[class.invalid]="!vs.get(prop).isValid"
[(ngModel)]="data[prop.name]"
Expand Down
1 change: 1 addition & 0 deletions src/app/services/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export class DataService {
return FieldType.String;
case '%Library.DateTime':
return FieldType.TimeStamp;
case '%Library.Integer':
case '%Library.BigInt':
case '%Library.SmallInt':
case '%Library.TinyInt':
Expand Down