-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: Handle invalid input in TimeFieldMinMax, resolve missing CSS reference, and remove classnames #110
fix: Handle invalid input in TimeFieldMinMax, resolve missing CSS reference, and remove classnames #110
Changes from 2 commits
dda24b6
4eca806
5759035
2b14eff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.webforj.samples.views.fields.timefield; | ||
|
||
import com.webforj.App; | ||
import com.webforj.annotation.InlineStyleSheet; | ||
import com.webforj.component.Composite; | ||
import com.webforj.component.button.Button; | ||
import com.webforj.component.button.ButtonTheme; | ||
|
@@ -14,7 +13,6 @@ | |
|
||
import java.time.LocalTime; | ||
|
||
@InlineStyleSheet("context://css/fields/timefield/timeFieldMinMaxView.css") | ||
@Route | ||
@FrameTitle("Time Field Min/Max") | ||
public class TimeFieldMinMaxView extends Composite<FlexLayout> { | ||
|
@@ -38,14 +36,15 @@ public TimeFieldMinMaxView() { | |
.setMax(max); | ||
|
||
meeting.setLabel(label) | ||
.onModify(e -> { | ||
try { | ||
meeting.setText(e.getText()); | ||
confirm.setEnabled(true); | ||
} catch (IllegalArgumentException ex) { | ||
confirm.setEnabled(false); | ||
} | ||
App.console().log(meeting.getValue() + ""); | ||
}); | ||
.onModify(e -> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
try { | ||
LocalTime parsedTime = LocalTime.parse(e.getText()); | ||
meeting.setValue(parsedTime); | ||
confirm.setEnabled(true); | ||
} catch (Exception ex) { | ||
confirm.setEnabled(false); | ||
App.console().log("Invalid time input: " + e.getText()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no browser console logs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
} | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do something useful with the confirm button. A toast ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented a toast to confirm the action