You are here:   Blog
Register   |  Login

 

Apr 12

Written by: Michael Washington
4/12/2013 6:31 AM  RssIcon

The LightSwitch HTML Client allows you to easily create a server side search.

image

We start with a simple Browse screen.

 

image

First, we add a property.

 

image

We create a Search property.

 

image

The property will be added to the View Model on the Screen.

We now select Edit Query.

 

image

We create a query that takes a parameter.

 

image

We click on the parameter and in its Properties we make it Optional.

 

image

We bind the Search property to the SearchParameter.

 

image

The line shows that the Search property is bound to the SearchParameter.

 

image

We drag and drop the Search property to the Screen layout.

 

image

We switch the Search element to a Text Box.

 

image

When we run the application and enter a search term and hit the Enter key (or Tab or click away) a server side paged search is executed.

7 comment(s) so far...


Gravatar

Re: Server Side Search using the LightSwitch HTML Client

is an option to use a grid in html client like we do in silverlight ?
any third party can html5 grid ?
the most important control is missinig...

By alon on   4/15/2013 8:25 AM
Gravatar

Re: Server Side Search using the LightSwitch HTML Client

@alon - You would have to use a 3rd party control.

By Michael Washington on   4/15/2013 8:27 AM
Gravatar

Re: Server Side Search using the LightSwitch HTML Client

I think that becuase grid control is the most missing for all lightswitch developers,
sample of third party grid (like wijmo, telerik, devexpress) with dynamic tabs. (like we do in silverlight) is all wish

when we can combine controls from Third party, we can Eventually say Goodbye to silverlight....
with great hope that microsoft will deliver more and more JS controls to lightswitch.

before 3 or 4 years, silverlight was the best - but now - all developers want html5 + JS.

Thanks for all !!!

By alon on   4/19/2013 6:45 AM
Gravatar

Case sensitivity question.

I encountered a small issue when adding a search to my app, and am hoping there's an answer. My data resides on an Oracle 10 db, so all of the queries are case sensitive. Is there any way to tell Lightswitch to add a lower() or upper() to the generated query as well as to convert the input text the same way?

Thanks,

Mike

By Michael Whitis on   8/1/2013 5:25 AM
Gravatar

Re: Server Side Search using the LightSwitch HTML Client

@Michael Whitis - Sorry I have no code samples. You will want to post to the official LightSwitch Forums at: http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=lightswitch

By Michael Washington on   8/1/2013 5:37 AM
Gravatar

Re: Server Side Search using the LightSwitch HTML Client

Good post, the only thing is, after searching you delete all characters from the Search textbox and press Enter, no records are displayed (opposite of what's expected). I'm sure you fixed it already. (I'm using VS2013 HTML Client)

By Nicolas Lope de Barrios on   3/5/2014 10:14 AM
Gravatar

Re: Server Side Search using the LightSwitch HTML Client

I forgot to mark the parameter as Optional in the query. My bad! sorry about that.

By Nicolas Lope de Barrios on   3/5/2014 10:19 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation