java


Vaadin passing data to View


I have this Navigation bar:
When clicking request button, this piece of code is executed:
getUI().getNavigator().navigateTo(viewName)
How I can pass Select1 and Select2 data to another controller or view when navigateTo is executed ?
You can pass then to the navigator like this:
getUI().getNavigator().navigateTo(viewName + '/' + value1 + '/' + value2);
This will appear in the URL like this http://website.com/application#!viewname/value1/value2
You can get the values in your new view like this. You will need to expand this code to cope with no paramaters. Also since users can change the URL easily you'll need to validate that values are acceptable too.
#Override
public void enter(ViewChangeEvent event) {
String args[] = event.getParameters().split("/");
String value1 = args[0];
String value2 = args[1];
You need to use URI fragments. Here are official links:
Managing URI Fragments
Using parameters with views
and, example code:
getUI().getPage().setUriFragment("value1,value2");

Related Links

How to get particular list index in java?
Selenium Server, click by locator in ASP.NET Web Pages work unstable
VideoView taking correct space but video not showing up on complete area
Kafka consumer in Spark Streaming
Finding repeated code in a file and print those repeated codes to another file
Issue executing a full sentence in loop
Is there a simple, native Java-based method to persist data?
HashMap's KeySet, EntrySet, and values are null while table is not empty
Set inheritedByDefault to false in plugin.xml
how to find the maximum subsequence sum in a circular linked list
#OrderBy Annotation in Hibernate Not Working
Java socket with http multipart formdata POST method
Android ViewBadger not showing
How to Convert 1 - 1000 into words? [duplicate]
what's the object in the method actionPerformed(ActionEvent e)
Reference of a Class ? How does it workout in memory?

Categories

HOME
arduino-uno
date
hook
oracle11g
drivers
graphql
angular-ui-bootstrap
azure-media-services
here-api
spring-kafka
rascal
hapi
http-status-code-504
intentfilter
mmap
microsoft-r
dxf
android-widget
kannel
elasticsearch-ruby
neo4j-spatial
large-file-upload
webkitspeechrecognition
delicious-api
junit5
jspresso
webtest
framemaker
azure-sql-database
sequential
wixsharp
git-merge
hue
ncalc
bootstrap-dialog
avconv
fault
network-flow
boost-multi-index
gabor-filter
nstextview
snmptrapd
watchconnectivity
removechild
fody
mathematica-frontend
react-native-listview
blackberry-10
associative-array
qtableview
ios9.1
remobjects
geonetwork
sorl-thumbnail
typekit
javafx-webengine
asp.net-web-api-odata
php-5.4
didselectrowatindexpath
resty-gwt
mbr
tidy
quartz-graphics
mqx
chuck
tridion-worldserver
external-accessory
xmlspy
disclosure
audio-capture
lzh

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App