Skip to main content
Question

FME Server radio button

  • September 7, 2018
  • 6 replies
  • 28 views

Forum|alt.badge.img

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?

6 replies

david_r
Celebrity
  • September 7, 2018

Do you mean using the generateFormItems() method?


Forum|alt.badge.img
  • Author
  • September 7, 2018

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


david_r
Celebrity
  • September 7, 2018

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
Celebrity
  • September 7, 2018

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

checkbox.type = "radio";


Forum|alt.badge.img
  • Author
  • September 10, 2018
david_r wrote:

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
Celebrity
  • September 10, 2018
lemzip wrote:
@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.

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings