> > private String[] publisherName; //why is this an Array of String instead of > > String publisherName;
I had it as String but after seeing the error I modified it to String[] and tried that. > MG>where are you setting the publisherName?.......... in constructor of > Action class? I did not set the default value. Tried to submit without any value and was getting error. > MG>where is your subscribe javascript function? do have the subscribe javascript functions. But it's still not working I do have the subscribe javascript functions as below. Tried similar to the one in example and later modified too. I tried doing this onSelectTopics of first autocompleter to select value of the second autocompleter but didn't work. Any suggessions? First autocompleter <sj:autocompleter ........ onChangeTopics="publisherDescChange" onSelectTopics="publisherDescSelect" ..... /> Second autocompleter <sj:autocompleter id="publisherCodeId" ......... listenTopics="publisherDescChange" /> $.subscribe('publisherDescChange', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('<i>'+message+'</i>'); }); $.subscribe('publisherDescFocus', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('<i>'+message+'</i>'); }); $.subscribe('publisherDescSelect', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('<i>'+message+'</i>'); }); > From: mgai...@hotmail.com > To: user@struts.apache.org > Subject: RE: OGNL error --- Unexpected Exception caught setting ... on > 'class......... > Date: Wed, 26 Aug 2015 21:10:52 -0400 > > > > > > From: zy...@hotmail.com > > To: user@struts.apache.org > > Subject: OGNL error --- Unexpected Exception caught setting ... on > > 'class......... > > Date: Wed, 26 Aug 2015 19:42:36 -0400 > > > > Have a Publisher class with attributes > > Publisher --->class > > name > > code > > > > Action class > > private String[] publisherName; //why is this an Array of > > String instead of String publisherName; > MG>where are you setting the publisherName?.......... in constructor of > Action class? > > > List<Publisher> publishers= new ArrayList<Publisher>(); > > > > getters and setters for the same too in it. > > > > > > JSP > > <sj:autocompleter > > id="publisherNameId" > > > > name="publisherName" > > > > list="%{publishers}" > > > > listValue="name" > > > > listKey="code" > > > > listLabel="code" > > > > selectBox="true" > > > > selectBoxIcon="true" > > > > key="label.publisherName" > > > > onChangeTopics="publisherNameChange" > > > > onFocusTopics="publisherNameFocus" > > > > onSelectTopics="publisherNameSelect" > > > > size="34" > > > > maxlength="34" > > > > /> > MG>where is your subscribe javascript function? > > > > When I don't select anything in autocompleter and submit the form seeing > > this in console > > Unexpected Exception caught setting 'publisherName' on 'class > > com.xxx.createAction: Error setting expression 'publisherName' with value > > ['', ] > > > > when I select something in autocompleter and submit the form seeing this in > > console > > Unexpected Exception caught setting 'publisherName' on 'class > > com.xxx.createAction: Error setting expression 'publisherName' with value > > ['macode2', ] > > Unexpected Exception caught setting 'publisherName_widget' on 'class > > com.xxx.createAction: Error setting expression 'publisherName_widget' with > > value ['macode2', ] > > MG>Looks like corruption of values for variables publisherName and > publisherName_widget > MG>can you get a senior guy from your team to oversee what you're doing? > > > > Is this the right way to declare in the Action class for autocompleter? > MG>if none of your action variables are populated then the answer would be no > > > Please need help on this. > > > > >