Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
ComboBox does not display the dropdown list with items
I have a simple Liferay Portlet Vaadin application class:
public class TestApp extends Application implements
PortletApplicationContext2.PortletListener {
private Window fDisplayWindow;
public void init() {
fDisplayWindow = new Window("Test App");
setMainWindow(fDisplayWindow);
// Check that we are running as a portlet.
if (getContext() instanceof PortletApplicationContext2) {
PortletApplicationContext2 ctx = (PortletApplicationContext2) getContext();
// Add a custom listener to handle action and
// render requests.
ctx.addPortletListener(this, this);
} else {
fDisplayWindow.showNotification("Not running in portal",
Notification.TYPE_ERROR_MESSAGE);
}
}
/**
* @see MVCPortlet#MVCPortlet()
*/
public TestApp() {
super();
}
@Override
public void handleResourceRequest(ResourceRequest aRequest,
ResourceResponse aResponse, Window aWindow) {
if (PortletMode.EDIT.equals(aRequest.getPortletMode())) fDisplayWindow
.setContent(createEditContent());
else if (PortletMode.VIEW.equals(aRequest.getPortletMode()))
fDisplayWindow.setContent(createViewContent());
}
private ComponentContainer createEditContent() {
Layout locResult = new VerticalLayout();
locResult.addComponent(new ComboBox("Test to display",
new IndexedContainer(Arrays.asList(new String[] { "one", "two",
"three" }))));
return locResult;
}
private ComponentContainer createViewContent() {
Layout locResult = null;
return locResult;
}
@Override
public void handleRenderRequest(RenderRequest aRequest,
RenderResponse aResponse, Window aWindow) {
}
@Override
public void handleActionRequest(ActionRequest aRequest,
ActionResponse aResponse, Window aWindow) {
}
@Override
public void handleEventRequest(EventRequest aRequest,
EventResponse aResponse, Window aWindow) {
}
}
In this example everything is working fine after the portlet deployment, the combobox is displayed correctly in the EDIT mode of the portlet, but after the click on the arrow button of the combo box, nothing is displayed, no box with items for selection... What is wrong with my source code?
Last updated on Jan, 18th 2012
You cannot reply to this thread.