Comments (12)
When you look at normal browser behavior, it's what you see.
I've made a little video in my application showing the issue when the user wants to input a Date into a SpreadsheetView :
https://gfycat.com/SpiritedSmoggyAcornweevil
from jfxtras.
Well, if I understand it correctly, it is a JavaFX TextField problem. The date/time textfield reuse the prompt text, so Jonathan should fix it. Would it be of much use if only the date/time textfields would have the correct behavior?
OTOH (I get your point), if we can fix it until the TextField fixed, why not...
from jfxtras.
Well at first, we had the behavior in the common browser where the prompt text was seen until something was typed. But this issue came in : https://bugs.openjdk.java.net/browse/JDK-8100686 and said that in Windows, when the focus was in, the prompt text should be gone..
So this is never going to be fixed in JavaFX I believe..
I can directly have the behavior I want in my application by doing the CSS trick, so really, it's whether your want this behavior by default in your textField date/time controls or not.. Thus the "enhancement" tag..
from jfxtras.
Well, I think the TextFields should behave as normal textfields do. So my question is: why do you want it differently? As I see it, your problem comes from that there is no textfield visible until the focus is placed. In that scenario you create the textfield AND put the focus in there, so the prompt text is never displayed. This holds for all textfields, so we should find a solution that you can apply to all textfields, like a decorator maybe? Can a TextField know when it is being used in a table?
from jfxtras.
But this is something that is an issue for TableView as well, isn't it?
from jfxtras.
Yes It's an issue in the TableView because of what you described. As soon as the TextField is shown, the focus is in.
I though this issue would be annoying to other person, if not, we can close this issue and keep the current behavior.
from jfxtras.
I think you are right and that your solution is better for a TextField in a TableView. But it is a problem for all TextFields in TableView. I do not think patching just the JFXtras date textfields is the way to go. We need a solution for all textfields.
from jfxtras.
Maybe it is possible to create a TableViewPromptTextPatch. Any TextField that is used in a TableView should be added to an instance of that class. The patch class will add the prompt.css (that is a resource to the patch class) to the stylesheets of the TextField and start listen to the text-property, adding or removing the prompt class as needed. In this way you have one solution for all TextFields.
Or even better: we create an extended version of TableView in JFXtras with this functionality build in.
from jfxtras.
Well, this promptText is annoying in the date because we really want to parse the date.
Other Textfields are usually used for double or integer, and I don't put any promptText on them because I do not expect any particular format. Just a number.
I think we could go simpler if we want to patch the TableView (as a side-note, I'm using that in the SpreadsheetView of ControlsFX, not in the TableView right now), by adding in the css this :
TableView .text-field{
-fx-prompt-text-fill: derive(-fx-control-inner-background, -30%);
}
Each TextField in the tableView will have the prompt text "fixed" I believe.
from jfxtras.
Hmmm, you simply need to test. TextField will change things in its CSS in order to hide and show the prompt text, and this should override (negate) the normal behavior. I'm not sure it will.
You could try and convince the spreadsheet guy to 'handle' the textfield. But since you specify which editors to use, the TableViewPromptTextPatch should work. Never the less I'm pretty sure it should not be done as default behavior on CalendarTextField and friends, since it really is a TableView induced problem and should be handled for all textfields.
from jfxtras.
I just tested it on the SpreadsheetView by adding
.spreadsheet-cell .text-field{
-fx-prompt-text-fill: derive(-fx-control-inner-background, -30%);
}
And it works. The Textfield is actually not changing things on the CSS, or at least it is not bothered.
By the way, I'm the "Spreadsheet guy" of ControlsFX^^. I created the SpreadsheetView. I will see what I can do, but on my application, the issue is fixed by simply using css. We can close this issue regarding JFXtras.
from jfxtras.
Very good spreadsheet guy. :-)
from jfxtras.
Related Issues (20)
- Error setting calendar for CalendarPicker HOT 17
- Agenda hours HOT 1
- JFxtras UI bug when try to switch skin into day view and week view HOT 3
- JFXtras not building HOT 1
- Module trouble with VFXWindows-samples HOT 1
- Broken versioning in Maven Central HOT 1
- NullPointerException when parsing VCalendar HOT 1
- Microsoft Outlook use different time zone id's HOT 6
- DateTimePicker in Vbox with Hgrow not working HOT 3
- NullPointerException when opening advance edit or edit on already created event.
- Exception with HOT 7
- how can use gsls shader in javafx? HOT 1
- how to use JFxtras with Scenebuilder on Netbeans 8.2? HOT 1
- Maven jfxtras-test-support Test Scope HOT 10
- Minor - Broken link
- Release JFXtras built on JavaFX 17 HOT 1
- incorrect link HOT 2
- JMetro dark theme with localDateTimeTextField barely readable HOT 4
- Agenda with specific hour range HOT 3
- Agenda display appointment
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 jfxtras.