Page 1 of 1

Extra relationship information [SOLVED]

PostPosted: Mon May 17, 2010 2:39 am
by cantlep
Hi All,

I have a few questions I'm hoping people can help me out with..here's the first.

I currently have a relationship between two tables. Everything works fine. When I add a new entry for one table, I have the option of selecting objects from a second table (shown with multiple check boxes). What I'd like to be able to do though is have the objects with checkboxes and then in brackets next to them something else that's also pulled from that same table. I'm not sure if this is possible?

e.g. Column 1 from table 1 is currently pulled into the "new entry" page for table 2 and is shown with a checkbox for each row. What I'd like to be able to is have the same but also pull Column 2 from table 1 and have that shown in brackets next to the checkboxes.

Or even better might be to have (in the "New Entry" view) the actual rows and columns from table 1 showing up in their original format (i.e like the normal page view). Is this possible? Then, I could choose to show colum 1 and 2 with all rows and I could use the checkboxes that are there by default (in the normal page views).

Does that make sense?

Cheers

Paul

Re: Extra relationship information

PostPosted: Mon May 17, 2010 8:20 am
by shannah
You should be able to accomplish this by simply defining the titleColumn() method for table 1 to include the fields that you want to include in the title. e.g.:
Code: Select all
function titleColumn(){
    return "concat(col1,' [',col2,']')";
}


-Steve

Re: Extra relationship information

PostPosted: Mon May 17, 2010 3:40 pm
by cantlep
Hi Steve,

Thanks for the reply. That's not really done anything and I'm not sure I explained myself properly. I'll give it another go.

I have a table called "SiteData" - This table contains a list of site name, addresses, etc, etc
I have another table called "ContractData" - This table holds contracts.

There is a relationship set up so that when I create a new contract, I can add sitenames to that contract that are pulled from the "SiteData" table. Currently, I have them shown up as tickboxes. Now, as well as displaying the sitenames from SiteData, I'd also like to display some other info from SiteData. (i.e. Sitename and Address)

To have both these bits of info displayed with a tickbox would be fine....If there's a way to get them to display by making it look like "List view" then that would be better...but Either way, I don't just want the Sitenames showing without any other info.

Does that make sense?

Thanks for your help.

Paul

Re: Extra relationship information

PostPosted: Mon May 17, 2010 4:17 pm
by shannah
The solution that I suggested will not show a list view, but it will allow you to customize what shows up next to the tick box. Xataface will show the record title for the SiteData record in question next to the associated text box. By defining the titleColumn() method on the SiteData table delegate class you are overriding which columns are treated as the title column.

-Steve

Re: Extra relationship information

PostPosted: Mon May 17, 2010 4:39 pm
by cantlep
Thanks Steve,

I now have this in SiteData's delegate class. It's not erroring so I know the column names are correct but all I get now is the actual tickboxes with no text.

function titleColumn(){
return "concat(SiteName,'[',MPAN1,']')";
}


What have I missed?

Cheers

Paul

Re: Extra relationship information [SOLVED]

PostPosted: Mon May 17, 2010 5:09 pm
by cantlep
Hi Steve,

Apologies, scrap that last post. That worked fine. I must remember to delete old stuff and recreate when I change something like this!

Thanks very much as always.

Paul