java - Spring + JQuery dynamic binding -


I'm new to Spring and I'm still learning.

Now my problem is dynamic list binding.

I want a text box, a list and add buttons. What is the scenario? The user shows the text box (with auto completion) and click the Add button. After adding initiation action, the list becomes populated without issuing the request to the server. The user adds some more items to the list, and then submits the form to the server.

What is the problem?

I do not know how to bind the list or the server to pass the dynamic data.

At this time I'm able to get the JSON response with the list of autocomplete from the controller.

Is Spring suitable for this task? What is the right way to implement it?

Here's what I think you're trying to get. First of all: I am thinking that this issue is not in the autocomplete list, but what to do with the list in the MVC side. Assume that your order object contains an asset "employee name," which

  list & lt; String & gt; defined as. GetNames () {..} Zero set-names (list & lt; string & gt;) {..}   

On the JSP side, you define form list items like this Are:

  & lt; Form: Form & gt; & Lt; C: forEach item = "$ {command.names}" var = "name" varStatus = "status" & gt; & Lt; Form: Input path = "name [$ {status.index}]" /> & Lt; / C: foreach & gt; & Lt; / Form: Form & gt;   

The real move to create "dynamic" with jQuery is to add it to the form with the next growing index so you have it anywhere:

  & lt; Script type = "text / javascript" & gt; Var calculation = $ {FN: length (command.names)}; Function addToList () {// "names [count]" with name; calculation ++; } & Lt; / Script & gt;   

By placing it together, you set the list as controllerBackingAbact is an autoopulal list

It should be enough to get you started.

Comments