Topic
5 replies Latest Post - ‏2009-12-16T15:52:17Z by Giandolce
Giandolce
Giandolce
54 Posts
ACCEPTED ANSWER

Pinned topic Popup Issue

‏2009-12-03T14:47:42Z |
I have three popups on my form that are being populated with values from an xforms instance. My issue is having to populate one popup based on the value of another popup. For example, in my form, the second popup (Asset Class) needs to be populated with values based on the value selected form the first popup (Assessment Class); the third popup (Assessment Type) needs to be populated with values based on the value selected form the second popup (Asset Class). I have successfully done this using xfdl popups, but not quite sure how to do it in xforms.

Any suggestions/recommendations would be greatly appreciated. I have attached the sample form.

Thanks.
Updated on 2009-12-16T15:52:17Z at 2009-12-16T15:52:17Z by Giandolce
  • nikanos
    nikanos
    6 Posts
    ACCEPTED ANSWER

    Re: Popup Issue

    ‏2009-12-05T16:21:01Z  in response to Giandolce
    Couldn't you use predicates on the itemsets of the select1 items?
    I see you store the selections in instance('cg_assessment') so the itemsets could be:

    1st selection leave it as is:
    instance('PickListsXMLSnipit')/AssessmentClass

    2nd selection:
    instance('PickListsXMLSnipit')/AssessmentClass /AssetClass

    3rd selection:
    instance('PickListsXMLSnipit')/AssessmentClass/AssetClass/AssessmentType

    hope this helps.
    • nikanos
      nikanos
      6 Posts
      ACCEPTED ANSWER

      Re: Popup Issue

      ‏2009-12-05T16:34:45Z  in response to nikanos
      Couldn't you use predicates on the itemsets of the select1 items?
      I see you store the selections in instance('cg_assessment') so the itemsets could be:

      1st selection leave it as is:
      instance('PickListsXMLSnipit')/AssessmentClass

      2nd selection:
      instance('PickListsXMLSnipit')/AssessmentClass[@name=instance('cg_assessment')/AssessmentClass/@name]/AssetClass
      3rd selection:
      instance('PickListsXMLSnipit')/AssessmentClass[@name=instance('cg_assessment')/AssessmentClass/@name]/AssetClass[@name=instance('cg_assessment')/AssessmentClass/AssetClass/@name]/AssessmentType

      hope this helps.
  • RandomTrial
    RandomTrial
    22 Posts
    ACCEPTED ANSWER

    Re: Popup Issue

    ‏2009-12-08T23:01:46Z  in response to Giandolce
    You were very close. You just needed to reference the particular elements of the data instance. I have attached the code that worked for me:
    <popup sid="Asset_Class_POPUP">
    <xforms:select1 ref="instance('cg_assessment')/AssessmentClass/AssetClass/@name">
    <xforms:label></xforms:label>
    <xforms:itemset nodeset="instance('PickListsXMLSnipit')/AssessmentClass/AssetClass">
    <xforms:label ref="@name"></xforms:label>
    <xforms:value ref="@name"></xforms:value>
    </xforms:itemset>
    </xforms:select1>
    The above was slightly changed for the AssetClass. It should work the same as you work through the particular elements of each element of the data instance.
  • RandomTrial
    RandomTrial
    22 Posts
    ACCEPTED ANSWER

    Re: Popup Issue

    ‏2009-12-08T23:09:49Z  in response to Giandolce
    for some reason the referencing did not paste to my reply. The reference is behind .../AssessmentClass it is @name=...
    See the example. I had a different version of Lotus forms but you should be able to view the source.

    <popup sid="Asset_Class_POPUP">
    <xforms:select1 ref="instance('cg_assessment')/AssessmentClass/AssetClass/@name">
    <xforms:label></xforms:label>
    <xforms:itemset nodeset="instance('PickListsXMLSnipit')/AssessmentClass/AssetClass">
    <xforms:label ref="@name"></xforms:label>
    <xforms:value ref="@name"></xforms:value>
    </xforms:itemset>
    </xforms:select1>
    • Giandolce
      Giandolce
      54 Posts
      ACCEPTED ANSWER

      Re: Popup Issue

      ‏2009-12-16T15:52:17Z  in response to RandomTrial
      That is exactly what I am looking for. Thank you so much for the help.