![]() |
How to use a Component? |
Post Reply
|
| Author | |
BVS
Newbie
Joined: 09 Sep 2011 Location: Hyderabad Posts: 11 |
Post Options
Quote Reply
Topic: How to use a Component?Posted: 09 Dec 2011 at 4:41am |
|
Hi, I'm developing an Application form which contains Address section Multiple times. So, I'm trying to build a component(Address) which contains street, city, state, country, Pincode. I planned to use address component as a sub-document in the main document:
<fo:block>
<xfd:subdocument-content src="url(Address.xfc)"/>
</fo:block> Now, in the sub-document:
//Address.xfc:
<!-- Start of Sub- document-->
<fo:block>
ADDRESS
Street Address: ________________________________________
City______ State _______ Country_______ ZipCode __________
</fo:block>
For the above design i've written tables and blocks.
Now, to fill the values of City, State, Country i used <xfd:conditional-block-sequence> like below:
<xfd:variable name="Country"/>
<xfd:variable name="State"/> <xfd:variable name="City"/> <fo:page-sequence>
<fo:flow>
<fo:block>
<xfd:conditional-block-sequence>
<xfd:conditional-block test="$State='UP'"> <fo:block>Uttar Pradesh</fo:block> </xfd:conditional-block> <xfd:conditional-block test="$State='MA'"> <fo:block>Maharashtra</fo:block> </xfd:conditional-block> ..... </xfd:conditional-block-sequence>
</fo:block>
</fo:flow> </fo:page-sequence> similarly, for State and Country
To fill City, State and Country in the Dashed location i used
<xfd:subdocument-content src="url(../Xfc/Address.xfc)" xf:dt-height="0.146in">
<xfd:subdocument-parameter name="City" value="root/City"/> </xfd:subdocument-content> and to fill pincode
<fo:block height="12pt">
<xfd:field fo:padding-left="1pt" xpath="root/ZipCode"/> </fo:block> <!-- which gets value from the specified xpath, from the Source XML. -->
<!-- End of Sub-document -->
My Doubts:
1) Did the use correct code and correct format?
2) When i try to open the main document and component, then are closing as soon as i open.
why does this happen?
3) Tell me the Syntax's for using a component in Main document.
|
|
![]() |
|
radup
Admin Group
Adminstrator Joined: 19 May 2008 Posts: 83 |
Post Options
Quote Reply
Posted: 09 Dec 2011 at 5:31am |
|
Hi BVS,
The code seems to be correct. Please send us the files to support@ecrion.com and we will troubleshoot.
|
|
![]() |
|
BVS
Newbie
Joined: 09 Sep 2011 Location: Hyderabad Posts: 11 |
Post Options
Quote Reply
Posted: 12 Dec 2011 at 2:43am |
|
As shown below is my Component...
<!-- Component -->
<xfd:variable name="Country"/>
<xfd:variable name="State"/> <xfd:variable name="City"/> <fo:page-sequence>
<fo:flow>
<fo:block>
ADDRESS
Street Address: ________________________________________
City______ State _______ Country_______ ZipCode __________
</fo:block>
<fo:block>
<xfd:conditional-block-sequence>
<xfd:conditional-block test="$State='UP'"> <fo:block>Uttar Pradesh</fo:block> </xfd:conditional-block> <xfd:conditional-block test="$State='MA'"> <fo:block>Maharashtra</fo:block> </xfd:conditional-block> ..... </xfd:conditional-block-sequence>
</fo:block>
</fo:flow>
</fo:page-sequence>
<!-- End of Component -->
Q.
Can i get value filled for State from the conditional-block-sequence where the design block is followed by conditional-block-sequence block(i.e., both blocks are together in a component)?
|
|
![]() |
|
radup
Admin Group
Adminstrator Joined: 19 May 2008 Posts: 83 |
Post Options
Quote Reply
Posted: 12 Dec 2011 at 7:33am |
|
Hi BVS,
The only way is to store the filled State in a template declared in Global XSLT (see http://www.ecrion.com/Temp/HelpCache/XFDesigner/framed_hidd_edit_raw_xslt.htm), and get the value using XSLT code (see http://www.ecrion.com/Temp/HelpCache/XFDesigner/framed_hidd_edit_xslt_section.htm). You cannot get the value directly from conditional sequence. Regards, Radu
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |