I have studied the code in the Buttons (28) example, but I'm still having problems.
Please take a look at the form I want to create (attached image)
1. Mark/unMark button
I want to be able to allow users to "mark" rows. The name of the person who mars the row is stored in the "selected_session" field. The heading is just "Selected" and instead of showing the name of the user, I show "Yes" if
AL1:selected_session = p_web.GSV('UserName')
If there is a different user name then I display "No".
If there is no user name I display "-"
If the column displays "Yes" then I want the text of the adjacent button to be "unMark", and if it is "-" then the text should be "Mark". At the moment I can't get this to work. Is there an equivalent of the Visual Basic IIF function in Clarion? I can't seem to find one.
Any suggestions would be most welcome.
2. Filter Display
I can't figure out how to display the value of a filter that is applied to the browse. An example would be "Category = 'Sales'" that I have drawn in to the image, but I have no idea how to put it there. Again, any suggestions would be most welcome.
3. Filter Button
Along with the filter display I would like a "Filter" button. in this case I want the user to be able to click it to show only the "marked" records I have in item 1.
AL1:selected_session = p_web.GSV('UserName')
I would like to be able to toggle the filter off again, so that all records can be displayed.
4. Mark Button operation
The Server Code for the Mark button is as follows:
UD.Debug('This is the value of AL1:selected_session ' & AL1:selected_session)
IF len(clip(AL1:selected_session)) <= 1
AL1:selected_session = p_web.GSV('UserName')
ELSIF CLIP(AL1:selected_session) = p_web.GSV('UserName')
AL1:selected_session = ''
END
UD.Debug('This is the value of AL1:selected_session ' & AL1:selected_session)
I also have enabled the option to "Refresh browse row DATA after server code runs".
Each time the code runs, it gets the value of AL1:selected_session from the actual record, but after changing it, the record itself doesn't change, only the browse display. How do I update the record as well as the browse display?
Any suggestions, RTFM topics, etc will be greatly appreciated.