I have a requirement where clicking each errors should focus input box. I am trying different ways but could not succeed. I got some answers in the past but that did not work like i wanted.
I was using tag with onclick event but I had to do this for each input boxes which is not so relevant if I have 20 fields. So I was looking some thing dynamic .for eg: .
Its has been a long I am looking for this solution. Any kind of help or suggestions would be highly appreciated.
Can you consider this -> Instead of showing all the error messages on top, you can show the error message along with the input box which is related to this input box. The h:message have a attribute for which you can use.
Other option would be developing custom renderer which will output onclick event for each error message. The error message have the component id so you can use that id to set the focus in javascript. This will be all dynamic.
Here is some information about implementing custom renderer http://java.sun.com/javaee/javaserverfaces/reference/docs/customRenderKit.html
Related
I'm working on a java project using Eclipse, javaFX, TableView.. My application is available in three languagues and user can change it from the Setting corner in the app and everything goes right, but i noteced that when a table is empty it show this message or hint line:
As you can see even if user change language this line still in french(My system language) and i don't find any way to change it, change its content or hide it..
Please if anyone can help me in this just post an idea or comment.
Thanks..
Try this to set the empty tableview message accordingly each time when language is changed: tableview.setPlaceholder(new Label("Empty tableview!"));
I want to create an installer, which downloads files from a URL which is going to be a default value if the Text is blank, and the "hint" will be
Insert your specific URL
And I'm wondering how to add the hint?
Have a look at the documentation of Text. Especially the method setMessage(String):
Sets the widget message. The message text is displayed as a hint for the user, indicating the purpose of the field.
I'm looking for a solution to this and I have searched the web for an answer with nothing. I need a scrolling message on my webpage that can be updated by the same website but on a different page. (e.g www.webpage.com <-- has the scrolling message on it, www.webpage.com/settings <-- has a form in which you can change/update the scrolling message)
I'm pretty sure this is achievable with Java, but my knowledge on Java is slim and all my efforts have come to a fail. I have managed to get a scrolling message on my webpage and I'm sure if I could read a text file (with the message in) then assign that to a 'var', I could make that scroll but I don't know how to do that.
If you know a completely different method of doing this I am happy to change mine.
Thanks in advance,
Tom.
I would recommend javascript instead of java, since java is not really conventional anymore and looks ugly too (and requires a special plugin).
It depends on how fast you want to update the scrolling text how you want to do this. I would say save the text to a .txt or database from settings, and then have your page get it.
You can then use php to read the value from the .txt file or database to display it on your website.
If you want it to be extremely up to date you can let javasript call a little .php file that reads the file and gives you the content.
To make your text scroll you don't really need anything other than html, like so:
<marquee behavior="scroll" direction="left">Your scrolling text goes here</marquee>
You can read more about that here: http://www.quackit.com/html/codes/scrolling_text.cfm
I intended to give user a chance to confirm their action by adding JavascriptEventConfirmation as the example from this tutorial :
https://cwiki.apache.org/WICKET/getting-user-confirmation.html
However, I want to be able to check first if there is at least one checkbox (out of mulitple) is being checked before displaying the confirmation dialog.
How can I achieve this?
Note that the confirmation is implemented via a simple javascript snippet that is added to the button tag's onclick attribute.
To add the verification, just change the generated snippet to fit your needs.
I need to provide context sensitive help in my GWT application. For this every GWT view will have many help links each of which will open a dialog box with appropriate help text (different for each link). The problem is I cannot have so many ui:field elements each with unique name and click listener in my view classes as the number of help links may be very large. What I need is to have many Anchor elements in my UI binder xml file and all the anchors should have the same click listener. The click listener will decide based on some parameter which help text to display in the dialog box.
I tried to use Hyperlink element with different history tokens for all links, but it changes the history which is not desirable. I just want to show a dialog box with appropriate help message without modifying history.
Is it possible in GWT?
Thanks for your help.
You can obviously use <g:Anchor href="javascript:;"> in your UiBinder and later add handler in your code.
But, since you have a lot of this all around your app I'd use gwtQuery:
$(".help-link").click(new Function(){
public void f(Element element) {
// do something here
// `element` tells you which element triggered the event
});
then I'd just add css class .help-link to all relevant anchors.