I have a dropdown listbox on my main page with a button on the same page that launches a pop-up dialog box, also having a dropdown list box. I need the selected index of the 1st listbox control to be synched with the pop-up dialog dropdown listbox.
I have added code to my Controller that sets the index in the ViewData object to be retrieved by the popup and it works on the initial launch of the App. My problem is any subsequent launches of the pop-up dialog won't hit its corresponding code to set the index using the ViewData. The code that needs to be executed is:
<%= Html.Telerik().DropDownList()
.Name("DataStoreTypeId")
.BindTo(new SelectList(Model.DataStoreTypes, "DataTypeId", "Name",Model.DataTypeSelectedId))
.HtmlAttributes(new { style="width:205px })
.SelectedIndex((int)ViewData["SelectedIndex"])
%>
Coming from an ASP.NET background, I am accustomed to having postbacks as mechanisms to handle these types of actions, but MVC has trimmed the postback events which is great for performance but what are my options to force code execution now?
Should I be using other alternatives?
First time it works because its value is set on server side. once its rendered in the browser there is no server side left. you have to manually change the selected value of your telerik dropdown list on button click event next to your first drop down list (is first DD also telerik dropdown or html one). For client events of telerik dropdown have a look at Telerik Demos for asp.net mvc
Related
I have a dialogue box that is:
Draggable
Modal
Requirement:
I have a requirement where I don't need to close my dialogue and have to load the different pages in the background on the selection of data from the grid that is on Dialogue.
What did I do:
I know how to open the page in the background with the help of a de-attached listener.
vehicleInfoPopUpView.addDetachListener(e -> {
UI.getCurrent().navigate(AssignmentPageContainer.class,
String.valueOf(vehicleInfoPopUpView.getCanFileNumber()));
});
The above code (in the parent page) loads/opens a new page but to do this I have to close my dialogue box (which I don't have to do, I have to keep the dialogue box open).
I cannot find any resource that tells me How to load/open a new page in the background from the dialogue box without closing it
Any small help! Thanks for the help in advance.
First of all: Don't.
Keeping a modal dialog open whilst navigating to a different page/route makes no UX sense. A modal window means you cannot interact with the background.
Just call UI.getCurrent().navigate(AssignmentPageContainer.class) directly (outside of detach listener) to open the view based on the selection. The user will open the dialog again himself, if he will want to. You can trigger this on some button click.
Secondly, as a workaround you could store the state of the dialog in a #UIScoped service and open & reinitialize the dialog f.e. in the afterNavigation method.
In a Vaadin 14 application I wanted to exchange this standard icon at a combobox:
for another icon (and achieved the goal, but I think that my way is not the best / nicest).
My full use case is assembling a list, some buttons and a combobox to create this sortable multi-select-list:
The user can add a new value to the list by selecting the new value in the combobox below.
To exchange the standard icon for the combobox (--lumo-icons-dropdown = \ea18, an arrow showing down) for a plus-icon, I used this code: combobox.getElement().getStyle().set("--lumo-icons-dropdown", "\"\\ea23\""); (yes, all the quotes and backslashes are as shown)
This works fine (as you can see in the screenshot), but it feels incorrect to overwrite an icon.
Is there another (better) way to exchange the standard dropdown icon at a Vaadin combobox for another icon?
JSF has autocomplete functionality with enablemanualInput but whenever I try to input a new value which is not present in the dropdown list it turns red and dropdown keeps open to show that no such entry is available. I want to replicate combobox functionality currently present in html/JQUERY UI. Is there any way to do so.
I am facing problem with Kendo Combobox control for mobile view. If I focus it; then it brings virtual keyboard and combobox data goes down. It makes problem for mobile view only.
Please consider following control form jQuery mobile
http://demos.jquerymobile.com/1.4.2/selectmenu-custom-filter/
It is perfect for mobile view. It brings new window; from where user can choose data. Is there any equivalent control in Kendo which fits with mobile view?
I have a web part connected to another (provide a row to). It shows the radio button that when clicked correctly provides the data to the second web part.
Can I have this radio button selected by default so that it automatically provides the filter data as soon as the page is loaded?
if you find any jquery/javascript relevent to this please share it and will be more helpful to me.
When you click the radio button from jQuery, the event should be raised as well:
$(document).ready(function() {
$("input:radio[value='your-value-goes-here']").click();
});
Be cautious if you use the value more than once on the page! If possible address the radio button with an id:
$("#Your-Radio-Button-Id").click();