Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Updatable annotation for Guess my configuration

Hi Everyone,

 

I trying to make the UI of my component flexible depending on the user's iteration and found that maybe the Updatable annotation can do the trick for it. Unfortunately, I wasn't able to get it working 😕 

 

In the Dataset, I have 

	@Option
	@Updatable(after = "_resource", parameters = {"_inputDataStore", "_resource"}, value = "updateEndpoint")
	private InputDataStore _inputDataStore;

	@Option
	@Required
	@Suggestable(parameters = "_inputDataStore", value = "fetchResources")
	private String _resource;

The service looks like this:

	@Update("updateEndpoint")
	public InputDataStore updateEndpoint(
		@Option("inputDataStore") final InputDataStore inputDataStore,
		@Option("resource") final String resource) {

		return inputDataStore.setEndpoint(resource);
	}

Unfortunately the service method is never triggered and does not matter if the `_resource` is changed. 0683p000009MAna.png

- Do you happen to have any example how this annotation should be used?

Thanks in advance,

Zoltán

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi @devxr 

 

I'm using https://github.com/Talend/component-runtime/tree/master/sample-parent/documentation-sample/updatable... to test the web port, studio should comply to it as well normally.

 

Romain

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi @devxr

First side note is the first parameter can be ".".

Then we had an enhancement in 1.1.6 that if put on a hidden field - due to active if - the update button was never seen.

Finally, the behavior is that you must hit the update button to trigger the callback, nothing is automatic to ensure the user requests to overwrite the config and it is not done implicitly. It also behaves better in the web cause of latencies.

Did you test with the web tool - maven plugin - it behaves as expected? Do you have the button in properties?
ypiel
Employee
Employee

Hello Zoltan,

The @Updatable is on _inputDataStore, so if you want it and _resource as parameters, you have to go one level up : 'parameters = {"../_inputDataStore", "../_resource"}' or 'parameters = {".", "../_resource"}'

As Romain said, you can test your form and its behavior using 'mvn talend-component:web'.

 

I hope it has helped you,
Best regards,

Yves

Anonymous
Not applicable
Author

Hi guys, @rmannibucau @ypiel 

 

Thanks for the answers. In the web-tool kit tester I was able to see the "Update" button, but not in the 7.1.1 Studio.
Moreover it not clear to me how the "parameter" should be used. 😕 

 

InputDataSet

 

	@DefaultValue("\"\"")
	@Option
	protected String testAuthString;

	@Option
	@Updatable(after = "testAuthString", parameters = ".", value = "updateAuth")
	private GenericDataStore _genericDataStore;

Service class:

	@Update("updateAuth")
	public GenericDataStore updateAuth(
		@Option("genericDataStore") final GenericDataStore genericDataStore) {

		return genericDataStore.setAuthenticationMethod(AuthenticationMethod.OAUTH2);
	}

However when I click on the "Update" button, I get

[WARNING] Didn't find testAuthString in inputMapperConfiguration._inputDataSet._genericDataStore in the Web tester's console.

I would expect that it looks for "testAuthString" in inputMapperConfiguration._inputDataSet not in the inputMapperConfiguration._inputDataSet._genericDataStore.

 


- Could you please elaborate on a bit more on the Updatable annotation's "parameters" field? What am I missing?

 

Thanks,

Zoltán

Anonymous
Not applicable
Author

Hi @devxr 

 

I'm using https://github.com/Talend/component-runtime/tree/master/sample-parent/documentation-sample/updatable... to test the web port, studio should comply to it as well normally.

 

Romain

Anonymous
Not applicable
Author

Thanks @rmannibucau!

 

These documentation samples in https://github.com/Talend/component-runtime/tree/master/sample-parent/documentation-sample are really helpful! 0683p000009MApk.png

 

Thanks so much! 0683p000009MACn.png

ypiel
Employee
Employee

Hi,

 

Just to be sure is \"\" default value really wanted ?

@DefaultValue("\"\"")
@Option
protected String testAuthString;

This mean you will really get '""' as value not '' empty string (not the same as in javajet where you hada to specify \"\").

 

Regards.