cancel
Showing results for 
Search instead for 
Did you mean: 

Access xml data attribute - Error

Former Member
0 Kudos

HI

This is an issue in Adobe print form. I want to a design a print form based on a tabular data. XML schema looks like this.


  <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
   <xfa:data xfa:dataNode="dataGroup"/>
   <dd:dataDescription xmlns:dd="http://ns.adobe.com/data-description/" dd:name="data">
      <data>
         <P9014_TAB dd:minOccur="0">
            <DATA dd:maxOccur="-1">
               <YYHOUSE_BUILDING/>
               <YYLAND_PROP/>
               <YYPLINTH/>
               <YYSTOREY/>
               <YYLAND_AREA/>
            </DATA>
         </P9014_TAB>
      </data>
   </dd:dataDescription>
</xfa:datasets>

In the form a subform displaying the data in tabular fashion in bound to

$.P9014_TAB.DATA[*]

In the form only 3 text fields bound to yyplinth, yystorey, yyland_area are defined.

If yyland_prop = 'X' display textfields bound to yyplinth and yystorey

otherwise display only textfield bound to yyland_area

Problem is how to read yyland_prop value from the script.

I have tried the following codes (in the calculate event of textfields) but now of them seem to work.


$record.p9014_tab.yyhouse_building.value
$record.P9014_TAB.DATA[*].yyhouse_building.value
$record.P9014_TAB.DATA.yyhouse_building.value 
$record.P9014_TAB.yyhouse_building.value

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Otto & Sanoosh

Thanks a lot or replying. The issue is not of accessing a form field. I can always drag and drop the field (say named yyhouse_building) onto the form and hide it and access its value as $.yyhouse_building.value and code works fine. But I dont want to define a hidden field just as a means to access data source field. Imagine a scene where you have 10 source fields which are only used for calculation purpose you would have to define 10 hidden fields in the form and then use the form fields in the calculation. This is preposterous. Its not a clean fuel.

MY requirement is to access dataset field straightway for my scenario....

Once again for understanding purpose let me state that my data structure (in ABAP) is something like

Data : begin of P9014_TAB occurs 0,

YYHOUSE_BUILDING type ....

YYLAND_PROP type ...

YYPLINTH type ...

YYSTOREY type ...

YYLAND_AREA type ....

end of P9014_TAB.

And I want to access yyhouse_building from individual record (calculate event of column fields....) of table rows

Edited by: ABAPPER on Jan 21, 2011 10:01 AM

Edited by: ABAPPER on Jan 21, 2011 10:03 AM

Edited by: ABAPPER on Jan 21, 2011 10:03 AM

Former Member
0 Kudos

Hi,

Drag and drop the entire table from data view to the layout. Make only relevent fields visible and rest hidden accroding tho the value in yyland_prop. You can use script property 'field.presence' in the appropriate event.

Thanks & Regards,

Sanoosh

OttoGold
Active Contributor
0 Kudos

Hello,

a) you can use drag and drop (from the data view onto the layout) and the "system" will generate the content/ fields and subforms for you. You can rearange them then or use it as a template for you own development. Example: you can copy the way the "system" binds the fields and subforms to the backend

b) there is a tiny button right to the binding field with tiny arrow which you can use to help you find the levels/ sources for your subforms/ fields.

c) there are some more ways, I suggest you try one of the first two.

Cheers Otto