facebook

How to make crud gwt generation less crud ?

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #351490 Reply

    totoheros
    Member

    Hi,

    I have generated a CRUD gwt 2.0 app from PurchaseOrder, OrderDetail, Product tables.
    But I would like to make it less crud !.

    I want my user to be able to manage relation. For example, select a Product from an orderDetail instead of changing the productcode.

    It would be nice to add a button “Pick Product…” from the OrderDetail Editor
    See image attached,

    I seen that the necessary code is genered in gwt.product.client.components package.
    see code source attached.

    Is there a way to achieve this ?
    Thanks in advance

    Totoheros

    Attachments:
    You must be logged in to view attached files.
    #351528 Reply

    totoheros,

    This is a GWT development query. I suggest you cross post to GWT or development related forums like stackoverflow.com for better support on this query.

    Let us know if you see any issues with MyEclipse.

    #351529 Reply

    totoheros
    Member

    Ok thanks. Does that means that I can publish the genereted code from myeclipse ?

    I have already some encouraging results and if somebody is interested or have any suggestion …

    1) I added a button “Pick Product…” the same way as in SingleRelatedToProductWidget.ui.xml
    into OrderdetailEditWidget.ui.xml

    2) In OrderdetailEditor.java, I added the following code as in RelatedToProductEditor.java

    
            // Handle the Select gesture
            display.getSelectButton().addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    final ProductPicker picker = new gwt.product.client.components.ProductPicker();
                    picker.addCloseHandler(new CloseHandler<PopupPanel>() {
                        public void onClose(CloseEvent<PopupPanel> event) {
                            if (picker.getSelectedproducts() == null || picker.getSelectedproducts().size() <= 0)
                                return;
    
    //                        addProductsToRelated(picker.getSelectedproducts());// original relatedToProductEditor
                            GWTProduct selectedProduct = picker.getSelectedproducts().iterator().next();
                            orderdetail.setProductcode(selectedProduct.getProductcode());
                            edit(orderdetail);
                           
                        }
                    });
    
                    picker.setGlassEnabled(true);
                    picker.center();
                }
            });

    3) need to add in Orderdetail.gwt.xml
    <inherits name=”gwt.product.Product”/>

    #351545 Reply

    totoheros,

    Yes, you can post the generated code from MyEclipse, on other forums for development related queries.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: How to make crud gwt generation less crud ?

You must be logged in to post in the forum log in