JSF transfer an object - jsf-2

I have a list of users (id, username, etc.) which I gain from the DB
I have an index.xhtml (jsf tags) that I'm using to display all the users
I have a dataTable which displays all the data for a user on one row. On the same row I have a button called "edit". On click it goes to another page "edit.xhtml"
Q: How to get object on which I clicked "edit" in index.xhtml to edit.xhtml ?

Related

Dropdown is not saved by SubmitForm in PowerApps

I have a dropdownlist filled from sharepoint list, the control is working fine show the items and allow select item, but when I execute the SubmitForm(FrmXXXX) all fields are saved but not the dropdownlists,

How to append a empty row to a list/table which is bound to a OData(List Binding) in sapui5?

I have have a list/table which is bound to a entitySet from OData Model V2. I have a add(+) button on screen on clicking that button a empty row(s) need to be appended to the list/table. After that if I enter any data that should be saved into the backend on clicking of save button.
This is possible using JSONModel, but I want to use the OData model .
Regards,
Suman Kumar
It does work with two way data binding.
You can do that using odataModel createEntry method.
The createEntry expects a parameter, the path to your entitySet that you want to create (It should be something like XXXXset). Imagine the following:
1 - User clicks an "Add" button that renders a dialog Window with some fields and two buttons (save and cancel) for him to add his brand new entity.
2 - On the "open event" before you open the dialog, you create a new entity with the createEntry method. Its return gives you a context that you can bind to the dialog.
that.contextCursoIniciativaEmpregadoASerCriada = that.getView().getModel().createEntry('/CursoIniciativaEmpregadoSet');
that.fragmentCriacaoDadosInicEmpregado.bindElement(that.contextCursoIniciativaEmpregadoASerCriada.sPath);
that.fragmentCriacaoDadosInicEmpregado.open();
3 - The dialog pops up with the bind in place.
4 - The user fills the dialog with the entities properties
5 - The user clicks on the save button and you submit your changes

How to retain values of dropdown with selected values in MVC?

The scenario is - There are two view in my mvc application. One is Index and other is for adding payment details. in index form I fetch details of a perticular client in that I have cascading dropdown one for selecting type and one for according to type select client in another dropdown, both are coming from DB's and on d same view I have an ActionLink for going on Payments view "for adding the payment details for the same client that is been selected on Index views second dropdown (first is for Type)".
My problem is that when I am going on Payments view and clicking back button of browser to go back on my index page it is clearing the second dropdown. and all other data is safe on the form. So can you please help me to avoid this so that all the data of my Index view should retain throughout the execution.
This also in case when I add Payment for that client and click submit it should redirect on the Index view with retaining all its previous data. that we have fetched on Index page.
with a message box Payment Added successfully.
You can save the current selected values of dropdown1 and dropdown2 into one of the followings:
URL
Session
Cookie
Then in the Index page you always check to read those values if they are existed to setup the dropdowns in the first request. Then do update those values again whenever user selects to update the dropdowns.

passing a list of objects from jsf page to another

I am new at JavaServer Faces (JSF).
I have a list of cars and after pressing the commandButton of my first page I want to show the list in the other page (the backing beans are RequestScoped).
I have seen examples where you can only pass String values.
if you have list of cars, it means you have data table or some another list which is coming from managed beans. if you want show whole list in the next page, you need just call the same list from next page.
if you want pass only one row /object, you should pass row/item id via f:param , in the next page from another managed bean you should handle id and call from database getItemById(id) and in the page show item.

Edit multiple rows in Table Struts2

I am displaying a list of data returned from database to JSP.
Now, this list has fields that are editable. And user can select more than 1 row to edit.
My requirement is to display the list, override the list(which has dropdown and checkbox fields that can be overridden by user) and then all of it to be saved to database.
I used displayTag to display the data, but now User editing few fields and populating that table to Action class part I am not able to get.
Can you give some suggestions?
May be other than displaytag also?

Resources