How to access the widgets/textboxes present inside component with contract in the form view controller

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I have a component with contract template.In that I have all the widgets,labels,textboxes etc .so i need to access this in the actual form view controller and clear the fields. Not able to do so could any one help in this regard.Its visualizer 8.2.24

if I am not wrong, you can access by the following way:

this.view.my.template01.txt1.text="";

Just make sure, is it correct.

Thanks

Hi ,

Thankyou, I think this works with the component without contract.Mine is component with contract so not able to access this way.I have tried this before.

Regards,

Hi @Bewnvdette Reid​ ,

You cannot directly access widgets present in "Component with contract" inside Form Controller. Accessing is possible only after configuring contract.

Directly accessing all the widgets in component inside Form controller is possible only with "Component without contract".

Its a design.

Regards

Thankyou. You mean through manage properties ,events,methods from component we will be able to? could you pls tell what exactly configuring contract means.

@Bewnvdette Reid​

Component with contract means only those properties/events/methods are exposed that are made pass through.

You are right, this can be done using manage properties ,events,methods.

Here is one sample -

Drop a button to you component, now suppose you want o access its text property -so make it pass through.

Check the screenshot.

**Image removed for security reasons**

Now that we have made it pass through, on the form you can access it by - this.view.mywidget.customTextProperty

Please note that we access by programmatic name (check the screenshot).

Also, individual widgets are not exposed directly in component with contract, instead properties/events/methods that are made pass through are directly available on your component instance in form.

Thank you. Yeah I tried this pass through but was not able to access.Could you pls attach the screenshot

which you are saying.It is missed i think.

Updated comment above with image. Please check. Also please note this.view.mywidget.customTextProperty will work for mvc projects. For non-mvc you can use formName.mywidget.customTextProperty

Thank you so much. Its working :)