Skip to main content

Hi,

I have had a look to see if a radio button is available as a user parameter for an FME app that is pulling the parameters back using fmeserver.js.

<form id="fmeForm" name="fmeForm" onsubmit="return dataDist.orderData(this);" onchange="dataDist.updateQuery()">

Does anyone know if this is doable?

Do you mean using the generateFormItems() method?


Hi @david_r

Yes, the items get generated but would like to use a radio or selectbox for a single selection but the only option i can find that does selectboxes are multiple's from the user parameters.

Regards


Radio boxes aren't implemented in the generateFormItems() method, so you'll have to implement that yourself.

The easiest is probably to write a custom version of generateFormItems() that implements your particular requirements and then use that rather then the one supplied in FMEServer.js


If you just need a quick hack you could try modifying line 546 in FMEServer.js as follows:

checkbox.type = "radio";


Radio boxes aren't implemented in the generateFormItems() method, so you'll have to implement that yourself.

The easiest is probably to write a custom version of generateFormItems() that implements your particular requirements and then use that rather then the one supplied in FMEServer.js

@david_r - thanks for the info. Do you know if its easy enough to target one of the radio buttons? I can see if creates a span but unsure how easy it would be to dynamically target one to add a link to it for futher information?

 

thanks

 

 

 


@david_r - thanks for the info. Do you know if its easy enough to target one of the radio buttons? I can see if creates a span but unsure how easy it would be to dynamically target one to add a link to it for futher information?

 

thanks

 

 

 

I think you've reached the point where you'll probably want to roll your own implementation of the generateFormItems() method (which I suspect was included mostly for demonstration purposes). You can copy/paste the function contents from FMEServer.js and modify it as needed.

 

For someone that knows a little bit of javascript it should definitely be possible to achieve what you're asking.