- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我正在 java 中使用网格小部件...并且当尝试迭代 ListStore 时出现以下错误。
[javac] required: array or java.lang.Iterable
[javac] found: ListStore<String>
关于如何解决这个问题/为此创建迭代器有什么建议吗?
这是我的代码:
public void cycle(ListStore<String> line_data){
for(LineObject line: line_data){
//Other code goes here
}
}
最佳答案
如javadoc所示List Store不实现Iterable 。因此您无法使用 foreach 循环对其进行迭代。
只需使用 getAll() List Store 的方法会返回 java.util.List它正确地实现了 Iterable。
但另一个问题是您正在尝试使用 LineObject
进行迭代自从你的 ListStore
以来,这将不起作用使用 String
声明即ListStore<String>
而不是ListStore<LineObject>
这里是一些示例代码:
public void cycle(ListStore<String> line_data){
List<String> lineListData = line_data.getAll();
//for(LineObject line: lineListData){ <-- won't work since you are using Strings
for(String line: lineListData){ // <-- this will work but probably not what you want
//Other code goes here
}
}
回顾您对问题的编辑,您可能只想使用 LineObject
:
public void cycle(ListStore<LineObject> line_data){
List<LineObject> lineListData = line_data.getAll();
for(LineObject line: lineListData){
//Other code goes here
}
}
关于java - Java Gxt 中 ListStore 的迭代,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27710980/
我似乎找不到关于 GXT 中什么事件触发以及何时触发的任何文档。 API 文档列出了所有可能触发的事件(在 Events 中)。它描述了如何处理您捕获的事件。但我对相反的一面感兴趣,当我采取某种行动时
我正在尝试使用 GXT (ExtJS + GWT) 运行示例应用程序,如教程中所述 http://www.sencha.com/learn/setting-up-your-first-ext-gwt-
我有以下代码,可以在 GXT 开发模式下完美运行。但它不能在 GXT 服务器模式下工作。你能帮我解决这个问题吗? String stringValue = "Servicing"; if (strin
我现在正在将一个应用程序从 GXT 2 迁移到 GXT 3。 两者之间的主要区别之一是 GXT 3.x 允许在小部件中使用 POJO,而 GXT 2.x 小部件需要实现 ModelData 的对象。
我使用 GXT 2.2.3 创建了 EditorGrid。所需的一切都结束了。但在某一时刻我陷入困境,即我需要根据一个单元格中的值禁用和启用某些单元格。我对此提出了问题 How to make cel
我们正在尝试在 GWT 中制作一个资源管理应用程序。但我们需要某种调度程序。 GXT调度器是一个很好的资源管理工具,但它是一个付费工具。所以我想知道我们是否可以使用 GWT 和 GXT 制作我们自己的
我有以下一段代码,用于最初构建在 gxt 3.0.0 框架上的项目。 msgBoxInterim.addHideHandler(new HideHandler() {
我正在尝试使用 Gxt 3.1.1 在我的项目中实现类似以下代码的内容: CheckBox checkBx = new CheckBox(); checkBx.setReadOnly(False);
我有一个 GXT 网格,并希望其中的列适合屏幕。这是我的网格现在的样子: 看起来是这样,因为我已经为适合我的屏幕的列宽设置了具体值。我希望列自动适应网格的宽度 最佳答案 Javadoc 对此非常清楚:
我对 GWT 和 GXT 很陌生,我尝试制作一个非常简单的应用程序,但它似乎不起作用。这是我的 onModuleLoad() 方法。看起来它并没有获得带有可折叠元素的漂亮布局,而是全部折叠到左侧部分。
如何在GXT (Java)中渲染网格中的特定网格单元? 我想验证网格单元格中的表达式(作为字符串),如果网格单元格中的表达式具有无效语法,则相应网格单元格的背景应更改为红色,否则背景应保持白色。 以下
我在生产模式下遇到问题。在开发我的应用程序时,我正在使用开发模式,并且在测试时一切正常。当我编译应用程序以部署在服务器上时,某些功能不起作用。例如,我对某些组合框有问题,或者并非所有文本字段都将其状态
我正在使用 GWT (Google Web Toolkit) 1.5.3 和 GXT (ExtJS) 1.2我只想创建一个简单的表单,其中包含一些在 RPC 调用后生成的单选按钮,以获取一些值 代码:
我正在使用 GXT 2.1.1 开发分页网格,我正在使用 hibernate 从数据库表中检索值。我的代码是 public class ExampleSampleTrip extends Compo
我有一个 loading.gif 图像,需要将其与组合框对齐 在我看来,我有一个用于存储数据的列表存储。
我有一个使用 GXT 并包含 ±30 个表单的应用程序。我想制作这些表单,以便当用户在文本字段中输入回车键时,表单就会被提交,就像常规浏览器表单一样。 我知道我可以向每个文本字段添加一个按键监听器,这
如何设置分割栏的样式?我想为边框布局的分割栏应用不同的颜色。我正在使用gxt-3.x 最佳答案 我认为你可以看看这个 CSS 规则: .x-layout-split { ... } .ext-stri
我有这样的问题 - 例如,当我单击网格单元时 - 出现 gxt 窗口(gxt 弹出窗口、gxt 对话框等。不是 native 浏览器/操作系统对话框)。窗口使用后,当它隐藏时 - 网格失去焦点。我该如
我正在遵循 GXT 网站上的示例:http://www.sencha.com/examples/#ExamplePlace:paginggrid 他们的代码创建一个 RPCProxy,重写 load(
。 . 我根据单元格的值为一列着色,但我想在 gxt 网格中为整行着色(表示单元格包含的行)帮助我 这是我为单元格着色的代码(我想为行而不是单元格着色) /*------------Coloring
我是一名优秀的程序员,十分优秀!