Announcement Announcement Module
Collapse
No announcement yet.
Trying to trigger a next event from a textfield Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to trigger a next event from a textfield

    Dear Members

    According to SWF documentation for a view-state, in the JSP page we can trigger the next event , I mean (<a href="${flowExecutionUrl}&_eventId=next">Next</a>) or through the submit event

    Due a specific user requirement, they want a textfield + autocomplete ajax feature, therefore after to pick some row from list shown below in the same textfield (recall: autocomplete ajax feature) and updated the textfield with the item selected from the list, the user ask for, press enter to pass to the next view or state

    What could be the best practice?

    I am thinking in use jQuery with a hidden link and trigger after the user has been selected the item in the row and press the enter key

    Ideas are welcome

    Thanks in advanced!

  • #2
    Hi, I'm not sure I 100% understand your use case. If you want a user to select something from an autocomplete when Enter is pressed, you should solve that problem first. Then, making it so that the selected item triggers the progress of the form (going to the next event URL) is easy enough, I would imagine. http://docs.jquery.com/Plugins/autocomplete has a good autocomplete that lets you accept 'enter' as a way to make your selection. it looks like it's got good support for callbacks, and even demonstrates how to change the url based on a selection:

    Code:
    var data = [ {text:'Link A', url:'/page1'}, {text:'Link B', url: '/page2'} ];
    $("myAutoCompletetextField").autocomplete(data, {
      formatItem: function(item) {
        return item.text;
      }
    }).result(function(event, item) {
      location.href = item.url;  // set the URL here. Make sure to include the next event ID here
    });
    Hope this helps

    Comment


    • #3
      Hello Josh

      Thanks a lot for your reply

      Hi, I'm not sure I 100% understand your use case.
      Ok, about the confusion and requirement, I need the same behaviour when you do a search in Google, in the same textfield and when you write something you have there the autocomplete list result, select one, press enter and done

      Where each list result for my system is a student, recall SWF change or do the transition in the web pages with links and submit events

      If you want a user to select something from an autocomplete when Enter is pressed, you should solve that problem first. Then, making it so that the selected item triggers the progress of the form (going to the next event URL) is easy enough
      Thats correct

      I would imagine. http://docs.jquery.com/Plugins/autocomplete has a good autocomplete that lets you accept 'enter' as a way to make your selection.
      Thank you, BTW I have other jQuery solution
      http://jqueryui.com/demos/autocomplete/

      Wondered by two solutions (Plugins and UI)

      Thanks for your code, I going to use DWR for my ajax control

      FOr the rest of the members I found this link for DWR+jquery

      Code:
      jQuery( function() {  
          Cities.getAllCities(function(data) {
               var input = jQuery("#cities");
               input.autocomplete({
                   minLength: 1,
                   source: data
               });
          }
      });
      Practically we share the same solution with a slight variation

      Thanks a lot for your code, I should consider too

      Comment

      Working...
      X