Hi Guys,
Thank you for taking the time to take a look at my question, your assistance is most appreciated.
Take the sample XML below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<document xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<row>
<LoanNo>132138</LoanNo>
<Method>Direct Debit</Method>
<Status>Cleared</Status>
<Cleared>241.38</Cleared>
<DateSched>40210</DateSche
d>
<Out_Interest>87.75</Out_I
nterest>
<Out_Charges>55</Out_Charg
es>
<Out_Costs>0</Out_Costs>
<In_Actual>100.00</In_Actu
al>
<Curr_Balance>-26.37</Curr
_Balance>
<Brand>FSM</Brand>
<Product>NULL</Product>
<Lead_Gen>Web FSM</Lead_Gen>
<Broker_Code_ID>JSF0177667
</Broker_C
ode_ID>
<Broker_Code>FB - 01</Broker_Code>
<Funded>40127.6845356134</
Funded>
<Request>325</Request>
<Offer>325</Offer>
<Title>Miss</Title>
<First_Name>TEST</First_Na
me>
<Middle_Name>TEST</Middle_
Name>
<Surname>TEST</Surname>
<DOB>18209</DOB>
<Email>test@hotmail.com</E
mail>
<State>Western Australia</State>
<Pay_Frequency>Fortnightly
</Pay_Freq
uency>
<RLD>NULL</RLD>
<Home_Phone>07555555555</H
ome_Phone>
<Mobile_Phone>07555555555<
/Mobile_Ph
one>
<Loan_Status>Defaulted</Lo
an_Status>
<Age_of_Loan>580.315464386
571</Age_o
f_Loan>
<Days_Ago>498</Days_Ago>
<Loan_Funded>10/11/2009</L
oan_Funded
>
</row>
</document>
to filter the product - I build a selection box and populate it on the fly with all different products. Below is the code that I use.
<xsl:for-each select="/document/row[gene
rate-id() = generate-id(key('product',
Product)[1])]">
<listproductrow name="Product_{Product}" pvalue="{Product}">
<xsl:attribute name="selected">
<xsl:if test="Product = $product">
<xsl:text>yes</xsl:text>
</xsl:if>
</xsl:attribute>
</listproductrow>
</xsl:for-each>
What I want to do, is to add a select box that has three options:
Never Paid (when In_Actual = 0)
Paid (When In_Actual > 0)
All (all of the above)
how would I go about this? would I send select box value back to a javascript function then do a transform, or is there a way I can do it without sending the value out to javascript?
Any light you could shine on my question, I would be most appreciative!!
I would suggest that you take the same approach.
(so roundtrip for a transform)
In this case however you don't have distinct values.
So when making the select you can't rely on a muenchian for-each as you do above,
but you have to hardcode the select in the gridview XSLT
I would suggest that you do the following: add a new filter variable, which can have three values
1 for positive values
0 for 0 values
-1 for all
And you can use that value (passed in as a parameter) in your filter XSLT
This is how I would tackle this, just to be consistent with the other filter values