[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
RadioButton(-Group) jumps back for his own  XML
Forum Index -> Development
Author Message
pstich

Active

Joined: 27/04/2012 07:43:18
Messages: 9
Offline

Hello,
i have two RadioButtons combined to a Group.
Everytime I select the second one, the marked Point jumps back to the first RadioButton. If I look into the getValue() I get the value of the second one, but on my Screen that one isn´t marked.
I tested it with true/false, 0/1 as values. Everytime the same thing. If I change the direction of the two RadioButtons (e.g. false / true instead of true / false) it doesn´t get "turn around". It always jumps back from the second added RadioButton to the first added RadioButton, no matter which one has which refValue.

(With three RadioButtons that "jump" only happens if i want to select the third one. Switching between the first and the second RadiioButton runs in that case)

Can you reproduce that bug?

My implementation:

Code:
 
 (...)
 ROWNode rowButton = new ROWNode();
 rowButton.addSubNode(createValueFieldRadioButton(rowIndex, "false"));
 rowButton.addSubNode(createValueFieldRadioButton(rowIndex, "true"));
 rowButton.setRendered(isVisible);
 (...)
 
 
 private RADIOBUTTONNode createValueFieldRadioButton(final int rowIndex, final String buttonValue) {
         RADIOBUTTONNode radioButton = new RADIOBUTTONNode();
 
         radioButton.setText(m_translationProvider.replaceLitera("search.configuration.valid." + buttonValue));
         radioButton.setWidth("100%");
         radioButton.setBackground(COLOR_WHITE);
         radioButton.setFlush(true);
 
         radioButton.setValue("#{d.extendedSearchQueryBuilder.searchFields["
                     + rowIndex + "].selectedValue}");
         radioButton.setRefvalue(buttonValue);
 
         radioButton.setGroup("#{d.extendedSearchQueryBuilder.searchFields[" + rowIndex + "].name}");
         
         radioButton.setEnabled("#{d.extendedSearchQueryBuilder.searchFields[" + rowIndex + "].editable}");
         return radioButton;
     }
 
 


Log of the Getter and Setter of selectedValue:

Set: 'false'
Get: 'false'
Get: 'false'

But only for the "click-second" the false-RadioButton is selected, then it is the true-RadioButton again (in the selectedValue-Variable already is "false" as value)...


Thanks for your help!

Best Regards,
Pascal
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5528
Online

Hi,

no, I cannot reproduce.
Your code does not seem to be too wrong , so the problem should be somewhere in the binding.

How sure are you that "radioButton.setGroup("#{d.extendedSearchQueryBuilder.searchFields[" + rowIndex + "].name}");" delivers the values that you want it to deliver...?

You may quickly test by assigning some fix value:

Code:
 radioButton.setGroup("HARRY" + rowIndex);
 


Regards, Björn

Björn Müller, CaptainCasa GmbH
pstich

Active

Joined: 27/04/2012 07:43:18
Messages: 9
Offline

Thanks for your hint! It was a spelling mistake exactly at the Getter from the ButtonGroup that i haven´t seen...

But a strange behaviour that only the last Button of the hole Group makes that trouble^^
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team