R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
My First ListX - A Beginner How To
Last Post 01 Jan 1900 05:00 AM by . 19 Replies.
Printer Friendly
Sort:
PrevPrev
You are not authorized to post a reply.
Author Messages Informative
pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
24 Aug 2006 11:33 PM  
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.
gigipayneUser is Offline
New Member
New Member
Posts:16

--
26 Sep 2006 12:33 AM  
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.


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
26 Sep 2006 12:49 AM  
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.
MichelleUser is Offline
New Member
New Member
Posts:43

--
26 Oct 2006 09:07 AM  
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
ssatishUser is Offline
New Member
New Member
Posts:21

--
26 Oct 2006 01:30 PM  
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<br>Software Engineer<br>Business Intelligence Force, INC.
MichelleUser is Offline
New Member
New Member
Posts:43

--
26 Oct 2006 01:41 PM  
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
bgatesUser is Offline
Basic Member
Basic Member
Posts:196

--
26 Oct 2006 06:08 PM  
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<br>Business Intelligence Force, Inc. (<a href="http://dnn.bi4ce.com"><b>bi4ce</b></a>)
MichelleUser is Offline
New Member
New Member
Posts:43

--
27 Oct 2006 12:37 PM  
Thank a lot!

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

Thank you
Michelle


Michelle Chan
myearwoodUser is Offline
New Member
New Member
Posts:60

--
31 Jan 2007 03:05 AM  
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?


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
31 Jan 2007 04:17 AM  
just mark it hidden in the settings of the page.


ListX....makes you look brilliant, even though you're not.
myearwoodUser is Offline
New Member
New Member
Posts:60

--
31 Jan 2007 02:07 PM  
Hi Paul

OK. Great!

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

Thanks


tknman0700User is Offline
New Member
New Member
Posts:49

--
24 Jul 2007 04:48 PM  
I dont see anything when I add the toolbar? Is something supposed to be there?


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
24 Jul 2007 05:08 PM  
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.
andresvv75User is Offline
New Member
New Member
Posts:9

--
10 Aug 2007 04:42 AM  
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[0]

RPPm371t37: 0
sortActionList3711: ArrayList[0]

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


rgallaisUser is Offline
Basic Member
Basic Member
Posts:146

--
10 Aug 2007 03:01 PM  
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<br>Business Intelligence Force, Inc. (bi4ce)
andresvv75User is Offline
New Member
New Member
Posts:9

--
10 Aug 2007 08:59 PM  
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.


pauldesUser is Offline
Veteran Member
Veteran Member
Posts:1392

--
10 Aug 2007 09:17 PM  
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.
rgallaisUser is Offline
Basic Member
Basic Member
Posts:146

--
10 Aug 2007 10:51 PM  
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<br>Business Intelligence Force, Inc. (bi4ce)
sigmadxUser is Offline
New Member
New Member
Posts:24

--
15 Feb 2008 09:29 AM  
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='desktopmodules/ntforums/images/emoticons/w00t.gif' height='20' width='20' border='0' title='w00t' align='absmiddle'>


dcampbellUser is Offline
Basic Member
Basic Member
Posts:197

--
15 Feb 2008 02:28 PM  
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<br>Software Engineer<br>Business Intelligence Force, Inc. (bi4ce)
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share