Mandatory radio as XML button

Based on the examples here and here I have a datagrid that uses an XML object as its dataprovider. The xml code goes like this:

< questions >
< question >
< message > who are your heroes? < / guest >
< answers >
< response >
< address > true < / correct >
< text > Luther Higgs < / text >
< / answer >
< response >
< address > false < / correct >
< text > Barney Fife < / text >
< / answer >
< / answers >
< / question >
< / questions >

Correct (if a bit confusing) xml. I have two columns in my datagrid. The second column binds to questions.question.answers.answer.text and works very well. The editable datagrid is set true and I am able to click on the second column and type and it records the response in the object xml very well. The problem lies in my first column. The mxml looks like this:

< mx:DataGridColumn headerText = 'Correct' >
< mx:itemRenderer >
< mx:Component >
< mx:VBox horizontalAlign = "center" >
< mx:RadioButton id = "myRadioButton.
buttonMode = "true" useHandCursor = "true".
Group = "{outerDocument.myRadioButtonGroup}" selected = "{data.correct}" / > "
< / mx:VBox >
< / mx:Component >
< / mx:itemRenderer >
< / mx:DataGridColumn >

The problem is that the radio properties some buttons are not related to the xml data, which is set to true does not appear as selected. If I set the datagridcolumn's editable property to false, clicking on the checkbox option does not affect the XML at all either. If I leave the datagridcolumn's editable property inherited by default true (based on the parent of the datagrid component editable property) when I click on the option button the default itemEditor is displayed (a text entry box) which contains the following text:

< / answer >

and when I come out of the Editor (click outside or press enter) the XML looks like this:

< answers >
< response >
< address > true < / correct >
< text > Luther Higgs < / text >
< / answer >
< response >
< address > false < / correct >
< text > Barney Fife < / text >
< null > & lt; response & gt;
& lt; correct & gt; false & lt; / OK & gt;
& lt; text & gt; Barney Fife & lt; / text & gt;
& lt; / response & gt; < / null >
< / answer >
< / answers >

I've seen controls that do not have the written correctly xml path display the entire xml node rather than only the data, but I see no reason why anything should never reference just the closing tag. For me, this looks like a bug in data between the radio button and the xml object links.

Just to clear the air in order to avoid suggestions that will work but do not meet the design requirements, what I need is a datagrid that has a radio (only one good answer outside the Group) group in the first column and channels in the second column, which should be editable. I guess I could write hairy event listener code and manually to hack things together, but avoid other headaches, I'd love to use data links for what they were intended to-I just need to know why it doesn't seem to be working properly. Many thanks in advance for any help.

The research of the LiveDocs, revealed the answer. Under the heading "to the aid of an E4X expression in a tag", I found this case instead of


buttonMode = "true" useHandCursor = "true".
Group = "{outerDocument.myRadioButtonGroup}" selected = "{data.correct}" / > ""

I have


buttonMode = "true" useHandCursor = "true".
Group = "{outerDocument.myRadioButtonGroup}" / >

It works beautifully.

Apparently binding between XML and the selected property of a radio button (which is of type boolean) needs of the rather than the rating of the brace in the tag.

PS The link on livedocs is here:
http://livedocs.Adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=live Docs_Book_Parts & file = databinding_091_05.html #177459

Tags: Flex

