For the radio buttons however, there is only one field "person.preferred" but it has 3 widgets. EN has "EN" as on-value, and "Off" as off-value FR has "FR" as on-value, and "Off" as off-value NL has "NL" as on-value, and "Off" as off-value
Good. There is radio button field named "person.preferred". I would very much like to get widget which is in state 'on' and has "EN" as on-value. Is it possible to get name of on-value from the EN-widget form this radio button ? eg. in pseudo code. if( radiobutton.getWidget(widget_1).isOn() ) name_on-value = Radiobutton.getWidgetName(widget_1); if( radiobutton.getWidget(widget_1).isOff() ) //// do nothing I need to get name of on-value (in this case "EN") of this radio button. Pozdrawiam, Paweł Gawędzki -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Lowagie Sent: Wednesday, June 11, 2008 1:43 PM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] Radiobuttons in iText ? precyz wrote: > In my case this instruction returns only "yes": > > form.getField("nameRadiobutton") is equal to "yes". This says anything to me > becouse i need something different. See my previous answer: you misunderstand the concept of radiobuttons (both in PDF as in HTML). > Lets take eg. from your book. Yes, let's do that: http://1t3xt.info/examples/browse/?page=example&id=247 > There is > radiobutton named "language". NO THERE ISN'T!!! Read the example! "person.language" is a Choice/List/ComboField! There are radiobuttons "person.preferred" and there are checkboxes "person.knowledge". > It has values "languages = { "English", > "French", "Dutch" };". On document I choose "French" language and then save > the doc. A person can have knowledge of different languages (checkboxes), but we also ask for one preferred language (radiobutton). > After that i need to read this document again and find out which > value of radiobutton was choosen. How can i get the choosen value of > radiobutton? The way YOU do it, you can't (actually you can, but I don't want to tell you how because doing it like that would be bad taste). Let's return to the book example: For the checkboxes I have 3 fields with different names: person.knowledge.English person.knowledge.French person.knowledge.Dutch Their values can be "On" or "Off". For the radio buttons however, there is only one field "person.preferred" but it has 3 widgets. EN has "EN" as on-value, and "Off" as off-value FR has "FR" as on-value, and "Off" as off-value NL has "NL" as on-value, and "Off" as off-value You think it should be: EN has "On" as on-value, and "Off" as off-value FR has "On" as on-value, and "Off" as off-value NL has "On" as on-value, and "Off" as off-value but as you found out, that just doesn't make sense. Please change the way your form was created so that you no longer make wrong use of radio buttons. br, Bruno ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar ------------------------------------------------------------------------------ Skandia Życie Towarzystwo Ubezpieczeń S.A. ul. Cybernetyki 7, 02-677 Warszawa Sąd Rejonowy dla m.st. Warszawy, XIII Wydział Gospodarczy Krajowego Rejestru Sądowego Nr KRS 0000056463, Regon: 016003836, NIP: 951-19-33-418 wysokość kapitału zakładowego: 46.000.000,00 PLN wysokość kapitału wpłaconego: 46.000.000,00 PLN ------------------------------------------------------------------------------ ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar