Re: Client en Server side validation
I've got 2 types of validation. Syntax and business rules. The syntax can be solved in the presenter, but i don't want to validate the whole bean if i only want to validate one property of that bean. I'm thinking to make it like this: Class Foo() { Date date; String otherfield; public validateAndSetDate(String textFromWidget, Error errors) { // try to make the string into a valid date with some date utils if not ok, than fill the errors object with an error message } Now i can try to set the value after a onBlur() in the presenter to try to update the model (Foo) But i want to do the same on the server after a RPC call because the user could possible tamper the data somehowshould i than check all the validateSetters? of all my properties with validateAndSetDate(foo.getDate.asString(),errors) ?? I would be nice that i only check the changed properties after my last RPC call. Any ideas? Thanks. Jeroen -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Client en Server side validation
Hi, there has been a lot of discussion already in this group about validation and the frameworks that can help with it. Now i'm in a big project which need form/field validation onChange focus events and the same field validation need to be done on the server when the domain objects are being send via RPC to the server. Based on the concept: Always validate your input. The data coming in on the server is also input that we want to validate. Is this a right approach? If so, why can't i find this issue more spoken of...or does anybody thrust the rpc input? How do you slove this problem? If i make the presenter responsible for validating the widgets input, how does i know on the server which validator to use because on the server i have no presenter. Do you have patterns for this problem? Thanks, Jeroen Wolff -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Who handles UI rules...the Activity?
Hi, i try to figure out where the decision logic is programmed when a user answers a question via a radio-button. I am designing an form application and want to know where to put al the decisions rules. For example: - a user selects a radio button and based on that click a extra question will be shown in the view. - a user push add button and new block of data with question will be shown In view: @UIHandler(question_yes) void onClickYes(ClickEvent e) { presenter.handleYesQuestionClicked() } But how can the Activity tell the View to add or show a widget? So there will be some logic also in the View? Is this the 'right' way? Regards, Jeroen Wolff -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: dumb / dto domain model
Our model got all the rules for showing elements or not. So a ui element is observing these changes in the model. This is done so we can always validate our model (also on sever) to see if all the needed and calculated values are there. How to solve that in MVP? Will the model than put his changed values/ properties on the bus? I'm thinking in a way to make bindings between domain and view. These binding are than converting and syntax checking the values from the ui elements to the 'typed' data in the model. Is this a good way to go, or do you strongly advise to go another way? I don't want to program my business (showing/not showing fields etc) in the presenter for the ui logic and on the server for model validating. Twice. Regards, Jeroen Wolff On Aug 25, 10:46 pm, John Ivens john.wagner.iv...@gmail.com wrote: Won't the event bus and presenters solve this problem for you? The Model-View-Presenter paradigm? On Wed, Aug 25, 2010 at 11:51 AM, Jeroen Wolff jeroen.wo...@gmail.comwrote: Hi, where are in the middle of designing a big app with a lot off difficult forms. On these forms there will be a lot of questions and based on the results more questions. Also lot of field validation. The current app is a standalone app and the domain model is a big tree with the Observable patterns (property change) If a user is changing a field a lot of other data will than be trigger to change also. Now we want to port is to a web based application, and because with GWT we can write the same model and produce client side the same domain as in the old stand alone app. But.in Ray Ryan's talk about architecting GWT apps for production he said: When you are in a web app, we've encouraged you to make your model, you're so-called model a very simple object. We don't really think that JavaBeans with property change events and that kind of thing work terribly well. We encourage you instead to use more of a DTO for your model portion. The odds are that the object that embodies the things that the users are thinking about is a dumb little bag of properties. Can somebody explain to me why it is not done? Why only DTO's at the client side? The business model lives on the server only than? How can i know and where do i specify what the next step or question or validation is when the user change a value is a form? It would be great to get some help on this design issue. Regard, Jeroen -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
dumb / dto domain model
Hi, where are in the middle of designing a big app with a lot off difficult forms. On these forms there will be a lot of questions and based on the results more questions. Also lot of field validation. The current app is a standalone app and the domain model is a big tree with the Observable patterns (property change) If a user is changing a field a lot of other data will than be trigger to change also. Now we want to port is to a web based application, and because with GWT we can write the same model and produce client side the same domain as in the old stand alone app. But.in Ray Ryan's talk about architecting GWT apps for production he said: When you are in a web app, we've encouraged you to make your model, you're so-called model a very simple object. We don't really think that JavaBeans with property change events and that kind of thing work terribly well. We encourage you instead to use more of a DTO for your model portion. The odds are that the object that embodies the things that the users are thinking about is a dumb little bag of properties. Can somebody explain to me why it is not done? Why only DTO's at the client side? The business model lives on the server only than? How can i know and where do i specify what the next step or question or validation is when the user change a value is a form? It would be great to get some help on this design issue. Regard, Jeroen -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
MPV HasTitle for TabPanel???
Hi, i'm just starting with the MVP pattern. I've got a Presenter with a View that has a TabLayoutPanel component. The title of the tab's must be filled by the presenter with a title/ text from the model. Any ideas how to do this? Regards, Jeroen Wolff -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: MPV HasTitle for TabPanel???
Sorry for the spam...i'm a newbee in MVP and GWT I've solved it by adding a Label firstTabLabel, secondTabTabel in the view. Now in the constructor of the view i can TabLayoutPanel add.(panel1, firstTabLabel) etc and HasText firstTabLabel wich i can use in the Presenter. Jeroen On Aug 18, 10:07 am, Jeroen Wolff jeroen.wo...@gmail.com wrote: Hi, i'm just starting with the MVP pattern. I've got a Presenter with a View that has a TabLayoutPanel component. The title of the tab's must be filled by the presenter with a title/ text from the model. Any ideas how to do this? Regards, Jeroen Wolff -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
mvp for application with menutree
Hi, i'm just starting with GWT. First is started to build my app without MVP and now i see why they advise to use the MVP pattern and the eventbus. I'm building an application with a DockLayout with on the west a treemenu and in the center a form. Which form to display depends on the selected menu item. How kan i replace presenters (the different forms) in the center of the main DockLayout. Via an event? And in the menu i want submenu items and those will select a (Dock)panel inside the center form pan. The screen layout is like this (screen-layout.png): Is a menu click an event on the bus? How can the application controller replace the needed presenter inside the main docklayout? Thanks for all suggestions, Regards, Jeroen Wolffinline: screen-layout.png-- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.