You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by llama-king <p....@albourne.com> on 2012/09/10 16:40:36 UTC

Dynamically Writing Raw to Grid Cells

Hello,

I've had a search around and yet to find a potential solution to this.
Beginning to think it may be impossible currently!

The problem:

I'm using a variation of a Grid (specifically, Tapestry5 jQuery's DataTable
which springboards off AbstractTable and DataTables.net for client-side).

I'm trying to find a way to adorn cell values with markup/style on the fly -
I've written a BeanModel and GridDataSource. The BeanModel utilizes a
PropertyConduit and so the value is exposed to me there. Looking at the
source the only ability to affect MarkupWriter.writeRaw was via a Translator
render method but only the translator's toClient is called by the
AbstractTable.

Obviously one could just go <p:blahCell> <t:outputraw value="blahText" />
</p:blahCell> but I will always have style information that needs rendering
so doing this for every single table with varying column names could become
incredibly cumbersome.

Any guru out there with knowledge of how this might be achieved? It seems to
me that this could be a genuinely desirable thing when it comes to table
rendering from an existing data source that can also provide style
information (i.e.: the value in this cell is special, colour it green and
bold it).

Kind regards,
Peter



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamically-Writing-Raw-to-Grid-Cells-tp5716164.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Dynamically Writing Raw to Grid Cells

Posted by trsvax <tr...@gmail.com>.
should have been

&lt;span class="green"&gt; cell text &lt;/span&gt;



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamically-Writing-Raw-to-Grid-Cells-tp5716164p5716169.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Dynamically Writing Raw to Grid Cells

Posted by trsvax <tr...@gmail.com>.
I think you could create a "raw" datatype. Then in your bean

@Datatype("raw")
private String rawData;

Then create a property display block

  <t:block id="raw">
    <t:outputRaw value="context.propertyValue" />
  </t:block>

but it seems like what you really want is

CellText

If that's the case I'd add a mixin to GridGell and write out the span tag.
GridCell has access to the model.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamically-Writing-Raw-to-Grid-Cells-tp5716164p5716168.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Dynamically Writing Raw to Grid Cells

Posted by llama-king <p....@albourne.com>.
Hi Lance and trsvax,

Thanks for your respective answers. I'm using the got5 tapestry5-jquery
DataTable component (datables.net). I had a little difficulty writing a
mixin higher up the chain so for now (due to time constriants) I've resorted
to writing a mixin that interacts with the DataTables jQuery plugin itself
in order to grab whatever's in a cell (plain text data) and render it.

It doesn't take a huge chunk out of page load time but I'm sure there must
be a more elegant way to achieve this. I will give it a go another time when
I have the time. :)

In the mean time thanks for your assistance!

Peter



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamically-Writing-Raw-to-Grid-Cells-tp5716164p5716381.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Dynamically Writing Raw to Grid Cells

Posted by Lance Java <la...@googlemail.com>.
You could always attach a custom mixin to the DataTable which decorates the
DOM.
http://tapestry.apache.org/component-mixins.html



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamically-Writing-Raw-to-Grid-Cells-tp5716164p5716167.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org