检票和复杂的Ajax场景 [英] Wicket and complex Ajax scenarios

查看:151
本文介绍了检票和复杂的Ajax场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当屏幕上有多个交互的Ajax控件,并要控制组件的可见性,以应对这些控件(这样你只显示情理之中的事情在任何情况下),调用 target.addComponent ()手动上要更新越来越繁琐,是不是很维护。一切

When a screen has multiple interacting Ajax controls and you want to control the visibility of components to react to these controls (so that you only display what makes sense in any given situation), calling target.addComponent() manually on everything you want to update is getting cumbersome and isn't very maintainable.

最终的Web 的onClick 的onupdate 回调可以达到一个地步,添加新的组件到屏幕越来越多的难度比它应该是。

Eventually the web of onClick and onUpdate callbacks can reach a point where adding a new component to the screen is getting much harder than it's supposed to be.

什么是最常用的策略(甚至图书馆,如果这样的事情存在),以避免这种积聚的复杂性?

What are the commonly used strategies (or even libraries if such a thing exists) to avoid this build-up of complexity?

更新:谢谢您的回答,我发现他们都非常有用的,但我只能接受一个。对不起。

Update: Thank you for your answers, I found all of them very useful, but I can only accept one. Sorry.

推荐答案

那么,有多少成分我们说话吗?十?二十?数百名?

Well, of how many components do we speak here? Ten? Twenty? Hundreds?

有关多达二十或有关这一点,你可以控制哪些组件应该显示的状态控制器。该控制器设置的组件模型的可视领域,你随时添加的所有组件这是由控制器来处理你的请求。该组件的AJAX事件,你只需重定向到控制器处理方法。

For up to twenty or about this you can have a state controller which controls which components should be shown. This controller sets the visible field of a components model and you do always add all components to your requests which are handled by the controller. The components ajax events you simply redirect to the controller handle method.

有关真的大量组件具有一个过重的有效载荷有一个良好的表现,你可以使用JavaScript库,比如jQuery的客户端做的显示和隐藏的东西。

For really large numbers of components which have a too heavy payload for a good performance you could use javascript libraries like jQuery to do the show and hide things by the client.

这篇关于检票和复杂的Ajax场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