Similar Questions

  • Need help with javascript used to check the data in the mandatory radio button fields

    required_fields

    I get a syntax error (SyntaxError: missing: after the id property 17; at line 18).  I am trying to run a script to verify data in all the fields required radio button before letting the user to submit the form (or save).  Here is the code I use:

    var AllRequiredFieldsSet = true;

    for (var i = 0; I < this.numFields;i++)//loop through all form fields)

    {

    var fldName = this.getNthFieldName;

    var currentFld = this.getField (fldName);

    if(currentFld.type=="radio")

    {

    All the radios that are needed to see if the user filled their

    if(currentFld.Value=="OFF")

    AllRequiredFieldsSet = false; one of the option boxes has not been selected, this form cannot be sent

    }

    }

    If (AllRequiredFieldsSet is false)

    App.Alert ("all the required areas have not been met");

    on the other

    this.submitForm ({cURL"mailto:EMAILADDRESS@gmail.com", cSubmitAs: "PDF"});

    Miss me not all media... Any ideas on what I'm missing?

    Thank you! Judy

    These two lines should fix things:

    var fldName = this.getNthFieldName (i);

    ...

    if(currentFld.type=="RadioButton")

  • Mandatory Radio boxes

    I have two boxes of mandatory and this radio likes to reach is out

    The Red disappear border event.

    I have try this script below without a bit of luck:

    If

    (Radio.rawValue ! = null( )

    {Radio.mandatory

    = "disabled" ;}

    How can I make this work?

    Thank you

    Hello

    This came recently and there is an example here: https://acrobat.com/#d=XGJNoujaSvn2X-7eJhi07A

    The interesting thing is that the original solution was based on the value that worked for versions of Acrobat v8 and below.

    However, this doesn't seem to work in Acrobat v9, so therefore the second example specifically for Acrobat v9. This is based on a hidden textfield that temporarily keeps the initial value of the radio button group.

    If your users have Acrobat v9 I would be included to run with the second example, event if it is not as clean. Mainly because this will work for all versions of Acrobat.

    Niall

    UPDATE: I have it back, the first example work in Acrobat v9, and one to go. Sorry!

  • radio don't button no selection when I start the application

    Hallo,

    I have a radio button with a few buttons in it. I would like it when I run the application, none of the buttons is selected. There is a 'don't allow no property selection', but this allows the "no selection". My problem is that when I run the vi, the option button is on and I would like that all of the buttons.

    Thank you

    Ah, thank you very much. It works

  • Important! Radio and checkbox buttons disappeared

    Hello

    I have a critical issue since the new Muse version came out last week.

    Missing software of the 3 - rd party that uses iframe CheckBox and radio buttons.

    The problem is caused by the site_global.css file

    by a line saying

    -webkit-appearance: none;

    I deleted manually and thus to solve a problem.

    I am using Muse for over a year and has not had similar problems. There seems to be a bug.

    How can I avoid this problem automatically?

    All advice welcome!

    Dmitry

    If you encounter errors JavaScript, or layout after publishing issues, it's probably because something custom in the code of the page, or a third party widget is causing this issue. We have seen some incompatible third-party widgets to the latest version.

    Assuming that this is your case, we suggest to roll back to an earlier version of Adobe Museand then contact the developers of your widgets to your question to get this corrected. To find the widgets that are the cause of a conflict, use a copy of your site on the new version of Muse. Remove widgets one by one and publish your site after each instance to identify the problems causing widgets.

    Thank you

    Preran

  • Custom HTML Question Slide Radio and checkbox buttons

    Did someone came up with a solution to easily replace the radio and checkbox question slide images HTML5 version? I know there is a hack that requires a change the images by default in the Program Files folder and the modification of the code in a JavaScript file by default, but I was expecting a more elegant solution for end user type.

    I know there is also the ability to create several slides of choice that operate with advanced actions, but our goal is to quickly develop hundreds of courses, and I don't want developers to spend extra time, change in advanced actions. I would like all the tips here, thanks.

    In fact, we looked at something, including in the widget of CpExtra for this particular issue, but at the moment it is quite complicated to do because we need additional images imported into Captivate library, then using a reference ID to replace these images for most normal in quiz questions running.  Unfortunately, there are so many possible problems and things that can go wrong, it's a bit a 'rabbit hole '.

    So, while it would be technically possible to do this with a widget, the best solution still seems to be that Captivate has done what all of the creation of other apps to do and just give you a few options of sustainable style for buttons and checkboxes.

  • Radio import data button

    Hi all

    I am very new to the world of PDF form and javascript.  I create a W4 which has 3 checkboxes for the marital status.  I have data on employees on an excel sheet.  I figured out how to fill the form fields with the employee data text, but completing the correct radio button for every marital status of people? I used radio buttons as well as a single checkbox can be selected at a time in the group.   Any help would be great!  Thanks in advance!

    It's the same thing as text fields. You can use 'Off' to set all the radio buttons in the group that unchecked or import one of the values that appear under their properties - Options - Radio button choice, select this specific button.

  • JavaScript for XML Export &amp; Import XML button button

    Hello:

    I'm a Newb Javascript and I think that I little bit bigger than I can chew... I am trying to create a series of forms (15) and I would like a Data Export and Import button so that the schematic form information could easily be exported and imported into eachother. I was wondering what would be the code required to program a shape data export button and button import data in a form.

    Once an employee submits the form, the submit button will turn into a button "Export form data" where management can click it and it will export the data from the form in XML format to a local folder (download folder?). "The Manager can then choose the appropriate form, open the blank form, click the"Import form data"button of this form where it will be important the ' form_data. XML"file from the folder download and continues to fill the rest of the information. Now, the loop is complete between the forms.

    It is one of the last things I'm finishing on this gigantic project, any help is greately appreciated!

    Thank you

    Hello

    I think that exportXFAData is not supported in the designer. I think you need to use:

    xfa.host.exportData

    http://help.Adobe.com/en_US/LiveCycle/9.0/designerHelp/001341.html

    Stephen

  • Radio - text format buttons

    Hello world!

    I can't get this to work! I want the text on the buttons of radio to wrap correctly when they reach the end of the scene (right now they just go on forever.) Here is the code I use:

    package {}
    import flash.display.MovieClip;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.text.TextFieldAutoSize;
    import flash.events.Event;
    Import fl.controls.RadioButton;
    Import fl.controls.RadioButtonGroup;

    SerializableAttribute public class QuizQuestion extends MovieClip {}
    question private var: String;
    private var questionField:TextField;
    choice of private var: Array;
    private var theCorrectAnswer:int;
    private var theUserAnswer:int;

    variables of positioning:
    private var questionX:int = 25;
    private var questionY: int = 150;
    private var answerX:int = 25;
    private var answerY: int = 200;
    private var spacing: int = 25;

    public void QuizQuestion (theQuestion:String, theAnswer:int,... responses) {}
    store the arguments provided in the private variables:
    question = Ducoup;
    theCorrectAnswer = theAnswer;
    choice = answers;


    create and position the object textfield (question):
    questionField = new TextField();
    questionField.width = 775;
    questionField.wordWrap = true;
    questionField.multiline = true;
    questionField.text = question;


    trace (questionField.width);
    questionField.autoSize = TextFieldAutoSize.LEFT;
    questionField.x = questionX;
    questionField.y = questionY;
    addChild (questionField);


    Format text for radio buttons
    var txtFmt:TextFormat = new TextFormat();
    txtFmt.font = "Arial";
    txtFmt.blockIndent = 2;
    txtFmt.color = 0 x 000000;
    txtFmt.size = 11;
    txtFmt.leading = 4;

    create and position the radio buttons (responses):
    var myGroup:RadioButtonGroup = new RadioButtonGroup ("group1");
    myGroup.addEventListener (Event.CHANGE, changeHandler);
    for (var i: int = 0; i < choices.length; i ++) {}
    var rb: RadioButton = new RadioButton();
    rb.setStyle ("textFormat", txtFmt);


    rb.textField.autoSize = TextFieldAutoSize.LEFT;
    RB.label = choice [i];
    RB. Group = myGroup;
    RB. Value = i + 1;
    RB.x = answerX;
    RB.y = questionY + questionField.height + 25 + (I * spacing);
    addChild (rb);
    }
    }

    private void changeHandler(event:Event) {}
    theUserAnswer = event.target.selectedData;
    }
    public function get correctAnswer (): int {}
    Return theCorrectAnswer;
    }
    public function get userAnswer (): int {}
    Return theUserAnswer;
    }
    }
    }

    As you can see, I managed to get the style of text field option buttons to use "txtFmt' as the style:

    rb.setStyle ("textFormat", txtFmt);

    The question:

    If I add:

    rb.textField.width = 352;
    rb.textField.height = 60;
    rb.textField.multiline = rb.textField.wordWrap = true;

    inside the ' loop for "creating the option button, it is simply my crazy text! It extends the text about 30 pixels after the option button, and then start wrapping, which makes any stack. How can I do create the radio button, display the text on the text field, roll once it reaches the edge of the stage and continue the next button.

    Thank you in advance,

    Rafa.

    you not add the bottom of the issue of rb.  and the code that I have proposed changing the layout.  This does not solve the problem, but he amends the provision.  When you give misinformation, mislead you people who try to get you help.

    and there are problems.

    use:

    package {    import flash.display.MovieClip;    import flash.text.TextField;     import flash.text.TextFormat;    import flash.text.TextFieldAutoSize;    import flash.events.Event;    import fl.controls.RadioButton;    import fl.controls.RadioButtonGroup;
    
        public class QuizQuestion extends MovieClip {        private var question:String;        private var questionField:TextField;        private var choices:Array;        private var theCorrectAnswer:int;        private var theUserAnswer:int;
    
            //variables for positioning:        private var questionX:int = 25;        private var questionY:int = 150;        private var answerX:int = 25;        private var answerY:int = 200;        private var spacing:int = 25;
    
            public function QuizQuestion(whichQuestion:int, theQuestion:String, theAnswer:int, ...answers) {            //store the supplied arguments in the private variables:            question = theQuestion;            theCorrectAnswer = theAnswer;            choices = answers;               //Text Format for readio buttons               var txtFmt:TextFormat = new TextFormat();               txtFmt.font = "Arial";               txtFmt.blockIndent = 2;               txtFmt.color = 0x000000;               txtFmt.size = 12;               txtFmt.leading = 4;            //create and position the textfield (question):            questionField = new TextField();            questionField.width = 770;               questionField.wordWrap = true;               questionField.multiline = true;                questionField.text = question;               //trace (questionField.width);            questionField.autoSize = TextFieldAutoSize.LEFT;            questionField.x = questionX;            questionField.y = questionY;               questionField.setTextFormat(txtFmt);            addChild(questionField);            //create and position the radio buttons (answers):            var myGroup:RadioButtonGroup = new RadioButtonGroup("group1");            myGroup.addEventListener(Event.CHANGE, changeHandler);            var rbY:Number = questionField.y+questionField.height;
    
                   for(var i:int = 0; i < choices.length; i++) {                var rb:RadioButton = new RadioButton();                rb.setStyle("textFormat", txtFmt);                rb.textField.width = 352;rb.width=400;                rb.textField.autoSize = "left";                rb.textField.multiline  = rb.textField.wordWrap = true;                rb.textField.autoSize = TextFieldAutoSize.LEFT;                rb.label = choices[i];                rb.group = myGroup;                rb.value = i + 1;                rb.x = 30;                rb.y = rbY+rb.textField.height;
    
                    rbY = rb.y+rb.textField.height;
    
                    addChild(rb);            }        }
    
            private function changeHandler(event:Event) {            theUserAnswer = event.target.selectedData;        }        public function get correctAnswer():int {            return theCorrectAnswer;        }        public function get userAnswer():int {            return theUserAnswer;        }    }}
    
  • Radio ready submit button only problem

    Hello

    My radio button with presenting ready only condition does not work properly. When I click on a link on the first page
    It brings me to a page to update. I have a radio button with send, which only opens a read-only.

    It is filled with SQL query, by selecting the Null option. When I open the page I don't want the user to be able to edit the field unless they can delete records associated with the field. Pretty well, I want it should be disabled if the user has a folder associated with it.

    Here are the queries.
    Source:
    SELECT OPLAN_IMPACTED_I
    OF DFCY
    WHERE DFCY_SEQNO =: P12_DFCY_SEQNO


    Read only:
    SQL query is
    SELECT o.dfcy_seqno
    Of oplan_impactd o, dfcy d
    WHERE o.dfcy_seqno =: p12_dfcy_seqno
    and: P12_OPLAN_IMPACTED_I = d.OPLAN_IMPACTED_I
    and: P12_OPLAN_IMPACTED_I = "Yes".

    When the page is displayed, it is that you can change the oplan, how to make it read only when the page makes?

    Thank you
    Mary

    Hello

    If it is the source of the radiogroup, then it should be:

    SELECT OPLAN_IMPACTED_I d, OPLAN_IMPACTED_I r
    FROM DFCY
    WHERE DFCY_SEQNO = :P12_DFCY_SEQNO
    

    This should return two values for each option button - the display text and the returned value. If your radios do not have a return value, then 'yes' is never found. You can check this by loading the page and do a view Source - search for RADIO and check attributes 'value' that they have.

    Andy

  • Radio button group made mandatory

    Hi all

    I need to make a mandatory radio button group. Group of radio buttons have options like Yes, no, na for a particular issue, if the user does not choose either people, I need to trigger an error message.

    I put Yes required point group of radio ownership, but still it does not work. Please let me know if I'm missing something.

    Thanks in advance.

    Kind regards
    Rajesh SM.

    As Anil has suggested the prompt else it will not able to show the name of the element.

    Kind regards
    Out Sharma

  • Required radio buttons, in any case to remove the red outline once verified?

    I have a PDF I'm putting in LC who has couple dozen yes/no radio button questions. I have these pairs of radio button each required entry. My question is when a player fills the PDF file with 'fields to highlight' turned on, once they select Yes or no on one of the questions that the red border 'entry required' stay on unselected option.

    For example; Do you like PDF? [x] YES [] NO * required entry

    yesno.jpg

    However even if the 'Yes' option box is checked the opposite of 'no' radio button in the same group remains highlighted in red because it is a required entry. On the group selection has already been made, so my question is anyway to remove the red outline, after making a selection in this group of radio buttons.

    Thanks a ton!

    Hello

    The only real control for required fields highlight color is enable or disable. See example here: http://bit.ly/e3bTJF.

    Different versions of Acrobat/Reader deal with mandatory radio buttons. Acrobat v9 describes the group with a rectangle.

    If the objects are radio buttons, I would stick with circle shape by default users will be familiar with the form and feel that they can select one of the choices. The use of a square shape means that they may make more than one selection.

    Niall

    Ensure the dynamics

  • Mandatory option highlighted buttons?

    I have a few radio buttons required in a dynamic form that the user must click Yes or no before you can submit the form by e-mail.  They may not appear as pointed out however.  How to do this?

    Hello

    We have met before, where the degree to which a mandatory radio button is highlighted varies between different versions of Acrobat/Reader.

    There is a discussion here: Re: required Radio button red color in a dynamic form

    Hope that sheds some light on it,

    Niall

  • Focus of radio button (should be easy)

    When you have a group of radio buttons and radio buttons you set the button of the radio as FOCUSABLE or do something else to operate the myradiobutton.isFocus ()?  I'm testing to the development in navigationclick but I still don't see not the radio button with focus - even if it is highlighted and if I hit enter it is activated.

    I'm in a pop-up window.  I develop for the 4.2.  Just below the Radio buttons is an objectlistfield and this area is still active even if the radio button is selected and functional if I hit the enter key.  It's almost like radio buttons are on the top of the objectlistfield or something but I didn't something fancy to try to put one over the other and if the list is empty, I don't see the "* void *" is located on top of the radio buttons, and vice versa.

    //The radio definitions
    RadioButtonField radio1, radio2;
    RadioButtonGroup rgrp;
    
    //The radio group and button creation
    rgrp = new RadioButtonGroup();
    radio1 = new RadioButtonField("Phone", rgrp, !saveToSD);
    radio2 = new RadioButtonField("SD", rgrp, saveToSD);
    
    radio1.setChangeListener((FieldChangeListener) this);
    radio2.setChangeListener((FieldChangeListener) this);
    
    // Where I am testing for navigationclick
    protected boolean navigationClick(int status, int time)
    {
      if( radio1.isFocus() || radio2.isFocus())
      {
         super.navigationClick(status, time);
         return true;
      }
    
      -- if radio buttons don't have focus the next section of code will get the objectlistfield selection and take action --
    

    Am I missing something simple (like a task to put the word FOCUSABLE)?

    Thank you
    Craig York

    Thank you Rex - you put me on the right track and I hacked together something that works...

    Details:

    getFieldWithFocus returns the VerticalFieldManager - not very useful

    getLeafFieldWithFocus returns the field I really want

    After several iterations of trial and effort I finally just changed my code to this:

    Field tmpfield = getFieldWithFocus();
    Field tmpfield2 = tmpfield.getLeafFieldWithFocus();
    
    if(tmpfield2 != fileList)
    {
       return super.navigationClick(status, time);
    }
    
    // fileList is my objectlistfield so if I am not processing that just let super handle this navigationclick
    

    Note I have also now use your Super return... instead call super and returning true - it makes much more sense.

    Thank you VERY VERY much for sending me in this way.

    Kind regards
    Craig York

  • Is it possible to place radio buttons in a form (Muse CC)

    Is it possible to place radio buttons in a form?

    You can place the buttons with HTML in the Muse,

    but he is unable to get in the form

    So, once you submit the form, you don't get to see the choice of option buttons.

    Is there a way to fix this?

    Thanx

    T

    An update was released today which includes radio and checkbox button groups.

    Please update to the latest version.

    Thank you

    Sanjit

Maybe you are looking for