| tgext.ajaxforms. ´Â Turbogears2¿¡¼ Ajax ¾ç½ÄÀ» ½±°Ô ¸¸µé ¼ö ÀÖ½À´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
tgext.ajaxforms. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- MIT/X Consortium Lic...
- °Ô½ÃÀÚ À̸§:
- Alessandro Molina
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://www.objectblues.net/wiki/show/FlatLand
tgext.ajaxforms. ű×
tgext.ajaxforms. ¼³¸í
Turbogears2¿¡¼ Ajax ¾ç½ÄÀ» ½±°Ô ÀÛ¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù tgext.ajaxforms´Â Turbogears2 ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼ Ajax·Îµå ¹× Á¦Ãâ µÈ ¾ç½ÄÀ» ºü¸£°í ½±°Ô ¸¸µé ¼öÀÖ´Â ÆÄÀ̽㠸ðµâÀÔ´Ï´Ù. ¾ç½Ä Ajax ±â¹ÝÀÇ Ajaxforms.ajaxLoaded Decorator¸¦ ToscAwidgets ¾ç½Ä¿¡ Àû¿ëÇÏ°í AjaxURL º¯¼ö¸¦ ¼±¾ðÇÏ¿© ¸Þ¼µå¸¦ ÁöÁ¤ÇÏ´Â ¹æ¹ýÀ» ÁöÁ¤ÇϽʽÿÀ. ¾ç½ÄÀ»·ÎµåÇÕ´Ï´Ù. ÀÌ ¹æ¹ýÀº ÀÚµ¿À¸·Î »ý¼ºµÇ°Å³ª ¼ÕÀ¸·Î ¾²¿©Áú ¼ö ÀÖ½À´Ï´Ù. ±âº»ÀûÀ¸·Î AJAX À¯È¿¼º °Ë»ç°¡ ÀÚµ¿À¸·Î Áö¿øµË´Ï´Ù. installingtgext.ajaxformÀº pypi ¶Ç´Â bitbucket¿¡¼ ¸ðµÎ ¼³Ä¡ÇÒ ¼ö ÀÖ½À´Ï´Ù. easy_install tgext.ajaxformsshould´Â Ajax formake Æû ÀÚü°¡ Toscawidgets Çü½Ä ÀÏ ¼öÀÖ´Â ´ëºÎºÐÀÇ »ç¿ëÀÚ¸¦ À§ÇØ ÀÛ¾÷ ÇÒ ¼ö ÀÖ½À´Ï´Ù. @ajaxloaded decorator of form ÀÚü¿Í °ü·Ã ÄÁÆ®·Ñ·¯ ¸Þ¼µå¸¦ °¡¸®Å³ ¼öÀÖ´Â ¾ç½ÄÀÇ AjaxURLÀ» ÁöÁ¤ÇÕ´Ï´Ù. tgext.ajaxforms °¡Á® ¿À±â ajaxloaded @ ajaxloadedclass testForm (twf.tableform) : Ŭ·¡½º Çʵå (widgetslist) : name = twf.textfield ( 'name', validator = validators.string (not_empty = true)) surname = twf.textfield ( 'surname', validator validators.string (not_empty = true)) ajaxurl = '/ form_show'action = '/ form_submit'submit_text = "GO"TEST_FORM = TESTFORM () ¾ç½ÄÀ» º¸¿©ÁÖ´Â ¾ç½ÄÀ» º¸¿©ÁÖ´Â ¾ç½ÄÀ» º¸¿©ÁÖ´Â °ÍÀº ¾ç½Ä ÀÚü¸¦ Ç¥½Ã ÇÒ ¾ç½ÄÀÇ AJAXURL ¸Å°³ º¯¼ö¿¡ ¹ÙÀεù µÈ ÄÁÆ®·Ñ·¯ ¸Þ¼Òµå¸¦ Ãß°¡ÇÏ°í ¸Å¹ø AJAXForm¿¡¼ »ç¿ëÇÒ ¶§¸¶´Ù AJAXFORM¿¡ ÀÇÇØ »ç¿ëµÉ ÇÊ¿ä°¡ÀÖ´Â ¾ç½ÄÀ» º¸¿©ÁÝ´Ï´Ù. µð½ºÇ÷¹ÀÌ T. ±×´Â Çü¼ºÇÕ´Ï´Ù. ´ëºÎºÐÀÇ °æ¿ìÀÌ ¹æ¹ýÀº AjaxForm È£ÃâÀ» »ç¿ëÇÏ¿© »ý¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¶ÇÇÑ ¾ç½ÄÀÌ·Îµå µÉ ÆäÀÌÁö¸¦ ¸¸µé¾î¾ßÇÕ´Ï´Ù. ¿¹¸¦ µé¾î, jaxurl = '/ form_show'¸¦ °¡Áø À妽º ÆäÀÌÁö¿¡¼ ¾ç½ÄÀ» Ç¥½ÃÇÏ´Â °Í : tgext.ajaxforms¿¡¼ ajaxformclass rootController (BaseController) °¡Á® ¿À±â : form_show = ajaxform (test_form) @ ³ëÃâ ( 'myApp.templates.Index') DEF À妽º (self) : Dict (form = test_form) return dict (form = test_form) myApp.templates.Index ÅÛÇø´Àº toscawidgets ±â¹Ý ¾ç½ÄÀ» Ç¥½ÃÇÏ´Â µ¥ »ç¿ëÇÒ ÀϹÝÀûÀÎ ÅÛÇø´À»º¸¾Æ¾ßÇÕ´Ï´Ù.
Ajax ¾ç½Ä Å×½ºÆ® ¿¹Á¦ Ãë±Þ Á¦Ãâ ¹× À¯È¿¼º °Ë»ç ¹× À¯È¿¼º °Ë»ç´Â Ajaurl ¹ÙÀÎµå ¸Þ¼Òµå¸¦ Error_ha·Î »ç¿ëÇϱ⠸¸ÇϸéµË´Ï´Ù. NDLER : Class RootController (BaseController) : @expose () @validate (test_form, error_handler = form_show) DEF FORM_SUBMIT (Self, ** Kw) : '°¨»çÇÕ´Ï´Ù : {name} {Surname}'. Çü½Ä (** kW) examplemyApp.templates.Index : Ajax ¾ç½Ä ¿¹Á¦ myApp.controllers.root :¿¡¼ tgext.ajaxforms °¡Á® ¿À±â ajaxloaded, ajaxform @ ajaxloadedclass testform (twf.tableForm) : Ŭ·¡½º Çʵå ( widgetslist) : name = twf.textfield ( 'name', validator validators.string (not_empty = true)) surname = twf.textfield ( 'surname', validator validators.string (not_empty = true)) ajaxurl = '/ form_show 'action ='/ form_submit 'submit_text = "go"test_text = testform (baseController) : form_show = ajaxform (test_form) @expose ('myApp.templates.index ') def »öÀÎ (self) : return dict (Æû = test_form) @ expose () @Validate (test_form, error_handler = form_show) def form_submit (self, ** kw) : '°¨»çÇÕ´Ï´Ù : {name} {surname}'. Çü½Ä (** kw) ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã
tgext.ajaxforms. °ü·Ã ¼ÒÇÁÆ®¿þ¾î