Closed GoogleCodeExporter closed 9 years ago
The only way that you are going to know what column was clicked would be to put
a
JavaScript event on the column. I think you are going to have to either create a
custom cell editor for each column to do it, or use jQuery and bind an event on
load
of the page.
I wish I had a more direct answer for you but what you are tying to do is pretty
custom...although very possible.
Original comment by jeff.johnston.mn@gmail.com
on 1 Dec 2009 at 3:03
Thanks for you response. I'll try take a way to solve this problem with yours
indications. If I get it, I'll tell you and everybody. I hope.... :)
Original comment by presiden...@gmail.com
on 1 Dec 2009 at 11:18
At the end i solved the problem. I followed the indications (thanks so much
Jeff!!)
and I've guided the solution with CellEditor. My custom class is...
import org.jmesa.util.ItemUtils;
import org.jmesa.view.editor.AbstractCellEditor;
import org.jmesa.view.html.HtmlBuilder;
public class FilaNoticiaPinchada extends AbstractCellEditor {
@Override
public Object getValue(Object item, String property, int rowcount) {
Object value = ItemUtils.getItemValue(item, property);
Object bean = ItemUtils.getItemValue(item, "news");
Object nombreFichero = ItemUtils.getItemValue(bean, "fileName");
HtmlBuilder html = new HtmlBuilder();
html.div().onclick("javascript:document.getElementById('ruta').value='" +
fileName.toString() + "';
javascript:document.getElementById('action').value='create';
javascript:document.pag_frm.submit();").close();
html.append(value);
html.divEnd();
return html.toString();
}
}
In this way I show the same information, and I choose the columns I want to be
clicked:
<jmesa:tableFacade toolbar="es.opencms.jmesa.ToolbarJMesa" id="jmesa_noticias"
stateAttr="restore" maxRows="5" maxRowsIncrements="5,10,15" items="${listado}"
var="noticias" editable="true" exportTypes="jexcel,pdfp,csv" >
<jmesa:htmlTable>
<jmesa:htmlRow uniqueProperty="id">
<jmesa:htmlColumn property="checkbox" title="${checks}" editable="true"
worksheetEditor="org.jmesa.worksheet.editor.CheckboxWorksheetEditor"
filterable="false" sortable="false" width="2%"/>
<jmesa:htmlColumn property="fecha" title="Fecha" pattern="dd/MM/yyyy"
editable="false" cellEditor="org.jmesa.view.editor.DateCellEditor"
sortable="true"
width="10%" headerClass="sortable" sortOrder="asc,desc,none" />
<jmesa:htmlColumn property="titular"
cellEditor="es.opencms.jmesa.ficha.FilaNoticiaPinchada" title="Titular"
sortable="true" editable="false" headerClass="sortable"
sortOrder="asc,desc,none"
width="70%"/>
<jmesa:htmlColumn property="prioridad"
cellEditor="es.opencms.jmesa.ficha.FilaNoticiaPinchada" filterable="true"
title="Prioridad" editable="false" sortable="true" headerClass="sortable"
sortOrder="desc,asc,none" width="8%"/>
<jmesa:htmlColumn property="visible"
cellEditor="es.opencms.jmesa.ficha.FilaNoticiaPinchada" title="Visible"
editable="false" sortable="true" width="10%"
filterEditor="es.sopde.opencms.jmesa.filtros.FiltroBooleano"><img
src="<cms:link>${rutaImagen}dibujos/${noticias.mostrarVisible}</cms:link>"
/></jmesa:htmlColumn>
</jmesa:htmlRow>
</jmesa:htmlTable>
</jmesa:tableFacade>
I hope this solution can be used to anyone with the same problem I had.
Original comment by andyned...@gmail.com
on 1 Dec 2009 at 1:43
Original comment by jeff.johnston.mn@gmail.com
on 10 Mar 2011 at 10:08
Original issue reported on code.google.com by
andyned...@gmail.com
on 30 Nov 2009 at 11:43