Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Force RadioButtonGroup to re-read its values from LookupCall
Force RadioButtonGroup to re-read its values from LookupCall [message #1172331] Tue, 05 November 2013 21:34 Go to next message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 24
Registered: May 2013
Junior Member
I have a Form, where I placed a TableField, StringField and a RadioButtonGroup.

User selects one of the rows in the TableField and I'm pushing an ID of selected row into a StringField to test I'm getting it right => so far so good.

For RadioButtonGroup, I'm using a LookupCall, based on LookupService, where I inject ID from the table using a "variable" in the Form => per debugger, value is properly injected and LookupCall is executed once upon form load.

QUESTION: how to force RadioButtonGroup to re-read its values from the LookupCall ?

[Updated on: Tue, 05 November 2013 21:34]

Report message to a moderator

Re: Force RadioButtonGroup to re-read its values from LookupCall [message #1172404 is a reply to message #1172331] Tue, 05 November 2013 22:36 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Isn't your question the same as here:
RadioButtonGroup with LookupCall

If yes, I am glad it helps you.

If not, can you explain what is different in your case (I am not sure to see what is dynamic in your case)... Maybe with some code snippet...
Re: Force RadioButtonGroup to re-read its values from LookupCall [message #1172474 is a reply to message #1172404] Tue, 05 November 2013 23:43 Go to previous messageGo to next message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 24
Registered: May 2013
Junior Member
Jeremie,

Thank you for pointing out on this thread.

I've seen it before, but I missed a "master field" part on the first read actually.

Unfortunately it did not really help Sad

What I did:
- introduced invisible "EventIDField" into the same Form
- assigned this field class in getConfiguredMasterField()
- returned "true" in getConfiguredMasterRequired()
- in TableField' execRowAction():
getEventIDField().setValue(cr == null ? null : (Long) cr.getCell(getEventIDColumn()).getValue());
getEventIDField().validateContent();
- in the same execRowAction(): I send "eventID" into a StringField to make sure I catch updates

at this point, I've set a break-point in lookup code to monitor when RadioButtonGroup would make a call

I observe a first call at the moment of form initialization, but break-point does not fire anymore after that, although I observe EventID updates in StringField

Let me mention that StringField and RadioButtonGroup are actually inserted into a GroupBox, but I do not see any issue with StringField, so I assume it is not an issue

Thank you,

Andriy F.

Re: Force RadioButtonGroup to re-read its values from LookupCall [message #1173612 is a reply to message #1172474] Wed, 06 November 2013 16:45 Go to previous messageGo to next message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 24
Registered: May 2013
Junior Member
Jemerie,

Please see a reduced code sample demonstrating the issue.

The expected behavior is to update both StringField and radio-group each time user double-clicks on table row.

The actual behavior: only StringField is getting updated.

Thank you in advance,

Andriy F.
  • Attachment: test.rar
    (Size: 149.55KB, Downloaded 100 times)
Re: Force RadioButtonGroup to re-read its values from LookupCall [message #1183030 is a reply to message #1173612] Tue, 12 November 2013 15:38 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Thank you for your example.

Now I see what you want to do. I am afraid it is not possible to recall the LookupCall to recreate the RadioButtons.


In the example, I do not see how many different values can be returned by the DeviceLookupCall. If there is not so many, maybe you can define your SelectDeviceGroup with some RadioButtons defined as inner-classes (instead of using your lookup call):

      @Order(20.0)
      public class SelectDeviceGroup extends AbstractRadioButtonGroup<Long> {

        @Override
        protected double getConfiguredGridWeightY() {
          return 1.0;
        }

        @Override
        protected int getConfiguredGridY() {
          return 3;
        }

        @Override
        protected String getConfiguredLabel() {
          return TEXTS.get("SelectDevice");
        }

        @Override
        protected Class<? extends IValueField> getConfiguredMasterField() {
          return EventIDField.class;
        }

        @Override
        protected boolean getConfiguredMasterRequired() {
          return true;
        }

        @Order(10.0)
        public class StaticButton extends AbstractRadioButton {

          @Override
          protected String getConfiguredLabel() {
            return TEXTS.get("Static");
          }

          @Override
          protected Object getConfiguredRadioValue() {
            return 1L;
          }
        }

        @Order(20.0)
        public class DynamicButton extends AbstractRadioButton {

          @Override
          protected String getConfiguredLabel() {
            return TEXTS.get("Dynamic");
          }

          @Override
          protected Object getConfiguredRadioValue() {
            return 2L;
          }
        }
      }


This way you can control what should be changed for a specific button in your execRowAction:

        @Override
        protected void execRowAction(ITableRow row) throws ProcessingException {
          Long value = (Long) row.getCell(getEventIDColumn()).getValue();
          getEventIDField().setValue(value);
          getPreviewField().setValue(getEventIDField().getValue().toString()); // check I'm not crazy??

          getDynamicButton().setLabel("Dynamic " + value);
        }


I hope this helps...

NB: The only other solution I see for your problem is to change your RadioGroup for a SmartField.

[Updated on: Tue, 12 November 2013 15:39]

Report message to a moderator

Previous Topic:ServerTestApplication, JUnitServerJob and scheduling...
Next Topic:RAP Form Timer Refresh
Goto Forum:
  


Current Time: Tue Mar 19 08:15:34 GMT 2024

Powered by FUDForum. Page generated in 0.01921 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top