Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Thursday, November 20, 2008 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
Samples and other shared info.

Subject: My First ListX - A Beginner How To

You are not authorized to post a reply.   
Author Messages
pauldes
Immortal
Posts:1392

08/24/2006 6:33 PM Alert 
This sample ListX application will show you the beginning basics to set up a master and detail page with capabilities to insert and update records. Use at your own risk.

To install the application do the following with the files in the attached ZIP:
CreateCarTable.sql - run this script with a query tool or from HOST>SQL, to install the application table to your DNN database.

PopulateCars.sql - follow the same procedure to enter some sample data

Toolbar.css - copy the contents of this file to the bottom of your portal.css file(ie. localhost/portals/0/portal.css)

CarsListListX.XML - Create a page called Cars List. Add a ListX module. From the module menu choose View Options. Click the XML icon. Replace ALL text in the XML text field with the contents of this file. Click the LOAD link. Click the SAVE CONFIGURATION link.

CarsEditListX.XML - Create a page called Cars Edit. Add a ListX module. From the module menu choose View Options. Click the XML icon. Replace ALL text in the XML text field with the contents of this file. Click the LOAD link. Click the SAVE CONFIGURATION link.

CarsEditToolbar.XML - Add a Toolbar module to Cars Edit. From the module menu choose View Options. Click the XML icon. Replace ALL text in the XML text field with the contents of this file. Click the LOAD link. Click the SAVE CONFIGURATION link.

Play with the functionality, check out how the configuration works. Use the export/import functionality in the module menu to use this as a template for your new listX modules.

Lessons To Be Learned:
Cars List ListX
-how to return data to a grid list
-how to utilize the {ACTION} tag to redirect and set session variables
-how to utilize [SORTTAG] in queries and [SORT] in the results to allow column header sorting
-how to utilize a header/footer in your list results

Cars Edit ListX
-How to consume session variables for secure use within your ListX module
-How to use a single ListX for both an Update and Insert form
-How to convert form fields to secure variables against sql injection before interacting with the database
-How to implement a data drive drop down box in your form
-How to ACTIONS to perform conditional inserts/updates, variable assignment and redirection
-How to implement BI4CE Toolbar like functionality in your ListX form.

Cars Toolbar
-How to utilize javascript dialogue boxes in your buttons
-How to implement CSS for mouse over actions
-How to implement Toolbar messages for initiating Actions in your ListX

Enjoy......Kevin and Chris, you each owe me a beer. Pin this at the top of the board if you think it's valuable.

Paul.

Attachment: MyFirstListx.zip


ListX....makes you look brilliant, even though you're not.
gigipayne
Featherweight
Posts:12

09/25/2006 7:33 PM Alert 
This is great! I have one questions, how do you get the toolbar module to look like it's part of the ListX form module? On my page they just look like 2 differernt modules and nothing like they belong together.
Thanks for the help.
pauldes
Immortal
Posts:1392

09/25/2006 7:49 PM Alert 
Two ways. You either have to get into editing your container ASCX files and edit their HTML tables to get them to lay on top of each other, or you can go with the example in the Car List where most of the functionality is embedded in the ListX module

ListX....makes you look brilliant, even though you're not.
Michelle
Welterweight
Posts:43

10/26/2006 4:07 AM Alert 
This is really great! I have one problem: I changed my database from MS SQL Express edition to MS SQL 2005. Then I got a error in CarsEdit: System.Data.SqlClient.SqlException: Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at... It's a very long Errormessage.

Can someone help, please?
Thank you
Michelle

Michelle Chan
ssatish
Lightweight
Posts:21

10/26/2006 8:30 AM Alert 
Can you go ahead and provide the full SQL exception error message - it should include the syntax provided directly for the query. We are running SQL 2005 and Express here but haven't seen this error. Its peculiar that the error occurs in SQL 2005 and not in Express, when they are the same basic SQL engine. Post the info and we will be glad to help.

Sowmya Satish
Software Engineer
Business Intelligence Force, INC.
Michelle
Welterweight
Posts:43

10/26/2006 8:41 AM Alert 
Here is the full Error:

System.Data.SqlClient.SqlException: Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText) at Bi4ce.Modules.xList.SqlDataProvider.GetDataset(String Connection, String Query, Int32 ConnectionTimeout) at Bi4ce.Modules.xList.Engine.GetData(String Query, String FilterField, String FilterText, Debugger& DebugWriter, Int32 timeout)


Thanks for the help.
Michelle

Michelle Chan
bgates
Heavyweight
Posts:197

10/26/2006 1:08 PM Alert 
Don't use TabIDs. They differ from one installation to another. Better is the [FORMAT,"TAB NAME", {TABID}] tag, where TAB NAME is the name of the tab you want to go to. So in the List example, change the action in the link column (first column in List format) to
{ACTION,[carid],vRecordId,[FORMAT,"Cars Edit",{TABID}]}

Also, the 'goback' Action in the Cars Edit should be a Link with a value of [FORMAT,"Cars List",{TABID}].

Unfortunately, the Toolbar does not have the same rendering options that ListX does. So, you'll either have to verify the Tab value for the Cancel button, or change it to a Message and add that message handler to the ListX.

Michelle, your issue seems to be that message comes up when you just navigate straight to the Cars Edit page. You won't get that error if you start with the Cars List page and click the Link to move you to the Cars Edit page. That also sets the value for the CarID and passes that into the Cars Edit page. The problem you're experiencing is that there is no current CarID.

Bob Gates
Business Intelligence Force, Inc. (bi4ce)
Michelle
Welterweight
Posts:43

10/27/2006 7:37 AM Alert 
Thank a lot!

It works with [FORMAT,"TAB NAME",{TABID}] now.

Thank you
Michelle

Michelle Chan
myearwood
Middleweight
Posts:60

01/30/2007 10:05 PM Alert 
I got this example working with the extra information Bob Gates provided. I have a cars edit page with the cars edit ListX - I believe that's according to the example. How do I hide the cars edit page from the users / the DNN menu, but still have it appear when the user clicks Link on the list page?
pauldes
Immortal
Posts:1392

01/30/2007 11:17 PM Alert 
just mark it hidden in the settings of the page.

ListX....makes you look brilliant, even though you're not.
myearwood
Middleweight
Posts:60

01/31/2007 9:07 AM Alert 
Hi Paul

OK. Great!

I didn't realize it was that easy. I expected security settings were involved.

Thanks
tknman0700
Welterweight
Posts:49

07/24/2007 11:48 AM Alert 
I dont see anything when I add the toolbar? Is something supposed to be there?
pauldes
Immortal
Posts:1392

07/24/2007 12:08 PM Alert 
If you don't have the BI4CE toolbar module, that is fine. It should work as is.... with just the ListX modules

ListX....makes you look brilliant, even though you're not.
andresvv75
Featherweight
Posts:9

08/09/2007 11:42 PM Alert 
Hello paul I need your help. I installed Listx 1.9.8 on DNN 4.5.1 using SQL Express 2005. I did all the steps to install My Fist Listx sample. I am getting an error and I dont have an idea of how to solve that. I belive there is a connection error whit the database but I did not change anythig in the conection string I juste leave as default.
Also when I use the Quick Builder for any table I get Connection errors: Take a look:


Actual:Expand/Collapse
select cars.carid, cars.make, cars.model, cars.caryear, cars.dnnownerid, users.username from cars join users on cars.dnnownerid = users.userid order by carid ASC, make ASC, model ASC, caryear ASC, username ASC

Error:Expand/Collapse

