Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

ui_choicelist macro

Not applicable

Hello,
Has anyone ever used the ui_choicelist macro. I would like to build a choice list using this macro based on two other user inputs but I am not sure how to populate it. I wasn't sure if anyone else was using this or not or knows how to use this macro.

Thanks for reading.

4 REPLIES 4

kcaldwell
Kilo Expert

There is an example on how to use it in the UI Page - add_catalog_item.

According to the description of the UI Macro it takes 3 inputs.

name= what you want to name the select (if omitted, name will be set to the value of the "field" attribute)
table= the table from which you will select
field= the column in the table to select from

Here is the piece from the UI Page:



<tr id="quantityrow">
<td><label for="myquantity">${gs.getMessage('catalog_quantity')}</label></td>
<td><g:ui_choicelist name="myquantity" table="sc_cart_item" field="quantity" /></td>
</tr>


Not applicable

Thanks, I will try that today.

Does anyone know if you can poplulate this macro from a function?


kcaldwell
Kilo Expert

What are you trying to accomplish? Are you building a UI Page? Maybe the UI Macro is not the way to go. You could use a an HTML Select and populate it based on user inputs.


Not applicable

The item I am currently working on needs a dropdown build of two columns in a table appended together. Originally I was using the ui_slushbucket but the service owners changed their mind and decided that they only wanted the requester to be able to select one option at a time. So I found a macro called ui_choicelist and decided I would try to get this populated with the appended data.