Alpha DevCon 2018
Results 1 to 6 of 6

Thread: List control custom control

  1. #1
    Member
    Real Name
    Phil Major
    Join Date
    Jul 2012
    Location
    Republic of Ireland
    Posts
    61

    Default List control custom control

    Hi All,

    I wish to display a custom control within a list control, but I can't seem to get my head round how to do it.

    Essentially the list control will have a list of say topics ... these are linked to a user using a many to many linking field

    For example ...



    Topic name
    Topic description
    ....

    Topic Link User
    TopicID_PK LinkIDPK UserIDPK
    TopicID_PK TopicIDFK UserID
    Topic text UserIDFK User password
    Topic description UserID email

    I then want users to be able to subscribe to the topics they are interested in and have their subscription status shown in the list category.

    So, we have a list control of topics with a little check mark or heart sign or something in the list of topics which reflects whether someone is subscribed to the category. I have no problem working with the SQL to determine if a topic is subscribed to ... I just need help with how to construct the list control custom control to display the item.

    I have watched http://www.youtube.com/watch?v=B1605a9mhp4 which is just a little too simplistic (or I am ). Can I run an xbasic function from the xbasic I insert into the custom control? How would I then display an image based on the result of the function?

    Any ideas gratefully accepted?

    Kind regards,

    Phil

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,737

    Default Re: List control custom control

    Phil,

    I almost see what you want to do... but I'm not quite sure. Could you type in a simple sample of data... how it would be displayed... how you want it to look. You'd have column(s) of data coming from a SQL source, plus a custom control will provide an additional column of data... again coming from a sql source... is that right? The custom control will use existing row data to get what it needs.

  3. #3
    Member
    Real Name
    Phil Major
    Join Date
    Jul 2012
    Location
    Republic of Ireland
    Posts
    61

    Default Re: List control custom control

    Hi David ...

    You have seen my app (a while back to be sure). There is a list of either categories or companies to which users can subscribe. I would like to be able to display a list of say all companies or all companies in a certain category or all categories and show that the user has either subscribed or not to said item.

    So ... we have a category database with just a category field and a primary autonumbered unique int field.
    We have a user database with a username field.
    We have a linking database with a primary autonumbered unique int field, and then the two linking fields as foreign keys ... CategoryIDFK int and UsernameFK int.

    If you remember the promotion page that you kindly helped with previously, I have buttons on it to save the promotion to a saved list and to (un)subscribe to company and category (which all works fine now).

    The user is logged in as Username. I would like them to see in the list of categories to which category they are subscribed.

    Attached is an image of what I would like to achieve. In the bottom right of each promotion, I have added a little heart symbol to some to simulate them being subscribed to.

    Thanks for looking at this for me David.

    Regards,

    Phil


    promotionslist.jpg

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,737

    Default Re: List control custom control

    Hey Phil,

    Have a look at this video... I think it's what you're after.

    I think what isn't realized about the Custom Control is that it is an XBasic function that you can do anything with. As an end result... what you're returning per row... is HTML. But, before you return that HTML, you can write any XBasic to help you get the data to build that HTML.

    Hope this helps.

    http://youtu.be/Yu7KA-oAnR8

  5. #5
    Member
    Real Name
    Phil Major
    Join Date
    Jul 2012
    Location
    Republic of Ireland
    Posts
    61

    Default Re: List control custom control

    David,

    That is exactly what I am looking for. Thank you so much. I am amazed at the efforts you go to to help people here, people from far off countries that you have never met. I try to help out where I can, but I am still learning Alpha and its ways of doing things, coming from over 20 years of Clarion, so the assistance I can give is limited.

    I had watched Selwyn's video, but was having difficulties going from the rendering of a bit of text taken from the data already within the control to the concept you have shown so succinctly. I think this could also be done using the custom data source as well, which seems to be able to drag in data from wherever you want, but because I had already got all the rest of the lists done and working, I felt the custom control option was a better one.

    It is certainly a testament to the power of Alpha that things can be done so easily ... when you know how!

    Once again, thank you so much David. Should we ever meet, I owe you many beers!

    Regards,

    Phil

  6. #6
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,737

    Default Re: List control custom control

    My pleasure. I was in Access/SQL since Access first appeared but with no Web/Mobile presence and the Access runtime messing with other Access installs I'd had enough.

    With Alpha you have, many times, a choice of getting to where you need to go. Sometimes the decision is just how much more fun one way is over another. The Custom Data option is really excellent but I think the Javascript option outshines it. Imagine... with so many web services supporting JSON you can make calls to those services and populate your list. Actually you can do exactly the same in XBasic and use the functions there to convert JSON to CR-LF to feed the list. Again... multiple options.

Similar Threads

  1. Can you include a custom text box in a list control row?
    By richardurban in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 07-30-2013, 10:58 PM
  2. Custom Control - META Tag managed as part of the custom control?
    By CarlMPearson in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 10-15-2011, 07:24 PM
  3. How to control line height within a xdialog record list list box
    By Fator in forum Alpha Five Version 10 - Desktop Applications
    Replies: 12
    Last Post: 05-13-2010, 01:25 AM
  4. Custom control
    By Sanjay Bangalore in forum Application Server Version 8
    Replies: 2
    Last Post: 03-05-2008, 07:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •