Ecrion Software Inc. Homepage
Forum Home Forum Home > XF Designer > FAQ
  New Posts New Posts RSS Feed: How to use a Component?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to use a Component?

 Post Reply Post Reply
Author
Message / View First Unread Post
BVS View Drop Down
Newbie
Newbie
Avatar

Joined: 09 Sep 2011
Location: Hyderabad
Posts: 11
Post Options Post Options   Quote BVS Quote  Post ReplyReply Direct Link To This Post 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.
 
 
 
 
 
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 90
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
BVS View Drop Down
Newbie
Newbie
Avatar

Joined: 09 Sep 2011
Location: Hyderabad
Posts: 11
Post Options Post Options   Quote BVS Quote  Post ReplyReply Direct Link To This Post 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)?
 
 
 
 
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 90
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.075 seconds.