Base solution for your next web application
Open Closed

Dependent Dropdown with aspnetzero and Angular #11550


User avatar
1
maberry created

Can someone please provide assistance with configuring a dependent dropdown picklist for my application. Specs are as follows: Latest version of aspnetzero is being used.

Table 1: Customer Table 2: Location Table 3: Order Table 4; OrderLocation

Customer can have many locations. Therefore, the customer table uses a master-detail layout with Location (this is working fine). Both customer and location are set up as lookups in the OrderLocation table.

Orders can have only one customer but many locations, and the OrderLocation table provides tracking/status for each location in the order. Therefore, customer is a lookup field in the order table.

I want use one of the Metronic wizard layouts. When I create a new order, I want to be able to select the customer from the picklist. Then next screen will take me to the OrderLocation table where I want to select locations based only on the customer identified in the Order table.

I’ve seen several similar questions, but I haven’t seen anything similar enough for me to replicate. Mainly because I am new to aspnetzero and there is a learning curve with respect to the flow of data from database to angular. I am not the strongest with Angular, but I am using Angular because it appears to be “easier” to manipulate certain aspects within the DDD/aspnetzero framework.

Using this as a guide:

I have not made any modifications to the files generated by PowerTools within Visual Studio, so given the parameters above, I believe I need to change selectedCountry to _orderLocationServiceProxy,

The countries variable will need to be changed to order, and the states variable will need to be changed to location; however, I can not figure out the changes necessary for Country[] and State[] within the aspnetzero framework.

I assumed it would be something similar to _orderLocationServiceProxy.getAll(), but that does not work.

I know changes will also need to be made for the onSelect syntax as well, but I haven’t been able to try anything because I haven’t gotten the above working yet.

As previously indicated, I have searched the support forum here as well popular sites such as stackoverflow, but I have not been able to isolate my specific use case. Any assistance would be greatly appreciated.


13 Answer(s)
  • User Avatar
    0
    maberry created

    Three days and no response from customer support. This does not bode well considering I just getting into aspnetzero. Good thing I am still within the 30 day window.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maberry

    Sorry for our late reply. AspNet Zero Power Tools generates the pages in a specific way. The scenario you are trying to develop is something totally different. Converting Power Tools generated source code to Metronic wizard is not something we can provide support for.

    However, you can develop this page from scratch and I think it will be easier. To learn basics of ASP.NET Zero's Angular version, I suggest you to first follow https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Developing-Step-By-Step-Angular-Introduction if you haven't.

    Then, you can use correct servies for filling dropdowns. I hope this helps you to get started with AspNet Zero.

  • User Avatar
    0
    maberry created

    Hi @maberry

    Sorry for our late reply. AspNet Zero Power Tools generates the pages in a specific way. The scenario you are trying to develop is something totally different. Converting Power Tools generated source code to Metronic wizard is not something we can provide support for.

    However, you can develop this page from scratch and I think it will be easier. To learn basics of ASP.NET Zero's Angular version, I suggest you to first follow https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Developing-Step-By-Step-Angular-Introduction if you haven't.

    Then, you can use correct servies for filling dropdowns. I hope this helps you to get started with AspNet Zero.

    I am not asking for asking for assistance converting Power Tools generated source code to the Metronic wizard layout.

    What I need to know is how to implement a cascading dropdown list within the aspnetzero framework. The "typical" way of doing it will not work because of how the aspnetzero code is structured.

    I am not sure why you offerred the link you did. It does not appear to offer a cascading dropdown list. Furthermore, I have search all of the sample applications I can find using both aspnetzero and ABP. Several people have asked the same question over the years (such as here: https://support.aspnetzero.com/QA/Questions/3292/Cascading-Dropdownlist). Unfortunately, the support representative sent the information via email rather than provide assistance through the forum.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maberry

    Sorry, then I misunderstand your question. In that case, you need to define onChange event (see https://primeng.org/dropdown#api.events) of each dropdown and then fill the following dropdown accordingly.

    You can take a look at this sample https://stackblitz.com/edit/cascading-dropdown-angular?file=app%2Fapp.component.ts

  • User Avatar
    0
    maberry created

    Hi @maberry

    Sorry, then I misunderstand your question. In that case, you need to define onChange event (see https://primeng.org/dropdown#api.events) of each dropdown and then fill the following dropdown accordingly.

    You can take a look at this sample https://stackblitz.com/edit/cascading-dropdown-angular?file=app%2Fapp.component.ts

    Respectfully, can you please read my original post. The link you provided is the exact same link I referrenced. I then provided several statements as to why the code in that link does not match up with aspnetzero. What I need to know is how to implement the code from the link I provided within the aspnetzero framework. I have spent days trying different things within the code structure, but they have not worked. I am new to Angular, but I even asked someone who has worked with Angular for several years. He was unable to quickly figure it out because of how the aspnetzero code is structured.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maberry

    Is it possible to share your project's source code with [email protected] ? It would be better for us to help you on your source code with this issue.

    Thanks,

  • User Avatar
    0
    maberry created

    Hi @maberry

    Is it possible to share your project's source code with [email protected] ? It would be better for us to help you on your source code with this issue.

    Thanks,

    Yes of course. You should have a github invite pending. I will followup with an email to [email protected] as well.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maberry

    We have sent you an email but didn't get a reply. Could you check your spam folder ?

    Thanks,

  • User Avatar
    0
    maberry created

    Hi @maberry

    We have sent you an email but didn't get a reply. Could you check your spam folder ?

    Thanks,

    Hi - Do you have an update? I replied to your email two weeks ago.

  • User Avatar
    0
    murphymj5209 created

    just letting you know that I am very interested in this solution also. thanks.

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi,

    We are committed to finding an optimal and inclusive solution while providing you with the best possible assistance. Rest assured that once we identify a viable resolution, we will gladly share it with all our valued customers, ensuring everyone benefits from the improvements we make.

  • User Avatar
    0
    maberry created

    Do you still not have a "viable resolution" to this issue?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maberry

    In our last email, we asked you to invite https://github.com/m-aliozkaya to your private Github repository but probalby that email went into your spam folder. So, could you invice

    https://github.com/m-aliozkaya and https://github.com/ismcagdas

    for a temporary access to your GitHub repository ?

    Thanks,