2012-07-17 6 views
0
<cfparam name="attributes.mytestvalue" default="0"> 
<cfdump var="#attributes#"> 

<!--- Attributes are there. ---> 

<cfdocumentSection> 
    <cfdocumentitem type="footer"> 
     <cfdump var="#attributes#"> 
    </cfdocumentitem type="footer"> 
</cfdocumentSection> 

<!--- Attributes are not there. ---> 

왜 이런 일이 발생합니까? 이것은 알려진 버그입니까?<cfdocumentItem>에 누락 된 속성

답변

2

\ WEB-INF \ cftags \ META-INF \ taglib.cftld에 따르면 cfdocumentsection 및 cfdocumentitem은 자체적으로 사용자 정의 태그로 구현되므로 자체 특성 범위를 가질 수 있으므로 특성 범위에 넣은 값을 마스킹합니다 .

당신이 시도 할 수 :

<cfdocumentSection> 
    <cfdocumentitem type="footer" mytestvalue="#attributes.myTestValue#> 
     <cfdump var="#attributes#"> 
    </cfdocumentitem type="footer"> 
</cfdocumentSection> 

아니면이 : 또한

<cfset attribs={type="footer", myTestValue=0}> 
<cfdocumentSection> 
    <cfdocumentitem attributeCollection="#attribs#"> 
     <cfdump var="#attributes#"> 
    </cfdocumentitem> 
</cfdocumentSection> 

을, 나는 그것이 문제는 여기에 생각하지 않지만, 당신은 유형 = "바닥 글"있어 cfdocumentItem의 닫는 태그에있는 속성 (필요 없음)

+0

죄송합니다 실제 코드가 다른 시스템에 있기 때문에 "footer"는 잘라 내기 및 붙여 넣기 오류입니다. –

0
<cfset request.myTestValue=attributes.myTestValue> 

<cfdocumentSection> 
    <cfdocumentitem type="footer" mytestvalue="#request.myTestValue#> 
     <cfdump var="#attributes#"> 
    </cfdocumentitem type="footer"> 
</cfdocumentSection> 

이 문제는 해결되었지만 지금은 왜 작동하지 않는지 알고 있습니다. 지. Barnyr에게 감사드립니다.

관련 문제