how get data in a column template option button

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ueliweb
Posts: 118
Joined: Wed May 11, 2011 9:47 am

how get data in a column template option button

Post by ueliweb » Sat Dec 17, 2011 9:53 am

Hei

I am trying to set the label and content of an option Button placed in a column template of a datagrid table.
Reading the manual confused me more then helps me and all sample found yet fits to row template (that I can manage) or they just has some text or picture doings.


As I put data to the DG I would like set dynamical the list to choose because there are changing many times (manually there are stored yet)
and set the label to the actual status of the data (here for the manual sample numbers between 0-6)

but the Column behavior is named like "button "StudentsCourseCredits Behavior" of stack "Data Grid Templates 1234567"

to see about data arrived I made a "answer pData" in the "on FillInData pData" there just always empty. Also looking to the Variable does show it as empty.


set the table data I use:

Code: Select all

   set the dgText[false] of DataGridName to MyArray
data displayed as expected ... but bot the option button.


I tied to send data needed as follow:

Code: Select all

 
 set the button "StudentsCourseCredits Behavior" of DataGridName to MyButtonArray 
 -- OR
   set the label of the button "StudentsCourseCredits Behavior" of DataGridName to
--OR
   --   put MyButtonArray into FillInData of the button "StudentsCourseCredits Behavior" of DataGridName
 
What I am doing false?
Where is the knob?

Thanks
ueliweb

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: how get data in a column template option button

Post by Klaus » Sat Dec 17, 2011 2:01 pm

Grüezi Ueli,

where are the data that you would like to put in there? In "myArray"?
You need to script the "fillInData" handler in the Behaviour script accordingly
to fill and set the optionbutton and its label!

What do you have so far? Can you post some scripts, please?


Best

Klaus

ueliweb
Posts: 118
Joined: Wed May 11, 2011 9:47 am

Re: how get data in a column template option button

Post by ueliweb » Sat Dec 17, 2011 10:20 pm

Grüezi gliichfalls Chlaus.
uus äm hööche Norde fascht so hööch obe wo dä Samichlaus här chunt.


Hm I am not sure to post more than code snippet. But I f you feel need look to the project as hole I can send you the stack with all data needed by mail. Just send me your email by PN or post it here.

But some more infos here: data to populate are singel line data from a big datagrid shown as a detail view. Saved in array. one element contains an other array that contains a list of data.

cleartext: Big data table shows many courses, one part of the detail view shows course information the other one a list with course members and some data of them.

Now I put the row corresponding data chosen to the detail views. the course infos in a data grid form works well all data are shown well. Also to the data grid list with member information works well and shows all data I send to. Now I want integrate a option button to one column to choose/enter course credits. And just this data never arrives the option buttons Column behavior:

Code: Select all

on FillInData pData
   answer pData 
   put pData
   set the label of button  "CourseCredits" of me to pData
end FillInData

Code: Select all

on selectionChanged pHilitedIndex, pPrevHilitedIndex
   put the long name of me into theLongNameOfMe
   
   ## save changed data fom previous row back to the main table and save it too to file
   ##      from Details  (yet no changes elaowd
   ##      from Credits only the credits can been changed
   ##############################################
 
  
   ## get the data of new selected row by index and add the Index 
   put GetDataOfIndex (pHilitedIndex) into theDataOfIndex[1]
   put pHilitedIndex into theDataOfIndex[1][MainDG_Index]
   
    
   ##  prepare the Table for enter the Students course credits 
   ##    for easy I convert to a tab text  to populate by dgText[] statement
   put theDataOfIndex[1]["StudentsCourseCredits"] into theCreditsDGpreparation
   put theCreditsDGpreparation
   replace comma with return in theCreditsDGpreparation
   replace slash with tab in theCreditsDGpreparation
   
   ## to look variable content I set a breackepoint here
   -- put theCreditsDGpreparation
   
   
   ##  create the names for the Credits and Details DataGrids   
   set the ItemDelimiter to quote
   put pLongNameOfDataGrid into theLongNameOfDataGridCredits
   put item 2 of pLongNameOfDataGrid & "_Credits" into item 2 of theLongNameOfDataGridCredits
   
   ##  populate data to the member list
   ##    this shows all data in the list as expected
   ##    also the credits are shown as long I do not use column template ...
   set the dgText[false] of theLongNameOfDataGridCredits to theCreditsDGpreparation 
   
   ##  and now where and how I get the data to the option button in the column template of 
   ##    "theLongNameOfDataGridCredits"?  to the "FillInData  pData" of the
   ##     Column behavior "button "StudentsCourseCredits Behavior" of 
   ##     stack "Data Grid Templates 1234567"
   end selectionChanged 
I hope this helps to understand what I mean.
thanks for all advise and help
ueliweb

ueliweb
Posts: 118
Joined: Wed May 11, 2011 9:47 am

Problem looks been solverd "itself" ! ?

Post by ueliweb » Sun Dec 18, 2011 6:58 am

Hei Klaus
and all Volks

I do not know whats happen, doesn't change anything - but starting Mac today ...
Its now runing ... :D :oops:

Does just restarting solve the problem ???

any way thanks all for reading, thinking and
thanks Klaus for your help
ueliweb

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem looks been solverd "itself" ! ?

Post by Klaus » Sun Dec 18, 2011 11:47 am

Hi Ueli,
ueliweb wrote:...Does just restarting solve the problem ???
Yes, it does, sometimes :D

Glad you got it working!


Best

Klaus

Post Reply