Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
- Do you happen to have any example how this annotation should be used?
Thanks in advance,
Zoltán
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
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
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
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
Thanks @rmannibucau!
These documentation samples in https://github.com/Talend/component-runtime/tree/master/sample-parent/documentation-sample are really helpful!
Thanks so much!
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.