Hi all.
I have a for loop in a component and now i want to implement something like AJAX. The for-loop has a article-number(Textfield), description(Insert), and a price(Insert) 5 times...
At the beginning all the fields are empty.
I set a method with a @Eventlistener annotation with target to the article-number and the event "onkeyup".

Now my question: How can i get the Value, which the user typed in in the "article-number" textfield? After, if I have the value, i will set the other fields which are among to the article-number...

Please help me...

Here is the code:
DirectOrderForm.java:

public abstract class DirectOrderForm extends BaseComponent
{

   /**
    * Logger
    */
   Log log = LogFactory.getLog( DirectOrderForm.class );
public abstract Object getIterationValue();

   public abstract Integer getIterationIndex();

  public abstract List<ItemDigest> getItemsStore();
  public abstract void setItemsStore(List<ItemDigest> items);
/**
    * Hivemind service: document logic.
    *
    * @return DocumentLogic
    */
   public abstract DirectOrderLogic getDirectOrderLogic();
   public abstract DocumentLogic getDocumentLogic();
public List<ItemDigest> getItems() throws Exception
   {
       if(getItemsStore() != null)
       {
           return getItemsStore();
} List<ItemDigest> list = new ArrayList<ItemDigest>();
       list = getDirectOrderLogic().getDirectOrderItems(5);
setItemsStore(list);
       return list;
   }

@EventListener(events = "onkeyup", targets = {"articleNr"}, async = true)
   public void getArticleNumber(IRequestCycle cycle, BrowserEvent event)
   {
       String id = event.getTarget().get("id").toString();

       log.info("PUT "+id+" ");

   }
}




DirectOrderForm.html:

<table class="tablecontent">
           <thead>
               <tr>
                   <th class="artno">Atrikel-nr</th>
                   <th class="descr">Description</th>
                   <th class="price">price</th>
               </tr>
           </thead>
           <tbody>
<tr jwcid="@For" source="ognl:items" value="ognl:iterationValue"
                   index="ognl:iterationIndex" volatile="true">
                   <td jwcid="@Any">
<input autocomplete="off" class="smalltext" jwcid="articl...@textfield" value="ognl:iterationValue.articleNr" />
                   </td>
                   <td jwcid="@Any">
<span jwcid="descript...@insert" value="ognl:iterationValue.description" />
                   </td>
                   <td jwcid="@Any">
<span jwcid="pr...@insert" value="ognl:iterationValue.unitPrice" />
                   </td>
               </tr>
           </tbody>
       </table>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to