If your CellField event makes a copy, then setting the FF_READ_ONLY flag
after creating the event handler won't do you any good.

PS: This code won't create radio/check fields.  You should at the very
least be calling PdfFromField.createButton, createCheckBox or
createRadioButton.  That or we're missing some Important Code in
CellField.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 

> -----Original Message-----
> From: Johannes Becker [mailto:[email protected]] 
> Sent: Monday, December 27, 2010 6:14 AM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Unmodifiable 
> radiobuttons/checkboxes in table cell
> 
> Hi,
> 
> thanks to your help, I'm able now to to add my 
> checkboxes/radiobuttons/textfields to my table.
> 
> Only one more thing bugs me: I can't get my fields immutable 
> (except of radiobutton).
> 
> ...
> PdfFormField someField = PdfFormField.createEmpty(writer); 
> someField.setFieldName("xxx"); PdfPCell someCell = new 
> PdfPCell(); someCell.setCellEvent(new CellField(writer, 
> someField, cellFieldName, FIELD_TYPE_TEXT, someText); 
> someTable.addCell(someCell); 
> someField.setFieldFlags(PdfFormField.FF_READ_ONLY);
> document.add(someTable);
> 
> 
> Cheers
> Jonny
> 
> 
> 
> Am 23.12.2010 13:01, schrieb 1T3XT BVBA:
> > Op 23/12/2010 10:25, Johannes Becker schreef:
> >>>    Please read chapter 8 for more info.
> >> My problem is that im working with the 2007 book. :(
> > Read on until you reach p490.
> > There's a code sample on that page that shows how to:
> >> get the connection between the PdfPCellEvent and how to add a 
> >> RadioCheckField into my cell.
> > Actually, the code sample adds a TextField, not a 
> RadioCheckField, but 
> > it's easy to adapt the example.
> >> More precise:
> >> I dont't know how to get the rect out of the PdfPCellEvent, to 
> >> dynamically create a RadioCheckFields within the table. I 
> guess I'm missing something here.
> > As I explained in my previous answer:
> >>> The coordinates of the cell are stored in rect.
> > If I misinterpreted your question, and if you mean you don't 
> > understand how cell events work, read section 10.2.2 in the First 
> > Edition of "iText in Action" (that's the 2007 book).
> >
> > 
> ----------------------------------------------------------------------
> > -------- Learn how Oracle Real Application Clusters (RAC) One Node 
> > allows customers to consolidate database storage, standardize their 
> > database environment, and, should the need arise, upgrade to a full 
> > multi-node Oracle RAC database without downtime or disruption 
> > http://p.sf.net/sfu/oracle-sfdevnl
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> > Many questions posted to this list can (and will) be 
> answered with a 
> > reference to the iText book: http://www.itextpdf.com/book/ Please 
> > check the keywords list before you ask for examples: 
> > http://itextpdf.com/themes/keywords.php
> >
> 
> 
> --------------------------------------------------------------
> ----------------
> Learn how Oracle Real Application Clusters (RAC) One Node 
> allows customers to consolidate database storage, standardize 
> their database environment, and, should the need arise, 
> upgrade to a full multi-node Oracle RAC database without 
> downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Many questions posted to this list can (and will) be answered 
> with a reference to the iText book: 
> http://www.itextpdf.com/book/ Please check the keywords list 
> before you ask for examples: http://itextpdf.com/themes/keywords.php
> 
> 

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to