Sha256: 1813fece41092d4dacb586c18cb5535ca7038d1a105b6075a62af037d4ac87d6

Contents?: true

Size: 1021 Bytes

Versions: 10

Compression:

Stored size: 1021 Bytes

Contents

module ActionView
  module Helpers
    module Tags # :nodoc:
      class TextField < Base # :nodoc:
      	include Helpers::JavaScriptHelper
        def p_render
          options = @options.stringify_keys
          options["size"] = options["maxlength"] unless options.key?("size")
          options["type"]  ||= field_type
          options["value"] = options.fetch("value"){ value_before_type_cast(object) } unless field_type == "file"
          options["value"] &&= ERB::Util.html_escape(options["value"])
          add_default_name_and_id(options)
          output = tag("input", options)
          
          clientid = sanitize_to_id(options["id"])
          widgetvar = options["var"] ? options["var"] : "widget_"+clientid    
          script = '$(function() {'
          script += "PrimeFaces.cw('InputText','#{widgetvar}',{id: '#{clientid}' })"
          script += '});'         
          output += javascript_tag(script, "id" => clientid+"_s")              
          
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
prime-rails-0.0.12 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.11 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.10 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.9 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.8 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.7 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.6 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.5 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.4 lib/prime/rails/tags/text_field.rb
prime-rails-0.0.3 lib/prime/rails/tags/text_field.rb