java - Setting a parameter from a backing bean -


I am creating a CRUD web application using JSF and created an add form to create a new unit Which is maintained in the database. When successfully saved, I would like to navigate the user to the page where the details of the newly created unit will be displayed.

For more information, what I do not want to do is to create a navigation rule where a successful user is saved, it is delivered to "Commodation Details .xml" I "Face-Navigation.Xml" And this part works fine.

My problem is that I have to pass a parameter that allows me to bring the newly created institution ID. Bellow, add form has buttons.

  & lt; P: command button value = "save" action = "# {dilution.save ()}" & gt; & Lt; F: Action Listener Binding = "# {dilution.prepareForSave ()}" /> & Lt; / P: CommandButton & gt;   

When called dilution.save () (which also 'saved' on the success of the navigation case), the unit will be established She goes. Depression is a view that Bean has been managed.

Looks like this:

  public string save () {slave.cent (dilution); Return "saved"; }   

after das.create (dilution) is called the dilution unit. How can I do this?

get your "Compute Dictate." @ViewScoped Managed Been , Which will be the dilution ID you want to load:

   metadata>      

With this code you will set your desired ID and later, you will find You can load it from the DB with the loadDilution method.

Now, when you save, how to navigate it? Just use the built-in navigation.

 < Code> Integer ID = Slave. Creating (dilution); Return "Commutation dip? See also:   
  • / Ul>

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -