Skip to main content

Hi All,

 

Is there any way to add a predefined view on the smartform dynamically. e.g. when we book an airline ticket, for the passanger list we add as many sections as we want for the passanger list. More suitable example would be a repeater control in ASP.Net.

 

Please share your thoughts.

 

Regards

Gaurav

Hello Gaurav,


 


There is not a smartforms control of similar nature to the repeater control that I know of.


 


I think your best design option here would be to use an editable list view that is hooked to a smartbox smartobject or perhaps a SQL Smartobject hooked to a table. This smartobject would hold onto the passenger list and information. 


 


The next issue would be working with that dynamic aspect. That I am not sure exactly how to implement. The best dynamic OOB tool is the for each event wizard but this merely loops through an already existing collection. We need to dynamically create a collection. 


 


If we are using SQL as our data source for the smartobject perhaps we could write up a stored procedure that could utilize the while loop. (https://msdn.microsoft.com/en-us/library/ms178642.aspx). We could create a variable of count then that must be defined when executing the stored procedure. That count could come from the form where the amount of passengers is defined. We could then create a smartobject out of this sproc, and have it run on the form where we pass in the passenger count. Now the stored proc will run and create new entries in the passenger list table, which is also tied to a smartobject. We then show the view of the passenger list that is tied to this smartobject and there should be the amount of entries required. 


 


Let me know if that makes sense. This is all something I worked out in my head and have not tried it in practice. It is possible this will not provide a solution but I think it could work. Let us know!


 


Thanks,


Evan


Hi Evan,

Thanks for your kind thoughts. That clearly make sense. However in my case I have 50 confirms controls on a view and there are 6-7 such views.

More importantly user can add more than one kind of a view on the form e.g. 2 views one, 3 views two etc. That all happening at runtime.

Please advise if you feel a better option to cover this.

Another option that we have used is to use a URL content control.

So on a main form we have a list view or even a list box that has all the "rows" of data (I think in your case this is passengers?)

Then we have a big url content control that loads when you select an item in the list.  The logic on which form is displayed and parameters can then vary by row.

 

Since this is more like wizard style form, we added Next & Previos buttons that help the user move through the list.

 

This is not ideal and we continue to struggle with wanting to do more dynamic views like those you are suggesting.

 


Thanks for your response Nathan, That is certainly in the direction I am looking for.

 

The only major issue is that the requirement is to add multiple instance of different views on the runtime on form basis what user want to add. So passanger list was just a small example which requires the similar stuff to be done but on a smaller scale. What if a view contains 25-30 contorls and one needs to add 4-5 instances of the same view(of course with different values).


Reply