Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Staff
Posts: 17
Registered: ‎11-30-2016

Telerik + GMSC 2015 - problem with invisible variables from FORM

Hello,

 

I'm building some report which shows values from my feature. 

Depending from feature they have some categories (boolean column in feature table) assigned to them and by those categories I have made some visibility option to form tabs. 

 

Now when generating report I have problem to make some part of report to be invisible, depending from categories assigned into feature. I managed to make textboxes with static labels visibility dependency using binding in telerik:

Visible = IIf(Fields.FORM_KAT1=1,true,false)

But this trick doesn't work on fields with "Fields.FORM_xx" like values. I get error inside PDF's :

 

An error has occurred while processing TextBox 'textBox29':
The expression contains object 'FORM_WOREK' that is not defined in the
current context

As far I understand my problem, telerik doesn't get variables from form tabs which were made invisible by atrribute filter. 

In FormSetting.xml I use visible setting like this (Variable 'KAT1' has to be '1' to make tab visible): 

<FormTab name="ED_STANPPOW_Tab" label="Zasoby przeciwpowodziowe" visible="form[SQL[Select KAT1 from MAGAZYN where  ID = {FORM.ID} and KAT1 = 1]]">

Is there any other option, to make my tab hidden, not disabled, to make my report work properly? Or some other way to disable parts of report without getting error about missing variables?

 

I've found some tip here: http://smartclient.intergraph.at/documentation/JavascriptConditions but it doesn't work in GMSC 2015.

 

visible="hidden[SCRIPT[IG.eval((({FORM.KAT1} === "1")]]"

 

 

Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: Telerik + GMSC 2015 - problem with invisible variables from FORM

Hi, 

 

could you please try with something like

 

  visible="hidden[SCRIPT[_.isEqual(IG.getItemById('FORMFIELDNAME').getValue(), '1')]]"

Regards,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Staff
Posts: 17
Registered: ‎11-30-2016

Re: Telerik + GMSC 2015 - problem with invisible variables from FORM

[ Edited ]

Hi,

 

I tried with this:

		<FormTab name="PPOZ_Tab" label="Zasoby przeciwpożarowe" visible="hidden[SCRIPT[_.isEqual(IG.getItemById('KAT2').getValue(), '1')]]">

Now I can see all tabs and they are like inactive (grayout and unclickable)

Highlighted
Staff
Posts: 1,036
Registered: ‎10-18-2015

Re: Telerik + GMSC 2015 - problem with invisible variables from FORM

Hi,

 

please try by doing it in a custom script. Something like (using the correct condition):

 

 

if (!_.isEmpty(IG.getItemById('PARCEL_ID').getValue())) 
{
	IG.getItemById('MyTab').show();
}

if needed, you can subscribe to the event related to the field:

 

 

 

IG.vent.on('form:ready', function (form) {
	form.getItemById('PARCEL_ID').value.subscribe( ... CALL HERE ...);
}

 

For any errors please refer to the JS console.

 

HTH,

Stefano

 

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.