Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Update parent form subTitle from inner WrappedFormField values
Update parent form subTitle from inner WrappedFormField values [message #1856329] Sat, 03 December 2022 14:20 Go to next message
J D is currently offline J DFriend
Messages: 95
Registered: February 2021
Member
Hi there everyone,

I am using the WrappedFormField demo (https://scout.bsi-software.com/widgets/?dl=widget-wrappedformfield) as a template for one of my forms.

I basically have a parent form that calls some other form in a wrapped form field just like in the demo.

I would like to update the parent form's title tab based on the field values in the wrapped form field.

For example, I have the following method in the wrapped form for creating the subtitle from the first name and last name entered in the wrapped form's fields.

  protected String calculateSubTitle() {
    return StringUtility.join(" ", getFullNameBox().getFirstNameField().getValue(),
        getFullNameBox().getLastNameField().getValue());
  }


When I call this method from the form handler's execStore() method, it throws a NullPointerException even though the fields are not empty and the data was correctly saved!

Can anyone please show me what I;m doing wrong?

Thanks a lot for your kind assistance.

JD

[Updated on: Sun, 04 December 2022 08:38]

Report message to a moderator

Re: Update parent form subTitle from inner WrappedFormField values [message #1856377 is a reply to message #1856329] Wed, 07 December 2022 20:07 Go to previous messageGo to next message
J D is currently offline J DFriend
Messages: 95
Registered: February 2021
Member
I finally solved the problem by implementing an extra round trip to the backend database.

Cheers,

JD
Re: Update parent form subTitle from inner WrappedFormField values [message #1856389 is a reply to message #1856329] Thu, 08 December 2022 10:07 Go to previous message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 201
Registered: November 2010
Senior Member
I don't fully understand how your code is structured, but basically this should be possible. However, you have to be careful at what point in time you call those methods, since the WrappedFormField manages the lifecycle of the inner form and might already have closed it.

I suggest setting a breakpoint and inspecting what exactly is null. The "getXyzField()" methods are nothing special. They go to the parent group box and simply find fields based on their type. You either have the wrong group box (check your imports) or the fields are already disposed (can happen during form close).

Regards,
Beat
Previous Topic:Get source from DataChangeEvent
Next Topic:Adding a button to login screen
Goto Forum:
  


Current Time: Sun Feb 25 16:47:55 GMT 2024

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

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

Back to the top