I have a html drop down list in my web site. When the user selects a particular item in the list I want it to be shown in all the pages when the user navigates through the site.How Can I do that??
I am using visual studio 2010 and mvc3 views. Currently what happen is when the user selects a particular item,the selected value only stays for the current page, when I go to another page, the default value, which is the very first item in the list is shown.
How can I have persistent dropdown list value??
Thanks.
There are different ways to achieve this. You could store it in Session or Cookies. So for example on the first page create a form containing the DropDown with a submit button. When the user clicks on the submit button the form will post the selected value back to the server and the server could either store it in Session or client side cookie. Then the controller action could redirect to some other action which will be able to retrieve the value. And from now on this value will be available on all subsequent requests.
Related
I want to make it so that people can log into an account that they've made using a signup form and I also want to make it so that when the account is created they it makes a profile page where they can edit their profile picture, banner, and bio.
I'm very new to well... everything so I need this explained in as much detail as possible.
The concept is simple, consider the following
1.It can be done if you have implement a login system. First you should have page for the user profile, like changing name, picture, etc....
2. Once they register you store the data in the db, with the user id (it can be auto increment column.
3. In you navigation have link for user page, once use click it show page you created for user profile.
4. When user login, store their user id in session, then based on their user id you can retrieve the information and show.
5. The entire page input elements has to be inside a form tag, so if user edit something and click on the update button (or any name you wish) it will update the values in the db.
Basically in the register you will have the insert coding for the user table, and in the user profile page you will have the update coding.
Hope you get the idea!!
Currently I have a sample which I'm working on which is a basic master details page. This sample uses react-router-redux. Within the details panel I have a number of tabs which use can see different facets of the selected item... all fairly standard stuff.
When the user selects an item from the master list, the URL that the clicked <Link ... /> send them to is something like customer/123. Within the route that is registered for that url (i.e. :id), I have an indexRoute route which replacess the route to default route/tab /customer/${nextState.params.id}/address.
All this works well and the user can navigate between tabs just fine. The problem comes when the user closes the detail window and selects a different detail. As expected, it opens the tab based on the route specified by the indexRoute. Under normal circumstances, this might be fine but I want it to remember which route was selected. I'm wondering if anyone has ideas on how this should be done?
I think I can do achieve this by registering a callback with the onClick event of the Link and dispatching an event which will result in key of the selected tab being saved in the store. Then within the onEnter of the indexRoute I can access the store and pull out this saved state and target the replace to this that item.
This should work but seems like a lot, just wondering if this seems right to other?
I would use the same approach - dispatch an action when the tab is clicked and store the tab key in the store.
Use mapStateToProps to retrieve the value.
I have a jsf web application that consists of three pages that collects customer information.
Once a customer completes the first page it is submitted, validated and stored to the managed bean. On the second page the customer completes half of the questions and clicks my previous page button which is a jsf command button with the immediate attribute set to true which skips validation and form submission. The issue I have is that the half answered questions on the second page are now lost so that when the customer clicks next on page one to return to page two the questions they have answered will be empty.
Is there a standard way in JSF to archeive this? I previously used Struts one which handled this behaviour.
Thanks
Tom
In every page loads, jsf builds the view with current controller values. If you did not save this values to the controller bean, they will simply get lost.
to avoid sending the form on your button, simply send the data back to the controller per input component using ajax on the onchange event.
We are currently building a request form in html that will allow users to look through a learning catalogue and if they want to apply for it they click the apply button which takes them to a request page and automatically chooses the resource from a drop down to save them having to choose it themselves.
Is there any possible way to do this?
Thanks.
I have created a report which contains a number of parameters so that the user can filter the data.
By default the show/hide paramters tab is closed.
To access these parameters the user needs to click on the usual button to expand the header area and view all the possible parameters.
This is all fine, I want the parameters to be hidden by default as it take up a large proportion of the report and not everyone wants to see them.
What I do want however is to create a text box called 'Use filtering' or something similar and create an 'action' so that when this box is clicked on the URL for the report with some sort of additional command on the end included so that it reloads the current page but with the command to show the parameter pane.
I have tried adding the following to the URL of the report page but it does not work:
&rc:HeaderArea=full&rc:Parameters=true
and also
&rv:HeaderArea=full&rc:Parameters=true
All it does it reload the page but with no changes to the parameter pane.
Can anyone point me in the right direction here.
If you want to use these parameters, you must load the report via the Web Service URL rather than the front end URL.
Typically on a standard install these are http://MyServer/Reports (Front end) and http://ReportServer (WebService). Only the WebService URL will accept the parameters you are trying to use, the other will just ignore them, hence why the report is loading but not observing the parameters your passing to it.