cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Reijn" <j.re...@hippo.nl>
Subject RE: How to detect which row in the table was klicked?
Date Tue, 31 Oct 2006 17:16:58 GMT
Hi Roland,
 
I think that for the submitId to work, you need to define the submit widget in your model.
Since you're iterating throught flowscript, can you just use your request object to fetch
the id or name of your submit button?
 
Try adding the name parameter to your submit type like:
 
 <input class="submitLink" type="submit" id="${counter}" name="submitbutton" value="${item.trxDate}
/>
 
Now from your flowscript you can get the value of the submit button by using the request object
like:
 
var button_value = cocoon.request.get("submitbutton");
 
Kind regards,
 
Jeroen Reijn
Hippo

-----Original Message-----
From: Roland Seiler [mailto:roland.seiler@corix.ch]
Posted At: Tuesday, October 31, 2006 4:35 PM
Posted To: Cocoon User List
Conversation: How to detect which row in the table was klicked?
Subject: How to detect which row in the table was klicked?



Hi all 

I am a beginner in Cocoon and I try to do the following: 

I have a search form which presents some results in a table. When i press a row in the table,

a detail page appears. 

Actually i do something like this: 
  
flow: 
  // do search... 
  var trxList = ... 

  // show result form 
  form.showForm("activityFollowup.form", {trxList:trxList}); 

 // get the selected row 
 var id = form.submitId; 

  // and display the detail page 
 form.showForm("transactionDetail.form", {trx:trxList[id]}); 


In the form definition I create the table like this: 

<jx:set var="counter" value="#{0}"/> 

<table id="resultTable" width="100%" border="0" cellspacing="0"> 
  <jx:forEach var="item" items="${trxList}"> 
    <jx:set var="counter" value="#{1 + $counter}"/> 

    <tr> 
      <td> 
        // represent the text as submit link to go back in the flow 
        <input class="submitLink" type="submit" id="${counter}" value="${item.trxDate}
/> 
      </td> 
       . 
       . 
       . 
    </tr> 
  </jx:forEach> 
</table> 

Back in the flowscript, unfortunately the submitId is null. How can I detect 
on which row the user klicked? 


Regards, 
Roland Seiler 


Mime
View raw message