formbuilder

I want to prompt further field based on its previous field result in Bot Framework App [duplicate]

不想你离开。 提交于 2019-12-24 15:00:25
问题 This question already has an answer here : Change flow of messages in Microsoft Bot Framework (1 answer) Closed 2 years ago . I have below formbuilder code in a class, I want to prompt user based on its response. if user response for field "ConfirmISTTimeZone" is "Yes" then it should prompt for the field "TimeZone" else it should directly prompt "Duration" How to do this? var formflow = new FormBuilder<FlightBooking>().Message("Tell me Flight details!") .Field(nameof(Flightname)) .Field

Symfony2 form - Many to Many as text causing errors

余生颓废 提交于 2019-12-24 03:50:35
问题 I have tried looking around for a possible solution to this but with no luck. What I have is a Many to many relationship between properties and postcodes, I can't display the postcodes in a select for example due to the amount of possible entries. My solution was to have it as a text field in the form and then catch it on PrePersist to search for the matching record and then apply this to the entity before persisting to the db. The problem is when the form is validating it is still trying to

Symfony/FOS - pass the user id variable to a form Type

允我心安 提交于 2019-12-23 20:12:45
问题 I try to set the value of a field "author" from a CategoryType form. I want it to be the user id from the current user logged in with FOS bundle. my CategoryType form : namespace My\CategoryBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class CategoryType extends AbstractType { private $userId; public function __construct(array $userId) { $this->userId = $userId; } /** *

Can't create Custom inputs for some (Text, Booleans, …) types, with SimpleForm

百般思念 提交于 2019-12-23 05:43:11
问题 I can't figure out why this is not working as it should - or - I'm missing something important ? Here's the list of the mapped types from simple_form / lib / simple_form / form_builder.rb : map_type :text, :to => SimpleForm::Inputs::TextInput map_type :file, :to => SimpleForm::Inputs::FileInput map_type :string, :email, :search, :tel, :url, :to => SimpleForm::Inputs::StringInput map_type :password, :to => SimpleForm::Inputs::PasswordInput map_type :integer, :decimal, :float, :to => SimpleForm

Text fields from array in Rails

一笑奈何 提交于 2019-12-23 04:05:34
问题 I'm trying to generate a set of text fields for an array using Rails 2.3. I have an array in my controller (which is not part of the model), and I'd like to make a text field for each entry. The array is like: @ages = [1, 3, 7] # defaults Then, I'd like to generate 3 text field in my view with the values 1, 3, and 7, and have the array filled with the user's values when submitted. I found a bunch of stuff on Google and here, but none that seemed to work for me. I'm sure this is easy in Rails.

How to create Orbeon custom control XBL with predefined visibility, control name, default value?

血红的双手。 提交于 2019-12-23 01:47:08
问题 I have created a custom control (hidden text box with some predefined value), where I want to set visibility=false() , controlName="Mycustom" , default value="This is my custom control" in XBL file. So that whenever we use that custom control from Orbeon Form Builder, it will come with all default values with no need to set anything. XBL: <xbl:xbl xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www

fields_for form builder object is nil

回眸只為那壹抹淺笑 提交于 2019-12-22 01:12:26
问题 Any way to access a nested form_bulder.object? ## controller @project = Project.new @project.tasks.build form_for(@project) do |f| f.object.nil? ## returns false fields_for :tasks do |builder| builder.object.nil? ## returns true end end 回答1: You must have accepts_nested_attributes_for in the Project model in order for the object to be passed. class Project < ActiveRecord::Base has_many :tasks accepts_nested_attributes_for :tasks ## this is required end 回答2: fields_for requires that the method

Symfony 2 date input with only year selector

懵懂的女人 提交于 2019-12-21 09:39:09
问题 Is it possible to make a date input field, with only year selector widget in Symfony 2 FormBuilder, or should I use a simple text type input field? 回答1: You can use form customization: {% block date_widget %} {% spaceless %} {% if widget == 'single_text' %} {{ block('field_widget') }} {% else %} <div {{ block('widget_container_attributes') }}> {{ date_pattern|replace({ '{{ year }}': form_widget(form.year), '{{ month }}': '', '{{ day }}': '', })|raw }} </div> {% endif %} {% endspaceless %} {%

Adding a method to FormBuilder that calls a helper method that renders a partial

◇◆丶佛笑我妖孽 提交于 2019-12-21 02:36:23
问题 So I've got this helper method, right? def table_form_field(name_or_options = nil, *args, &block) # ... render :partial => "snippets/table_form_field", :locals => options end It's nice, except sometimes I want to use it with a form builder, and to do that I'd have to call it like this: table_form_field(:foo, :form_builder => f) do |name| f.text_field name end It's annoying to have to specify :form_builder manually. So my goal is to extend ActionView::Helpers::FormBuilder and add a new method

custom async validation not working when returning a promise

大城市里の小女人 提交于 2019-12-19 10:03:58
问题 I'm calling the web api to check if an urlalias is available, for this task I'm using a httpservice in my async validator. The issue is that when the validator is called, all the correct code path is performed (all the console.log() run and behave as expected). Whether the promise from the validation returns/resolves to null or an { 'isUrlAliasActivityMainAvailable': true } , the controller always shows an error object as following, thus keeping the form state as invalid, why (bloody hell!)?