xsl:if problem in Xforms:repeate

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xsl:if problem in Xforms:repeate

Laxmi Narayana-3
Hi All,
 
I have node name "interactionsubtype" which has two possible values, Inbound and Outbound.
If its Inbound I need to display the row in one color and if not other color as I am trying below. But it is not working.
Please find list-record-view.xhtml as attachment.
 
<xforms:repeat nodeset="instance('main-instance')/records/record" id="repeattransaction">
<xsl:if test="interactionsubtype='Inbound'">  
<tr bgcolor='blue'>     
   <td nowrap="true"><xforms:output ref="interactionid"/></td>
   <td nowrap="true"><xforms:output ref="interactiontopic"/></td>
   <td nowrap="true"><xforms:output ref="interactorname"/></td>
   <td nowrap="true"><xforms:output ref="interactoremail"/></td>
   <td nowrap="true"><xforms:output ref="interactorphonenum"/></td>
   
   <td nowrap="true"><xforms:output ref="interactiontype"/></td>
   <td nowrap="true"><xforms:output ref="worktype"/></td>
   <td nowrap="true"><xforms:output ref="transtype"/></td>
   
      <td nowrap="true" align="center"><xforms:output ref="info"/></td>
   <td nowrap="true" align="center"><xforms:output ref="draft"/></td>
  </tr>
</xsl:if>
 
<xsl:if test="interactionsubtype!='Inbound'">  
<tr bgcolor='red'>     
   <td nowrap="true"><xforms:output ref="interactionid"/></td>
   <td nowrap="true"><xforms:output ref="interactiontopic"/></td>
   <td nowrap="true"><xforms:output ref="interactorname"/></td>
   <td nowrap="true"><xforms:output ref="interactoremail"/></td>
   <td nowrap="true"><xforms:output ref="interactorphonenum"/></td>
   
   <td nowrap="true"><xforms:output ref="interactiontype"/></td>
   <td nowrap="true"><xforms:output ref="worktype"/></td>
   <td nowrap="true"><xforms:output ref="transtype"/></td>
   
      <td nowrap="true" align="center"><xforms:output ref="info"/></td>
   <td nowrap="true" align="center"><xforms:output ref="draft"/></td>
  </tr>
</xsl:if>

 </xforms:repeat>
 
Please help me. Any xforms:group condition will it work??
 
Thanks in advance.
Laxmi Narayana .
 


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

list-records-view.xhtml (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xsl:if problem in Xforms:repeate

Hank Ratzesberger
Hi Laxmi,

XSL processing is all done before the page is received by
the XForms processor.  It appears that you may be trying
to test in XLS a nodeset that is selected in xforms.

This might work if your main-instance is the same as
input:data, but that would be like a "magic trick" because
it would not be at all what it appears like -- the <xsl:if>
and the <xforms:repeat> are completely independent processing
steps.

What may work instead, with the most recent versions, is using
variables in xforms and attribute value templates.

<xforms:variable name="color" value="if  
(interactionssubtype='inbound') 'blue' else 'red'"/>
<tr bgcolor="{$color}">

And sorry that I can't take more time to be sure that code is
working, you may need to refer to instance data and not use 'strings',
but Orbeon Forms will certainly let you declare variables usable by the
xforms engine and use those variables in html attributes.

Regards,
Hank


On Sep 5, 2008, at 5:59 AM, Laxmi Narayana wrote:

> Hi All,
>
> I have node name "interactionsubtype" which has two possible  
> values, Inbound and Outbound.
> If its Inbound I need to display the row in one color and if not  
> other color as I am trying below. But it is not working.
> Please find list-record-view.xhtml as attachment.
>
> <xforms:repeat nodeset="instance('main-instance')/records/record"  
> id="repeattransaction">
> <xsl:if test="interactionsubtype='Inbound'">
> <tr bgcolor='blue'>
>    <td nowrap="true"><xforms:output ref="interactionid"/></td>
>    <td nowrap="true"><xforms:output ref="interactiontopic"/></td>
>    <td nowrap="true"><xforms:output ref="interactorname"/></td>
>    <td nowrap="true"><xforms:output ref="interactoremail"/></td>
>    <td nowrap="true"><xforms:output ref="interactorphonenum"/></td>
>
>    <td nowrap="true"><xforms:output ref="interactiontype"/></td>
>    <td nowrap="true"><xforms:output ref="worktype"/></td>
>    <td nowrap="true"><xforms:output ref="transtype"/></td>
>
>       <td nowrap="true" align="center"><xforms:output ref="info"/></
> td>
>    <td nowrap="true" align="center"><xforms:output ref="draft"/></td>
>   </tr>
> </xsl:if>
>
> <xsl:if test="interactionsubtype!='Inbound'">
> <tr bgcolor='red'>
>    <td nowrap="true"><xforms:output ref="interactionid"/></td>
>    <td nowrap="true"><xforms:output ref="interactiontopic"/></td>
>    <td nowrap="true"><xforms:output ref="interactorname"/></td>
>    <td nowrap="true"><xforms:output ref="interactoremail"/></td>
>    <td nowrap="true"><xforms:output ref="interactorphonenum"/></td>
>
>    <td nowrap="true"><xforms:output ref="interactiontype"/></td>
>    <td nowrap="true"><xforms:output ref="worktype"/></td>
>    <td nowrap="true"><xforms:output ref="transtype"/></td>
>
>       <td nowrap="true" align="center"><xforms:output ref="info"/></
> td>
>    <td nowrap="true" align="center"><xforms:output ref="draft"/></td>
>   </tr>
> </xsl:if>
>
>  </xforms:repeat>
>
> Please help me. Any xforms:group condition will it work??
>
> Thanks in advance.
> Laxmi Narayana .
>
> <list-records-view.xhtml>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws