Skip to main content

How to use dojo combobox in JSF

4 replies [Last post]
Joined: 2003-07-09


I am trying to rework this blog entry so that it works for 9.4.1:

I am able to fill up the combobox using the service method. However, I cannot figure out how to bind the selected value (the value that the user clicked/selected) to a bean property. There is no longer a selected attribute for the dojo combobox.

Carla tells me that there will be a selected args, but this is for setting selected and I don't think I will be able to bind this to a bean property.

Can anyone show me how to get the selected value saved so that I can access it from the server end?



Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-07-26


I am trying to get Dojo Combobox to work with JSF
I am running on Tomcat 5.x

I am getting a textbox when I implements this.
My jsp is as follows:

<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="" prefix="h"%>
<%@ taglib uri="" prefix="f"%>
<%@ taglib uri="" prefix="t"%>
<%@ taglib uri="http://jmaki/v1.0/jsf" prefix="a" %>

<%@include file="/app/inc/TopMenu.jsp"%>


I have copied the ajax-wrapper-comp.jar and jmaki-resources-dojo.jar in the lib directory.

Is there anything I need to add/include


Joined: 2003-07-31


The value attribute should be mapped to a method that generates content that conforms to the model at:
Also you should use either a service or value but not both. Using a service will asynchronously load the data after the widget has loaded. Using a value will inline the value when the page is rendered.

I recommend using the value.

Joined: 2005-02-10

Hi Chris,

I'll look into the selected value problem and report back.

To get the value the user has selected I did
jmaki.addGlueListener("/dojo/combobox", function(args){alert("combobox value " + args.value)})

in the glue.js file and see the correct value. Once you have the value look at the getwidgetdata sample to see how to get that back to your server.


Joined: 2003-07-09

Thanks Carla,

I was already using getwidgetdata as my model. There were just some pieces missing when it comes to JSF. I am accustomed to simply binding the tag's args to backing bean properties to save off the data, such as:

(See, which is out of date but gives you an idea of how it used to be)

When I try the Glue way, I can't get the doAjax to work. I can't figure out what what to use for the URL. The response is always 404.

I have tried

url: "SessionBean1-comboboxSelection",
url: "SessionBean1.comboboxSelection",

jmaki.glue = {
eventComboboxSelected : function(args) {
var contentValue = args.value;
var contentId =;
if ( typeof contentValue != 'undefined' ) {
// send data back to server
jmaki.doAjax({method: "POST",
url: "SessionBean1-comboboxSelection",
content: {message: contentValue },
callback: function(_req) {
// handle any errors

I have searched the tests at for some kind of clue as to how we can save the selected value in a JSF app, but no luck yet.