Skip to main content
Question

FME Server radio button

  • September 7, 2018
  • 6 replies
  • 32 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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

david_r
Celebrity
  • 8394 replies
  • September 7, 2018

Do you mean using the generateFormItems() method?


Forum|alt.badge.img
  • Author
  • 13 replies
  • 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
  • 8394 replies
  • 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
  • 8394 replies
  • 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
  • 13 replies
  • September 10, 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 - 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
  • 8394 replies
  • September 10, 2018
@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.