Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Master-Detail datasources

    Hi,

    I'm new to SmartGWT. I'm having the following requirement to be satisfied with SmartGWT.

    Requirement:
    -------------
    In database, I'm having 2 tables among them 1 is master table(location) and the other is detail table(place). A location can have many places.
    Cardinality -> Location:Place <==> 1:N

    In UI, I want to display only the location data in a list grid. When I select any location from the above listgrid, places corresponding to the selected location should be populated in another grid which is for places.

    Current Approach:
    ------------------
    Curretly, I'm trying to achieve this by following steps,

    Note: RestDataSource is used in my app.

    1. Creating a DataSource for location.
    2. Creating a Datasource for Place.
    3. Creating a DataSourceField in LocationDataSource and set its type as DataSource by passing the instance of PlaceDataSource and setMultiple(true) for this field.
    4. Creating a DataSourceTextField in PlaceDataSource and set it as foreign key by passing the parameter 'locationDsId.locationId'.
    5. Create a ListGrid to display location data(only).
    6. LocationDataSource is mapped with LocationGrid.
    7. Create a ListGrid to display places for the selected location in above ListGrid.
    8. PlaceDataSource is mapped with above PlaceGrid.
    9. When location is selected from location grid, invoking fetchRelatedData(locationGrid.getSelectedRecord, LocationDataSource instance).

    But the above mentioned steps giving me Transport error - 404.../sc/IDACall.

    Can anybody give me solution for this problem?

    Thanks & Regards,
    Rajkumar.

    #2
    Hi RajkumarGandhiKV,

    "HTTP 404" is not related to your use case, your DS are just not working, because you don't hit the servlet responsible for processing you requests
    Watch with Firebug where the requests go and look where they should go.
    Compare to builtInDS sample and adjust your main HTML accordingly.

    Best regards,
    Blama

    Comment

    Working...
    X