Hexagon Geospatial
MENU

GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Occasional Contributor
Posts: 14
Registered: ‎11-21-2016

Using a radio button to enable form fields

In a Smart Client workflow, is it possible to use the .hasValue() function to determine if a radio button has a value or not? I have a form that contains a series of radio buttons. Depending on which option is selected, only certain fields will be available. I have used the .hasValue() function to verify that checkboxes, text fields, and other elements have values, but I cannot get it to work with a radio button. Is this functionality supported? If not, is there a workaround?

Staff
Posts: 950
Registered: ‎10-19-2015

Re: Using a radio button to enable form fields

Hi,

 

yes you can use hasValue() function to check if the radio has been selected. What it is not clear to me is how you use it. If you need to do something depending on the selection you have to subsribe to an event (value changed). Here is a piece of custom script:

IG.vent.on('form:ready', function (form) {

	IG.getItemById('NewEdit').value.subscribe(onRadioChanged);

});

function onRadioChanged () {
	if (IG.getItemById('Type').hasValue() == true)	
		{
 			if (IG.getItemById('NewEdit').getValue() === 'CreateNew')	
				{
					IG.navigate('NewPOI1');
				}
				else 
				{
					IG.navigate('OverviewPOIs');
				} 
		}
}

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Occasional Contributor
Posts: 14
Registered: ‎11-21-2016

Re: Using a radio button to enable form fields

Hi Stefano,

 

 

What I'm trying to accompliosh is simple. I have a workflow that is launched from inside Smart Client. On one of the forms there is a series of radio buttons which options that the user must select. Depending on which radio button option is selected, other form elements are enabled or disabled. These elements are on the same form.

 

Thank you for the code sample. The form now registers when a change is made to the radio button. However, it does not retun a value. The value check statement always returns false no matter which option is selected. I'm not sure if it makes a diference, but the LoV for the radio buttons is coming from an SQL statement, I tried changing form:ready to smartclient:ready thinking it would wait for all the values to be populated, but I got the same result.

Staff
Posts: 950
Registered: ‎10-19-2015

Re: Using a radio button to enable form fields

looks like a bug. You can anyway simply workaround using something like this

if (IG.getItemById('NewEdit').value())	{
	alert('hasvalue');
}

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Polls
Please register to vote
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.