on 10-03-2007 10:49 AM
Hi Abdullah
I have a similar problem to what you just solved, but I have a few questions relating to your answer below:
In your context , create a node MasterNode of cardinality 1...1 and singleton set to true. Bind this to the dataSource property of the InteractiveFormElement.
Inside this MasterNode create a node Data of cardinality 0...n and singleton set to false. Keep all of your payslip attributes inside this node.
In your interactive form element , in the Body Page create a subform of Type Flow Content and Flow Direction Table .Check the chechbox for Allow Page Breaks within Context . Inside this subform create another subform of Type Flow Content and Flow Direction Western Text . Uncheck the checkbox for Allow Page Breaks within Context . Put all of your pay slip UI elements inside this subform and bind them with the attributes under the node Data. Also tick the property of the inner subform under the section Object->Subform that says Repeat Subform for each Data Item
In your view controller coding area , create an element of the node Data for each employee record and populate it with values for the particular employee .
Add all of the elements that you created into an ArrayList and bind this ArrayList to the node Data. Now your form is ready for n number of employees.
Put this sort of coding in your view controller coding:
IDataElement objData = null;
ArrayList arlData = null;
int intNumberOfEmployees=0;
try
{
arlData = new ArrayList();
intNumberOfEmployees = //Get size of your model node that returns employee info
if(intNumberOfEmployees>0)
{
for(int i=0;i<intNumberOfEmployees;i++)
{
objData = wdContext.createDataElement();
objData.setName("//Value fetched from backend here");//Eg:wdContext.nodeEmployeeInfo.getEmployeeInfoElementAt(i).getname()
//Similarly set all of the values
arlData.add(objData);
}
}
wdContext.nodeData.bind(arlData);
}
I am using Abode LC 7.0.
for my Table subform, the Allow Page Breaks within Context checkbox is greyed out. Also pls could you shoe me the structure of your context nodes?
I don't see from your code how a new page is created each time the employee changes?
thanks
Anton Kruse
Hi Anton,
I think I have got your problem. You have added two subforms under body pages(that makes it a total of three subforms in your application and hence the problem). You need to add only one. If you navigate to the hierarchy view, on the left hand side of Adobe Live Cycle, you will see that there is already one subform. That is your main subform(Subform 1). You need to add one more subform to this(Subform 2). All your context nodes will be added under Subform 2.
I have mailed you my application. Hope it helps.
Regards,
Abdullah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.