System.Data.SqlClient.SqlException: Invalid object name 'cars'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText) at Bi4ce.Modules.xList.SqlDataProvider.GetDataset(String Connection, String Query, Int32 ConnectionTimeout) at Bi4ce.Modules.xList.Engine.GetData(Boolean isSubQuery, String Query, String FilterField, String FilterText, Debugger& DebugWriter, Boolean isRendered, Int32 timeout, String CustomConnection, Boolean& IsSuccessful, String& FailureMessage)
Statistics:Expand/Collapse
ModuleId 373
TabId 55
TabModuleId 62
Filter
Filter Field
Filter Text
Current Page 1
Page Size 3
Total Records 0
Form

Session

sortActionList371-1: ArrayListΎ]

RPPm371t37: 0
sortActionList3711: ArrayListΎ]

sortActionList3731:
RPPm373t55: 3
Cookies

.ASPXANONYMOUS: 0OIUaG0OyAEkAAAAN2U0NThiNTgtODJmOC00MDY1LTk0N2UtM2NkMzJkYmEyZjNh0
ASP.NET_SessionId: fxipzx45wlkpgnv5lkhu3d45
language: en-US
.DOTNETNUKE: 559995A1528F08F62593941C07C83C0AE8C00F64EE6F04AC126B60A966BA76411F2B405BB686E29A5883A46B31F89936D7B154DA0787CE17BD7324D24D423490
portalaliasid: BBBED931C54A33B5297503289930CD72845AA0E1B6EE83A6CBCF00D851B1BE99A5B9D969D175E88D41B7480A6B6A967D6935828889156852546B9D3C61326B9F38AA439112F14CB0
portalroles:
language: en-US
ViewState

TotalPages62: 0

No Data Returned

Any idea?
Thanks
Andres
rgallais
Cruiserweight
Posts:147

08/10/2007 10:01 AM Alert 
Hi Andres,

Did you run correctly the sql scripts to create the different tables?
The error message just says the cars table does not exist.

Let us know.

Romain Gallais
Business Intelligence Force, Inc. (bi4ce)
andresvv75
Featherweight
Posts:9

08/10/2007 3:59 PM Alert 
Hello Romain, of course I run the database scripts, the script that create the table and the scrip that populate the table. I am having this problem whit all the tables. None of the tables of the DDN or different tables run. The webconfig is the default and I did´t change it.
pauldes
Immortal
Posts:1392

08/10/2007 4:17 PM Alert 
Do you have access to query the database with microsoft query analyzer or management studio? Are the tables there and do they have data? Have you set the sql connection in the web.config for BOTH the default installation and the connection string for module backward compatibility(a few lines below the initial connection string)....just some ideas.

ListX....makes you look brilliant, even though you're not.
rgallais
Cruiserweight
Posts:147

08/10/2007 5:51 PM Alert 
Hi Andres,

I am not sure to understand what you mean by "I am having this problem whit all the tables".
Could you check if you have any specific database owner or object qualifier?
You can do this also in listX using [databaseOwner,System][objectQualifier,System] Tags ( [databaseOwner,System][objectQualifier,System]Cars)

Let me know

Romain Gallais
Business Intelligence Force, Inc. (bi4ce)
sigmadx
Lightweight
Posts:24

02/15/2008 4:29 AM Alert 
Ok this may sound a stupid question, but I'm a beginner(!), how does one output a column of data from a table into a javascript array?

My ultimate goal is use the Yahoo autocomplete input from their UI library.

http://developer.yahoo.com/yui/autocomplete/



<img src='http://dnn.bi4ce.com/desktopmodules/ntforums/images/emoticons/w00t.gif' height='20' width='20' border='0' title='w00t' align='absmiddle'>
dcampbell
Heavyweight
Posts:197

02/15/2008 9:28 AM Alert 
In the header format you are going to start the array. In the list item of listX you are going to output each element into the array and in the footer you are going to close the array.

Hope this helps
Dave

Dave Campbell
Software Engineer
Business Intelligence Force, Inc. (bi4ce)
You are not authorized to post a reply.
Forums > Bi4ce.Modules.ListX > Samples and other shared info. > My First ListX - A Beginner How To



ActiveForums 3.6
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation