steve poling wrote:
>
> Paolo,
>
> Thanks for this information.
>
>> That's not a bug. Fields with the same name must be created with a
>> single field dictionary and several widget kids, one for each visible
>> instance. Create in acrobat two fields with the same name. Then, use the
>> Java toolbox to see the field structure, you should see two widgets with
>> a single parent, the field itself. This is the reason that fields with
>> the same size must always have the same value.
>
> When I have a unique field name, I can do what I'm doing now, create a
> TextField, manipulate its properties and then do an addAnnotation.
> That's what I'm doing now.
>
> But when I have a duplicated field name, I need to construct a parent
> object and attach duplicate sub-objects (one per field) as kids of the
> parent object, one kid per instance of the shared name. (and use IText
> toolbox to inspect my work.)
>
> Since I'm new to low-level PDF concepts, I understand the strategy, but
> not the details. To which classes do the parent and kids belong? I
> attach them via which methods?
>
> Is there sample code showing this anyplace? If not, tell me and I'll
> create some for you.
>
> Thanks in advance,
>
> steve
>
Well I need to push the topic up again, sorry for that. But Iam not able to
solve this problem. Even I have the Kids(Textfields with equal fieldname)
one of them is all the time hidden.
Iam doing like this:
// Creating parent field annotation
PdfFormField parent = PdfFormField.createEmpty(writer);
parent.setFieldName("parent");
// ok now lets add the kids to this parent
// 1 kid textfield
TextField kid1 = new TextField(writer,new Rectangle(403,683,573,697),"kid");
// setting some text into the field
kid1.setText("123456");
// 2 kid textfield
TextField kid2 = new TextField(writer,new Rectangle(403,683,573,697),"kid");
try {
parent.addKid(kid1.getTextField());
parent.addKid(kid2.getTextField());
} catch (Exception e) {
throw new ExceptionConverter(e);
}
ok in this case both textfields (kids) have the same fully qualified name,
it is "parent.kid" right?
by the PDF Reference they should have now the wanted behaviour or not? (Same
Value, ... etc.)
Sth. Iam doing bad. I saw this also with the Toolbox, but i have no clue how
I will get same value in both textfields, also when changing one value that
the other is getting the same.
Plz help!
Thanks for advice and greetings!
--
View this message in context:
http://www.nabble.com/Sample-code-for-same-named-fields-tf2604283.html#a12493670
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/