2013-04-19 4 views
0

계산 된 값을 가진 다른 컨트롤에 의해 계산 된 값을 가진 텍스트 출력 컨트롤이있는 폼을 만들었습니다. 문제는 빌더의 테스트 모드에서 이러한 컨트롤이 제대로 작동한다는 것입니다. 러너에서 이러한 컨트롤은 항상 0 (비어 있음)입니다. 문서를 저장하고 다시 열면 값은 정확하지만 새로 고침되지는 않습니다.Orbeon Runner - 계산 된 값

<xforms:instance id="fr-form-instance"> 
    <form> 
     <section-1> 
      <first> 
       <first_amount/> 
       <first_percent/> 
       <first_total/> 
      </first> 
      <second> 
       <second_amount/> 
       <second_percent/> 
       <second_total/> 
      </second> 
      <third> 
       <third_amount/> 
       <third_percent/> 
       <third_total/> 
      </third> 
      <total/> 
      <average/> 
     </section-1> 
    </form> 
</xforms:instance> 

그리고 내 바인딩 :

<xforms:bind xmlns:dataModel="java:org.orbeon.oxf.fb.DataModel" id="fr-form-binds" 
      nodeset="instance('fr-form-instance')"> 
    <xforms:bind id="section-1-bind" name="section-1" ref="section-1"> 
     <xf:bind name="first" id="first-bind" ref="first"> 
      <xf:bind name="first_amount" id="first_amount-bind" ref="first_amount" 
        type="xf:decimal"/> 
      <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="first_percent" 
        id="first_percent-bind" 
        ref="first_percent" 
        type="xf:decimal" 
        constraint="./text()&gt;=0 or string-length(./text())=0"/> 
      <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="first_total" 
        id="first_total-bind" 
        ref="first_total" 
        calculate="(../first_amount/text() * ../first_percent/text()) div 100" 
        type="xf:decimal"/> 
     </xf:bind> 
     <xf:bind name="second" id="second-bind" ref="second"> 
      <xf:bind name="second_amount" id="second_amount-bind" ref="second_amount" 
        type="xf:decimal"/> 
      <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="second_percent" 
        id="second_percent-bind" 
        ref="second_percent" 
        type="xf:decimal" 
        constraint="./text()&gt;=0 or string-length(./text())=0"/> 
      <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="second_total" 
        id="second_total-bind" 
        ref="second_total" 
        calculate="(../second_amount/text() * ../second_percent/text()) div 100" 
        type="xf:decimal"/> 
     </xf:bind> 
     <xf:bind name="third" id="third-bind" ref="third"> 
      <xf:bind name="third_amount" id="third_amount-bind" ref="third_amount" 
        type="xf:decimal"/> 
      <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="third_percent" 
        id="third_percent-bind" 
        ref="third_percent" 
        type="xf:decimal" 
        constraint="./text()&gt;=0 or string-length(./text())=0"/> 
      <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="third_total" 
        id="third_total-bind" 
        ref="third_total" 
        calculate="(../third_amount/text() * ../third_percent/text()) div 100" 
        type="xf:decimal"/> 
     </xf:bind> 
     <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="total" 
       id="total-bind" 
       ref="total" 
       calculate="sum(instance('fr-form-instance')/section-1/first/first_total/text()) + sum(instance('fr-form-instance')/section-1/second/second_total/text()) + sum(instance('fr-form-instance')/section-1/third/third_total/text())" 
       type="xf:decimal"/> 
     <xf:bind xmlns:fb="http://orbeon.org/oxf/xml/form-builder" name="average" 
       id="average-bind" 
       ref="average" 
       type="xf:decimal" 
       calculate="instance('fr-form-instance')/section-1/total/text() div (count(instance('fr-form-instance')/section-1/first) + count(instance('fr-form-instance')/section-1/second) + count(instance('fr-form-instance')/section-1/third))"/> 
    </xforms:bind> 
</xforms:bind> 
+0

전체 작업 양식을 제공 할 수 있습니까? orbeon.com의 ebruchez에서 직접 저에게 이메일을 보내주십시오. Orbeon Forms의 버전은 무엇입니까? – ebruchez

답변

1

이 테스트 모드 모두에서 제공하는 양식 나를 위해 작동하는 것 같다 양식을 배포 할 때 (을 참조하십시오 여기에

내 인스턴스 스크린 샷). Orbeon Forms 4.1을 사용하고 있습니다.

아니 그게 문제가해야하지만, 여기 당신의 XPath 식에 대한 의견의 커플 :

  • text() 거의 XPath는 필요하지 않습니다, 그리고 당신은 당신의 표현
  • 을에 /text()의 이러한 모든 항목을 제거 할 수 있습니다
  • 대신 &gt;=, 당신은

screenshot 더 읽을 수있는 ge 연산자를 사용할 수 있습니다.

+0

감사합니다. 그것은 내 응용 프로그램 프록시에서만 발생하는 것 같습니다. –

+0

잘 됐군. – ebruchez