Announcement Announcement Module
No announcement yet.
Disable Functionality Issue on Filtering Select Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disable Functionality Issue on Filtering Select

    Hi , i have created an ajax functionality through which i am populating data in my select boxes using ItemFileWriteStore class of Dojo.
    The functionality is that when i click on Author , Books of that Author get Populated.

    Using STS, Tomcat 6.0 , Jackson CodeHaus Json Processor ( jackson-mapper-asl 1.7.1)

    Here is the code

    public class Books {
    private long id ;
    private String name;
    public class Author {
    private long id ;
    private String name ;
     <field:select field="author" id="com_test_author" itemValue="id" items="${author}" path="/author" />
     <field:select field="books" id="com_test_books" itemValue="id" items="${books}" path="/books" />
    <script type="text/javascript">
             	 dojo.addOnLoad(function() {
                          var sourceWidget=dijit.byId(_author_id);
                          var targetWidget=dijit.byId(_books_id);
                         dojo.connect(sourceWidget, "onChange", dojo.partial(customEventHandler,targetWidget)); 
                                       function customEventHandler(target,value) {
     							url: "books/getBooks",
     							handleAs: "json",
     							content: {
     								id : value
     							load: function(response, ioargs) {
                                                                    if(response==null) {
     								hanldeResponse(response, ioargs);
     							error:function(response, ioargs){
                                              function hanldeResponse(response, ioargs){
                                                             var storeData = {
    											items: response
    							target.displayedValue ='name';
    					                target.searchAttr ='name';		                 
    				 = new{data: storeData});
    From the server side , i am just Returning a Collection of Books
    Everything Works fine , i.e. When i change on Author , the particular Authors Books are populated. And when the Response is Null then the Books gets Disabled as i return a null if no Books are found on server side. List<Books> as null. When i change the selection again , some books get populated , but when i press on Submit , a null id of the books , even after selecting the book from the select box , is passed. It can be observed in Tamper data Addon that, in the post , the book id was passed, but at the server side , on debugging no id is received and it throws a NotNull Validation. This happens only When i use the disable functionality Else it works like a charm. Also , i cannot input any data in the Filtering select to match the name once i disable and then re-enable the filtering select box.
    Someone Please Help !