StrataFrame Forum

ListBox Control not rendering

http://forum.strataframe.net/Topic29301.aspx

By Andrew Harper - 1/2/2011

Hi,

I am getting the error message below displayed on a web form in design mode after exiting from the PopulationDataSourceSettings builder:



Immediately below the listbox are DropDownList and ListView Controls both of which display details from the ProductRangeBO correctly when the form is run.

I am using VS2008 and SQL Server 2008 on a Windows XP notebook for development. The notebook also has VS2003, VS2005 & VS2010 installed on it. I have version 1.7.3 of Stratrame installed according the the Help about screen in VS.

Any suggestions most gratefully received,

TIA,

Andy
By Greg McGuffey - 1/4/2011

Andy,

Almost missed this post!  Sorry about that.  Could you paste the source for the listbox?   Are you having trouble with any other instances of the listbox?
By Andrew Harper - 1/5/2011

Hi Greg,

The problem occurs whenever I try to add a list box control after exiting the PopulationDataSourceSettings builder in VS2008. I can specify the Source BO and the columns in the builder but on exit the error occurs. I have attached the aspx file for you. It would appear that the builder is not generating code for the control correctly.

If you could post an example of what code is expected to be generated for a ListBox I will investigate further at this end.

Best regards and thanks,

Andy
By Trent L. Taylor - 1/5/2011

I saw this recently elsewhere and it had to do with the configuration of the web environment.  Do you have your web environment setup as a "Web Site" or a "Web Application"?
By Andrew Harper - 1/5/2011

Hi Trent,

I think as a Web Site - is there an easy way to detemine? (Sorry, new to web development).

Which model should I be using? I will try creating a new project using Web Application model and see is I get the same issue.

Best regards and thanks,

Andy
By Trent L. Taylor - 1/6/2011

The easiest and quickest way to tell is how you add references.  A web application (or project) will allow you to add references just you would for a WinForms or class library project.  Web projects are much better to work with and are more stable.  In VS 2005, Visual Studio went backwards and introduced the Web Site thinking that the implementation and deployment would be easier...they were wrong.  They created an update to bring back the new and improved web application project which is far more stable and easier for distribution. This has been improved even more in VS 2010. 

When you create a web project application, you will select the template from the projects category not the web sites category.

By Andrew Harper - 1/6/2011

Hi Trent,

Thanks for the explanation.

It was set up as a Web Site. I have created a new Web Project using VS2010 on the same Windows XP machine and get the same problem.

I have will try installing Strataframe on a Windows7 VM and see what behaviour I get there.  I am in Melbourne, Australia hence the delay replying to posts.

Best regards,

Andy
By Andrew Harper - 1/6/2011

Still having problem with the builders:

1. I installed StrataFrame on a Windows 7 Virtual Machine with VS 2008 already installed. Strataframe had not been previously installed on this VM.

2. I was able to run the VB Websample application on this machine after changing the connection string in the Global.asax

3. I created a new BO Library application and created a customerBO using the StrataFrameSample database.

4. I created a filltop100() method for customerBO

5. I created a new Web Application Project.

6. I changed the references from 1.6 to 1.7 in the Web.Config file

7. I added the CustomerBO to the ApplicationBasePage

8. I added a new SF Web Form called customers to the web application.

9. I added CustomerBO.FillTop100() to the page load

10. I made customers.aspx the default page for the project

11. I added a table with 1 row to customers.aspx

12 I added a SF Text box to the row

13 I set the text box BusinessObjectName to boCustomer, BindingField to cust_LastName

14. I ran the application and the text box displayed the expected value

15. I added another table row

16. I added a SF ListView

17. I populated the list view as shown



18. I clicked OK.

19. I got the error shown below.



20. I tried adding a ListBox instead of the ListView and populated it as shown below



21. I clicked OK and got the error below



22. I posted this message and stopped for the night, hoping that there will be a response awaiting in the morning.

TIA

Andy

By Ivan George Borges - 1/7/2011

Hi Andrew.

See if this one helps you:

http://www.devtoolshed.com/content/fix-visual-studio-2008-sp1-design-mode-error-text-could-not-be-set-property
By Andrew Harper - 1/7/2011

Hi Ivan,

Thanks for the suggestion, unfortunately I downloaded the hotfix and tried to install on W7. Installer gave message that "The update is not applicable to your computer".

As a further test I added a DropDownList to the form, populated it via the builder, ran the web form and it worked correctly. It would appear that the builders are working for some SF controls and not others.

1. Could you please post an example of the generated HTML for a List Box. I can then try to enter the code manually into the .aspx file  and see what happens.

2. Could you please tell me your recommended configuration for Strataframe Web development? Ie Operating system, VS version, SQL Server version, recommended service packs. I have an MSDN subscription and can build a VM to match your recommendation.

I would prefer to be learning the framework rather than battling VS configuration issues!

Best regards,

Andy
By Ivan George Borges - 1/7/2011

Hi Andrew.

I am sorry the link didn't help.

I am not your best bet on webforms, but hopefully you will get more precise information on your questions from others.

Since you have a MSDN subscription, one thing that could help would be to upgrade to VS2010. So, if you are willing to build a VM for testing, that would be what I would try first.
By Trent L. Taylor - 1/12/2011

Andrew, I have been doing a lot of SF web development lately, but I cannot recall using the listbox.  I generally use the listview.  So I will run a test to see if something has changed or if there is an issue.  Thanks.
By Andrew Harper - 1/12/2011

Thanks Trent.

Could you please post sample of what the builder generates for a list box so that I can try creating the control manually in the ASPX file?

Best regards,

Andy
By Andrew Harper - 1/16/2011

Hi Trent,

Back from a week off - I loaded VS2010 and latest version of strataframe into a Windows 7 VM. Still can't generate Listbox - suspect that this is a bug in Strataframe.

Best regards,

Andy
By Trent L. Taylor - 1/20/2011

Could be, I still haven't looked...sorry Blush

Listbox is not a very commonly used control as there are so many better controls that have taken its place.  So I will add this to my list and get on it.  Sorry for the delay.
By Michel Levy - 8/19/2012

Hi Trent,

not that I use this control, but I'm writing an article in french, presenting all SF lists and combos controls, both for winforms and webforms. And I confirm that this ListBox does not render in designer mode.

I may write the aspx code in source mode:

    
        <SFWeb:ListBox ID="ListBox1" runat="server" PopulationType="BusinessObject" 
            Width="189px" Height="131px">
            <PopulationDataSourceSettings BusinessObjectType="WebApplication13.BOcategories" 
                DisplayFieldNamesAlternate="categoryid|categoryname|"  
                FormatString="{1}" MethodToExecute="Data4List;" ValueMember="categoryid" />
        </SFWeb:ListBox>
  

  • I get that message (see listbox1.png attached)



  • If I launch the designer after having written the code, all seems OK (see listbox2.png attached):




  • And if I validate the designer by clicking OK, the result is... (see listbox3.png attached)


Hope it will help.
By Trent L. Taylor - 8/20/2012

Michel:

All if this looks great.  You are correct that the ASPX doesn't rendering in the designer. This is functioning as it is supposed to.  I did notice that the designer is not in French, was this one of your concerns? 
By Michel Levy - 8/20/2012

Trent,

my concern is not that the designer is not in french (hope it will be soon Cool ). No, my real concern is that it is impossible to design this control in the designer (and radiobuttonlist and checkboxlist and bulletedlist, too). The code generated by the designer is wrong.
By Trent L. Taylor - 8/20/2012

Hmmmm....I have a number of folks that use the designer on a regular basis.  In fact, a week or so ago I sent a sample to someone using the designer and it worked. I will have to see if I can reproduce your steps.  The ListView is the primary list control used on the web side, and so this is what is generally used.  So you may be right on some of the lesser used controls.  I will take a look at this.

In truth, some of the controls will be getting face-lifts soon anyway.  The entire designer environment will be getting a face-list as well.  In SF 2.0 we will localize all of the design-time dialogs as well.  So you will be getting some lists to translate when we get to that point. Smile
By Michel Levy - 8/20/2012

Trent,

Don't worry about this listview, I prefer you focus all your brain on 2.0 Rolleyes
you know that french SF user either develop winforms app, either use third party controls for their web development, so nothing is urgent here.
By Trent L. Taylor - 8/20/2012

Consider my brains dedicated to SF 2.0 Smile