Test the new controls

This commit is contained in:
YNH Webdev
2013-09-05 17:18:46 +02:00
parent edce18fb1f
commit 225f821206
6 changed files with 24 additions and 13 deletions

View File

@@ -27,13 +27,13 @@ feature
create textbox1.make_text ("txtBox1", "1")
create textbox2.make_text ("txtBox2", "2")
create button1.make_button ("sample_button1", "SUM")
create textbox_result.make_text ("txtBox3", "")
create textbox_result.make_textarea ("txtBox3", "")
button1.set_click_event (agent handle_click)
create form.make_form_control ("panel")
form.add_control (create {WSF_FORM_ELEMENT_CONTROL[STRING]}.make_form_element("Number1",textbox1))
form.add_control (textbox2)
form.add_control (create {WSF_FORM_ELEMENT_CONTROL[STRING]}.make_form_element("Number2",textbox2))
form.add_control (button1)
form.add_control (textbox_result)
form.add_control (create {WSF_FORM_ELEMENT_CONTROL[STRING]}.make_form_element("Result",textbox_result))
control := form
end
@@ -52,6 +52,6 @@ feature
textbox2: WSF_TEXT_CONTROL
textbox_result: WSF_TEXT_CONTROL
textbox_result: WSF_TEXTAREA_CONTROL
end

View File

@@ -27,7 +27,8 @@ controls = {}
class WSF_BUTTON_CONTROL extends WSF_CONTROL
attach_events: ()->
self = @
@$el.click ()->
@$el.click (e)->
e.preventDefault()
self.click()
click: ()->
if window.states[@control_name]['callback_click']

View File

@@ -53,7 +53,8 @@
WSF_BUTTON_CONTROL.prototype.attach_events = function() {
var self;
self = this;
return this.$el.click(function() {
return this.$el.click(function(e) {
e.preventDefault();
return self.click();
});
};