class FieldCombo
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)
Attributes
pc[RW]
Public Class Methods
new(pc)
click to toggle source
Calls superclass method
MyRendererCombo::new
# File lib/FormHolder/Form/InputHolder/FieldCombo.rb, line 6 def initialize(pc) @pc=pc item['field']=true item['type_def']="[name:text][type:text]" item['querysql']="" # item['querysql']="select cdata,cdisplay,description from scv where combo='#{item['data']}' order by cdisplay" #parentM should be an admin Form #parentM.parentM should be an EditableList of Formsitems or Listheaders or Forms(in wysiwyg FormEditor) if ppid=pc.parentM.parentM.parentselected if attr_row=qrow("select data from gtkattributes where gtkobjectid='#{ppid}' and gtkobjecttype='form' and `attribute`='table'") and table=attr_row["data"] item['querysql']="select * from `#{table}` limit 1" else if row=parentM.qrow("select moditems.querysql,queries.sql from moditems left join queries on queries.id = moditems.query_sql_id where moditems.id='#{ppid}'") querysql=row['sql'] if !row["sql"].nil? and row["sql"].length>5 querysql=row['querysql'] if row["querysql"].length>5 item['querysql']="#{querysql} limit 1" end end end super(pc) end
Public Instance Methods
inspect()
click to toggle source
# File lib/FormHolder/Form/InputHolder/FieldCombo.rb, line 32 def inspect "FieldCombo #{item["description"]}" end
item()
click to toggle source
# File lib/FormHolder/Form/InputHolder/FieldCombo.rb, line 29 def item pc.item end
to_s()
click to toggle source
# File lib/FormHolder/Form/InputHolder/FieldCombo.rb, line 35 def to_s inspect end