如何打印 roo uiModel 中的值?
当我在 jspx 页面中打印 uiModel ${subscribers}
时。我收到以下信息:
"[Code: S0001, FirstName: John,
LastName: Smith,
Message: New subscriber,
Active: 1,
RouteID: Code: 1,
Name: Route 1,
Active: 1,
TruckID:
Code: t1000,
Name: Truck 1,
Active: 1,
DistrictID:
Code: dst1,
Name: Colombo 1,
Active: 1,
LastModifiedDate: 2011-04-02 15:40:25.0,
LastModifiedUser: admin,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin,
PaymentTypeID:
Code: 1,
Name: Cash,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin]"
如何仅打印属性“代码”:
我尝试了以下操作,但它打印空字符串:
${subscribers[Code]}
我还有一个问题。如何发送多个 uiModel 并以表单显示并更新它们?
When I print uiModel ${subscribers}
in jspx page. I am getting following:
"[Code: S0001, FirstName: John,
LastName: Smith,
Message: New subscriber,
Active: 1,
RouteID: Code: 1,
Name: Route 1,
Active: 1,
TruckID:
Code: t1000,
Name: Truck 1,
Active: 1,
DistrictID:
Code: dst1,
Name: Colombo 1,
Active: 1,
LastModifiedDate: 2011-04-02 15:40:25.0,
LastModifiedUser: admin,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin,
PaymentTypeID:
Code: 1,
Name: Cash,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin,
LastModifiedDate: 2011-04-02 00:00:00.0,
LastModifiedUser: admin]"
How can I print the property "Code" only:
I tried the following but it print empty string:
${subscribers[Code]}
And I have one more question. How to send multiple uiModels and display in form and update them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,您推入 Roo 在文件“[Entityname]_Roo:ToString.aj”中生成的 toString 方法并重新实现它,以便它返回您想要的值。
像这样的东西:
Generally you pushin the toString method that Roo have generated in the file "[Entityname]_Roo:ToString.aj" and reimplement it so it returns the value(s) that you want.
Something like: