Heads up on progress... After losing more than one or two hairs I've managed
to get something to call the javascript function passing the required data. 
I just need to get the javascript working properly now.  

Figured it worth posting my solution for the record & maybe some day someone
will suggest a better one!

It's a ColumnDecorator which pokes around getting stuff like the tableRow
object, returnValueAssignmentPairs etc. from the PageContext.

It's generating a href as follows:
<a href="#" class="DATA-LINK"
onclick="javascript:populate_parent('CREATED_BY=TGLHOSTED0')">HOSTED</a></td>
Where HOSTED is the data value in the column but it's TGLHOSTED0 (value in
another column) that's to be returned to the parent screen (not nice in
terms of usability IMHO but that's the requirement - who am I to argue...)





>   public Object decorate(Object columnValue, PageContext ctxt,
> MediaTypeEnum mt) throws DecoratorException {
>     String returnAssignmentsStr = "";
> 
>     String thisColValue = evaluate(columnValue.toString(),
> ctxt.getAttribute("tableRow")).toString();
> 
>     String[] returnValueAssignmentPairs = (String[])
> ctxt.getAttribute("returnValueAssignmentPairs");
>       
>       for (int i=0; i<returnValueAssignmentPairs.length; i++){
>         String parentObjFieldName =
> returnValueAssignmentPairs[i].split("=")[0];
>         String listObjFieldName =
> returnValueAssignmentPairs[i].split("=")[1];
>         
>         String fieldValue = evaluate(listObjFieldName,
> ctxt.getAttribute("tableRow")).toString();
>         
>         returnAssignmentsStr =  returnAssignmentsStr + parentObjFieldName
> + "=" + fieldValue;
>         if (i<returnValueAssignmentPairs.length-1){
>           returnAssignmentsStr += ";";
>         }
>       }
>                   
>       return "&lt;a href=\"#\" class=\"DATA-LINK\"
> onclick=\"javascript:populate_parent('" + returnAssignmentsStr +
> "')\"&gt;" + thisColValue + "&lt;/a&gt;";
>     }
> 
> 


-- 
View this message in context: 
http://www.nabble.com/Using-Link-on-Column-to-populate-fields-%28plural%21%29-in-parent-screen-tf4811614.html#a13842442
Sent from the DisplayTag - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to