Click on table records

Click on table records

  

Hi, 

How to capture an event when user click on a records on table records widgets?

I need to capture the selected records values and pass it to the another page.

Does anyone has idea how to do this?

hi Lim,

You can  put an icon in each row and do action on that icon, something like this:

regards,

IB

Could you use the Link To for a Cell, specifying the Destination for that Link?  You could add Input Parameters to the Destination Page and then set them in the Link.

Hi IBox,Davidk,

I have put a picture in the table records in row level and make it a link and it has a action named "Select".In the action select i try to retrieve the selected value.The code is as per below.But all the SelecedValue  is "".

SyntaxEditor Code Snippet

SelectedValue=ActionTable.List.Current.Action.ActionName

Can you guys help to advise in details?



I also have a new question here, after i get the value from the pop up page, i pass it to the local variable which is tie to a textbox.But the value does not appear in the textbox.But the value is able pass to the main page.Can you advise this as well?

I was thinking more along the lines of the OS Tutorial for the ToDo Web App.

The ToDos page has a Table Records Widget.  One of the Cells uses a Link To to the CategoryDetail Page.  The CategoryDetail Page has an Input Parameter - CategoryId.  This Input Parameter is set in the Link Destination property.





Hi Davidk,

Sorry,I think i does not state my question properly.

From a main page, i open a pop up.In the pop up, user can do search and click on the 1 record on the list such as Country.The Country is then pass to the textbox on main page.

My concern now is that i able to pass the variable to main page, but i am not able to 

1.To know which record has been selected.Because the ActionTable.List.Current.Action.ActionName is  always empty.How should i do on that?

2.The variable is now on the main page but the value is not shown on the main page.Even though i have tight the variable to the textbox.How should i do on that?

Can you advise?Help


Hi Johnson

To pass aything from the popup to the parent screen, you need to use the Popup_Editor_Message action.
And in the Screen, you attach a OnNotify screen action to the PopupEditor, and in this action, you use the NotifyGetMessage action to get the message (that will be received as text), and use it as you wish (like setting the value of the variable that is bound to the Text Input.

Cheers,
Eduardo Jauch

Solution

In this video (a little outdated but the notify part is ok), you see how to use the notify in a popup.

https://www.youtube.com/watch?v=tGD2UmwT52c

THis is a newer presentation where the notify in popups is discussed: 

https://www.youtube.com/watch?v=NWenSDO0ZmM

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

In this video (a little outdated but the notify part is ok), you see how to use the notify in a popup.

https://www.youtube.com/watch?v=tGD2UmwT52c

THis is a newer presentation where the notify in popups is discussed: 

https://www.youtube.com/watch?v=NWenSDO0ZmM

Cheers,
Eduardo Jauch

Beautifully Explained Eduardo.


Yes... with no original mention of a popup, any solution would not have applied.

Eduardo... I can almost see what needs to be done here, but I can't find the Popup_Editor_Message action.  Could I trouble you to detail the steps needed for this solution?  I'm really new to OS so phrases like "and in this action, you use the NotifyGetMessage action to get the message" have no context for me.  I've watched both videos a couple of times and I can't see it.

I've dragged the Popup_Editor Widget next to a Table_Records Cell and OS "magically" created the ToDo_PopupEdit screen for me.  Quite excellent stuff.

In the ToDo_PopupEditor screen, there is a Save action which contains a Feedback_Message, and Popup_Editor_Notify action.  What would I do now to get the Title field value from the ToDo_PopupEditor screen and set that Title Value in my Parent ToDo screen in a field I have named TitleTest?

Thanks,

David

Sorry

I typed PopUp_Editor_Message, but is in fact PopUp_Editor_Notify! lol

My bad! :)

EDIT:

Send the title through the PopUp_Editor_Notify and than on the OnNotify screen action (in the parent screen), use NotifyGetMessage to get the title and assign to your input.

Cheers,
Eduardo Jauch

Finally figured this out.  Thanks Eduardo for the hints.

Here's specifically what I needed to do.  I'm using the OS Web ToDo Sample Tutorial Application as my basis.  In my ToDos screen, I added a PopupEditor to a Table Records Cell.  OS set up the whole screen for me when I dragged the Popup Editor Widget next to the Cell... very cool.  So now I have a new screen named ToDo_PopupEditor.  

The whole point of this post was to update the value of an Input Widget... so I added an Input Widget to my ToDos Screen and tied it to a new Local Variable named varToDoTitle.

The ToDo_PopupEditor has a Save Button.  There's an Action on this button named Save.  This action was automatically created by OS (very nice) and contains a Popup_Editor_Close Action... which then connects directly to an End module.

I switched to the Logic tab and found Popup_Editor_Notify inside RichWidgets.  I dragged the Popup_Editor_Notify Action in between Popup_Editor_Close and End.  Popup_Editor_Notify has 1 argument which I set to ToDoForm.Record.ToDo.Title - which is from my ToDo_PopupEditor screen.

That's it for the ToDo_PopupEditor screen.

Back in the ToDos screen, I clicked on the RichWidgets\Popup_Editor I had added to that Table Cell.  The property for On Notify, Destination, had been automatically set to the Action RefreshToDoTable.  I opened this action and then switched to the Logic tab.  

In the System Objects section, I found the NotifyGetMessage action.  I dragged this Action right after the Start Module.  Then I dragged an Assign Widget right after the NotifyGetMessage action.

Being new to all this I had to make assumptions as to what was going on.  The Popup_Editor_Notify action in the Popup screen sets a global message in the server.  I can get this message anywhere else using NotifyGetMessage.  So NotifyGetMessage simply exposes the message... and in my Assign Widget I can set  my Local Variable varToDoTitle to NotifyGetMessage.Message.

So... I did all this and my Input Widget remained woefully empty.  Again... since I'm new to all this I'm still coming to an understand of how all this stuff works.  Web is server-side... period.  It seems to me that anything you want to do in Web will always come from the server. Mobile, on the other had, can be a balance of client-side and server-side.  For many years I've worked with a Mobile/Web environment where both Mobile and Web had both client and server tools... so my thinking in OS has to change a bit.

Anyway... I realized that what I needed to do. In order for Title to appear in my Input Widget I needed to perform an Ajax Refresh.  The Assign Widget was setting the value of the variable... on the server.  I added an Ajax Refresh Widget, assigned it to my Input field, and my Title value appeared when the Popup was automatically closed after a Save.

Now... there was already an Ajax Refresh in my RefreshToDoTable action.  When I checked network activity I found 2 calls being made to the server.  One each for the 2 Ajax Refresh Widgets.  Makes sense... and not good.

The original Ajax Refresh was set to the widget named ToDoTable_Wrapper.  Very interesting.  Anything inside this wrapper got refreshed.  Cool.  So I moved my Input Widget inside the Wrapper... and I removed the extra Ajax Refresh I'd just added.

Whew!