I have three tables in a page. When I click on a button, I update only one of the tables. But since I use request scope on button event, the page reloads fully and updated value gets lost. Can you suggest a solution, so that my data will be displayed after button event.
Have you tried to set partialSubmit="true" in your button? If you set this attribute, you must set in each table a PartialTriggers to the button.
I hope help you.
Marcos.
The data has to be in the viewScope/pageFlowScope depending on whether its in a bounded taskFlow or not.
And in your button event you need to update the data in the viewScope/pageFlowScope and then bind your tables with those data.
All the event handlers can be in backingBean scope and not necessarily be in requestScope.
Related
I am creating an hyperlink that will be send to user mail(gmail in my case). I want to expire the link after user once clicked in it(I don't want the user to click more than once).Once user clicked on the link it will trigger subsequent mail to manager. Here I also want similar functionality.
Note: link has some encrypted data too.It should remain intact.
I solved the issue.Instead of relying on session.I am using last update value in DB to check the life of hyperlink.
Does anyone know how to cancel the editing state of a Vaadin TextField that's inside a Table? My concrete use case is that I have a table with multiple TextFields in it, that show different values when they are edited as opposed to viewed. The user clicks on a TextField, this makes the field display its editable content. If the user changes his mind and wants to stop editing the field (by pressing ESC) the field should cancel any changes the user might have made to its content and revert to displaying its view value.
So far I've been able to move the focus to another TextField but this is not what I ultimately want to achieve. Moving the focus to the parent Table would be acceptable, but doing so programmatically by calling table.focus() does not produce any visible results.
Thanks for your help,
Radu
To revert the value of any field - including TextField - before it gets committed, AbstractField#discard()
Suppouse I have a dataTable, with one of it's columns being a commandLink, which opens a rich:modalPanel with detailed info about the item. The question is, whether the #DataModelSelection field will still have the row on which I clicked on the commandLink when the modalPanel is open? Currently I try to show one of items' fields with simple outputText and it's not rendered.
Ok, reading the following article helped.
I am writing a Java application for digitizing a group of documents in the office that I am working in and I am wanting to check if 5 textfields are populated and 4 combobox fields as well before the save button is enabled (I have it checking if i press a button (that happily says "Check"), but i would much rather have it auto-check to see if they are populated or if they are null).
If it makes a difference i am using NetBeans for this project.
Basically I need the fields to have something in them before the document can be saved.
Any and all help will be greatly appreciated as this is the final step in creating this application... :D
Thanks,
Erik
There are two ways (I can think of):
1- Put a listener on each field, this listener will be triggered when the field is populated. Inside the listener increment a counter for example, or set a flag. If all flags are set or if the counter reaches (9 in your example) then enable the button.
2- Enable the Save button, but call a validate() method before doing the Save action. Any unpopulated field will have a red mark beside it (shown by validating) like in web applications.
I have the following mask/view:
After entering the name and description, I can add a list of existing attributes by clicking on "Add existing" button.
This opens another mask/view, where I can select from a list of existing attibutes. This (new) mask/view has it's own controller and model too.
When I'm finished with the selection, I have another button that bring me back to this mask.
The problem is that when I come back the name and description fields are empty.
This happens because when I click the "Add existing button" the controller/model of this mask is not called and the values are not stored.
How can avoid this and have the values stored?
Thank you for any help
Francesco
This only works if the new view is inside the same view. E.g. when it's an overlay dialog which is presented by a hidden <div> and not a plain window.open() popup window. This way the beans will have access to each other and you will be able to execute ajax updates instead of submitting/refreshing the entire page.
This is pretty complex to homegrow if you're not that familiar with HTML/CSS/JS. I suggest to look at a component library which offers such a component like RichFaces' <rich:popupPanel> and PrimeFaces' <p:dialog>.
You can store data in session or conversation bean.
Session bean approach have huge drawback when user works in multiple tabs/windows - he uses only one session bean, so he overwrites what he did in other windows.
Conversation scoped bean solves this. But conversation scope was not in javaEE 5, its in CDI (part of EE6).