cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Render a selection-list as radio buttons (was: Re: cforms tag limitation)
Date Sun, 12 Jun 2005 05:40:51 GMT
On Sab, 11 de Junio de 2005, 21:28, Carlos M. S. Bento Nogueira dijo:
> On Sat, 11 Jun 2005, Antonio Gallardo wrote:
>> Hi:
>>
>> Lets go back first to your first post, where you stated what you are
>> trying to archieve: "Insert a line or column break between items."
>
> Correct.I simply cannot add <row> or <column> tabs to form1.xml to be
> later interpreted as i desired as <tr>(for rows) and <td>(for columns) on
> my xsl. This is also stated in http://wiki.apache.org/cocoon/GT2004Sylvain
>
>>
>> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=111819623407003&w=2
>>
>> I need first to be clar of what are you trying to archieve. A
>> <fd:selection-list> is used mainly to create what in GUIs we call a
>> combobox or a listbox. Do you want to put inside the combobox or listbox
>> a
>> line between items?
>
> Wrong. The selection-list i'm using has several items that will be
> displayed as radio buttons.

OK. You want to render the selection-list as a set of radio buttons. Every
item of the selection list will be rendered as one radio button, right?

> What i basically wanted was to insert as many
> <tr> tags as lines,and as many <td> tags as columns between the list
> elements.
> I include some code snippets bellow but if you prefer you can also see
> them at pastebin: http://pisco.pastebin.com/299217

The link response is:

*********************************************************************
Query failure: Can't open file: 'pastebin.MYI'. (errno: 145)
select pid,poster,unix_timestamp()-unix_timestamp(posted) as age,
date_format(posted, '%a %D %b %H:%i') as postdate from pastebin where
domain='pisco' order by posted desc, pid desc limit 10
*********************************************************************

Let's forget this error. We can try first with a simple
<fd:selection-list> and later you can make the DB query works as desired.
I don't see a problem. ;-)

> form1.xml(widget init)
>   <fd:widget>
>   (..)
>   <fd:field id="sexo_opcoes">
>         <fd:selection-list>
>                 <fd:item value="Masc."/>
>                 <fd:item value="Fem."/>
>                 <fd:item value="Other."/>

>   -----------------------------------------------------
>   form1_template_action.xml(widget call)
>   <fi:group>
>   <fi:styling type="tabs"/>
>         <fi:items>
>                 <fi:group> (each group represents one tab)
>   (...)
>   <table border="0">
>   <tr>
>   <td>
>   <ft:widget id="sexo_opcoes">
>         <fi:styling list-type="radio" list-orientation="horizontal"
> line="1" column="3">
>   (...)
>   ---------------------------------------------------
>   forms-field-styling.xsl(field styling)
>
>   <xsl:stylesheet version="1.0"....>
>   <xsl:template
> match="fi:field[fi:selection-list][fi:styling/@list-type='radio']"
> priority="2">
>   <xsl:variable name="column" select="number(fi:styling/@column)"/>
>   <xsl:variable name="line" select="number(fi:styling/@line)"/>
>   (...)
>
>   <xsl:for-each select="$line">
>          <xsl:for-each select="$column">
>                  <td><xsl:text>ColunmTest</xsl:text></td>
>          </xsl:for-each>
>
>          <xsl:if test="$line&gt;1">
>                  <tr><xsl:text>LineTest</xsl:text></tr>
>          </xsl:if>
>   </xsl:for-each>
> ----------------------------------------------------------
> Desired HTML output example:
> (...)
> <table border="0">
> <tr>
> <td>
>  	label: sexo
> </td>
> <td>
>  	Masc.
> </td>
> <td>
>  	Fem.
> </td>
> <td>
>  	Other
> </td>
> ------------------------------------------------------
> The problem whith these snippets is that i can not convert a number to a
> node list on xsl, and to use a for-each cicle $line times and $columns
> times i should use xstl 2.0 which allows (for-each select="1 to $line").

Yep. This problem is more XSLT related. Hmm. we normally don't reply this
kind of questions, since there is a list dedicated excluvely to XSLT
(xsl-list@lists.mulberrytech.com). While getting the e-mail address I saw
your lastest posts there and a reply to this XSLT question too. ;-)

> I'll be investigating if and how i can use xslt2.0 on cocoon, but it
> anyone suggest web pointers that would great :)))

I know saxon support xslt 2.0 and you can easily plugin saxon in cocoon. I
never tried that, but I know some people do this. More info here:

http://wiki.apache.org/cocoon/Saxon

If there is not enough info, I believe you can ask about this in another
thread.

> Thank you all for your pacience and time,

Thanks to your patience with me too. ;-)

Best Regards,

Antonio Gallardo.


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


Mime
View raw message