Need Help

Hi All,
            I have a problem regarding the display to be displayed in the
drop down. Let me 1st describe the requirement:
1) I have an input xml which looks like this:
        
        <Root>
          <fuelTaxExemption sysid="1">
  <            <name>TEST</name> 
  <            <adjAmt currency="USD">0.001</adjAmt> 
  <            <adjType taxnr="0">UNKNOWN</adjType> 
  <            <signatureLine>1</signatureLine> 
    </fuelTaxExemption>
 
<file:///C:\Program%20Files\Apache%20Group\Apache2\htdocs\xml\vfueltaxex.xml
##> - <    <fuelTaxExemption sysid="3">
  <            <name>test22222</name> 
  <            <adjAmt currency="USD">0.005</adjAmt> 
  <            <adjType taxnr="0">UNKNOWN</adjType> 
  <            <signatureLine>1</signatureLine> 
    </fuelTaxExemption>
   </Root>
 
2) My Screen to be designed looks like the one I have attached a file with
this mail.
 
3) Here as we can see in this screen shot, we have a drop down box at the
left hand side. Now the contents of this drop down should be like "sysid -
name" of the  //fuelTaxExemption elements and the drop down can have only 5
values. Now as we can see the input xml has got only only 2 elements of
fueltaxExemption. Now I for the remaining 3 contents to be displayed in the
drop down, we need to display as "2 - UNUSED", "4 - UNUSED" and "5 -
UNUSED". And also when I select any value of the drop down from the left
hand side, the corresponding text boxes like Name, Amount, Type and
SignatureLine checkbox should get filled. 
The code for the same what I have written is given below:Note: we develop
our application in .pl file
          
<xforms:select1 ref="instance('idInst')//Id" appearance="minimal">
EOF
$count = 0;
while($count < 5)
{
$count++;
          print << "EOF_LOOP";
                   <xforms:item>          
                             <xforms:label model="FuelTaxExemptMd1"
ref="concat($count,'-',instance('masterInst')/fuelTaxExemption[\@sysid=$coun
t]/name)" />
                             <xforms:value>$count</xforms:value>
                   </xforms:item>   
EOF_LOOP
}
print << "EOF1";
                                                 <xforms:action
ev:event="xforms-value-changed">
                                                          <xforms:setvalue
ref="instance('masterInst')/fuelTaxExemption/name"
value="instance('FuelTaxExemptXML')/fuelTaxExemption[\@sysid=instance('idIns
t')//Id]/name" />
                                                          <xforms:setvalue
ref="instance('masterInst')/fuelTaxExemption/adjAmt"
value="instance('FuelTaxExemptXML')/fuelTaxExemption[\@sysid=instance('idIns
t')//Id]/adjAmt" />
                                                          <xforms:setvalue
ref="instance('masterInst')/fuelTaxExemption/adjType"
value="instance('FuelTaxExemptXML')/fuelTaxExemption[\@sysid=instance('idIns
t')//Id]/adjType" />
                                                          <xforms:setvalue
ref="instance('masterInst')/fuelTaxExemption/signatureLine"
value="instance('FuelTaxExemptXML')/fuelTaxExemption[\@sysid=instance('idIns
t')//Id]/signatureLine" />
                                                </xforms:action>
                                      </xforms:select1>
 
Note:this setvalue method seems to be wrong since I cannt take the value
from instance 'FuelTaxExemptXML' for "UNUSED" once since its entry are not
there in my xml file.
 
4) And my model looks like this:
          <xforms:model id="FuelTaxExemptMd1" schema="$SCHEMA">
                   <xforms:instance id="FuelTaxExemptXML"
src="$INSTANCE_SOURCE" functions="fp:HTMLserialise"/>
                   
                   <xforms:instance id="masterInst">
                             <Root>
                                      <fuelTaxExemption sysid="" >
                                                <name></name>
                                                <adjAmt >0.00</adjAmt>
                                                <adjType
taxnr="">Test</adjType>
 
<signatureLine>false</signatureLine>
                                      </fuelTaxExemption>
                             </Root>
                   </xforms:instance>
                   
<xforms:instance id="idInst">
                             <NextID>
                                      <Id>1</Id>
                             </NextID>
                   </xforms:instance>
          </xforms:model>
 
5) My text box code is like:
   For name text box:
          <xforms:input ref="instance('masterInst')/fuelTaxExemption/name" >
<xforms:setvalue value="XXX" ev:event="xforms-ready" /> </xforms:input>
   For Amount text box:
<xforms:input  ref="instance('masterInst')/fuelTaxExemption/adjAmt"
></xforms:input>
 
etc...
 

Please help, need some technical help regarding this.

 
Regards,
Anjali
 

Received on Tuesday, 31 May 2005 12:37:44 UTC