Problem: Getting a text field from a selected list-in-a-list row

Problem: Getting a text field from a selected list-in-a-list row

  
Hi,
 
I have the following situation: 
 
From an action I receive a data structure whereby the recordlist contains a text field and another recordlist that contains a text field. This structure is used to show a list of characteristics with the related content. 
 
As an example think of a characteristics field like 'Manufacturer' that contains names like; sony, samsung, lg, dell, etc.
 
To show the Characteristics a TableRecords widget is used. To show the content I used a webblock since it is not possible to add another TableRecords widget on the row of the parent TableRecords widget. This webblock contains the child TableRecords widget and is feed with the content recordlist from the current record.
 
This construction works just fine: I can click on a Characteristic (like Manufacturer) and then show the contents of it.
 
The problem that I have is that I can't get to the selected Characteristic content field (eg 'Sony'). The content is shown at the screen but if I add a link to the content TableRecords row that activates an action to get the text field it is always empty.
 
I have tried several ideas but the selected current record that I want to read is always empty (in the debugger) while still showing the content on the screen. 
 
So, is there a way to get the text from the selected list-in-a-list row?
 
 
PS In another situation I used a dropdown box for this (this works) but I can't use it here.
Hello Hans.

Do you have an example of that you can share with the Comunity?

Cheers,
Pedro
Hi Pedro,

The code itself is part of a big package which can't be shared. Not sure if I can create a seperated example because of the missing data. Maybe I can clear things up that aren't clear yet?

regards,
Hans

Myabe it's better... I see that you have some kind of webblock with a list inside another list.

The webblock has a dropdown and then?
No that's not the case. I must have done a very bad job explaining it!

An action delivers a recordlist which contains a text field (name) and another recordlist. This second recordlist contains only a text field (content). This is the ((content)record) list within a ((names)record) list.

To show these recordlists you need a table-records widget in a table-records widget. That is not possible in Servicestudio. However, if you wrap the the second table-records widget in a webblock and put this in the first tabel-records widget then this construction works.

There is no dropdown.

The problem is that althought the second list shows nicely I can't select any records of this list.

Hope this clears some things up,

Regards,
Hans
By lack of example code I have created a drawing to make things more clear.

Ah! The beauty of a picture :)

OK, so... what action are you trying to call, and what are the inputs of that action?
As can be seen in the picture the field value has a link that points to an action of the webblock.
On the moment all this action does is filling a local text value with the data from the current record:
selectedArtChar = TR_ArtChar.List.Current.Text.Value
Hi Hns.

I can't see where the problem is, but the example is quite simple to follow.

I'm assuming that the code you've pasted above is on an assignement that is inside the action that "HONEYWELL" link is boud to

Maybe you can set up an example to debug.


Hi Hans,

Your link is set to Ajax?

Regards,
Rafael Pereira
Hi, I have been a day off hence my lack of responce.

@Pedro Cardoso
"I'm assuming that the code you've pasted above is on an assignement that is inside the action that "HONEYWELL" link is boud to". Yes, that is correct. I don't know about another possibility to do this so I assumend that this didn't need explaining. I will look into an example if I have time to spare.

@Rafael Pereira
No: Webblock with RecordList input parameter fills -> TableRecords has -> Expression (field) has -> link -> calls screenaction -> assign.

Personally, I get the feeling that the problem lays in the fact that the second recordlist in part of the first and that therefore the second recordlist is always part of the current record of the first. 

I am starting to lean to the idea to rewrite the action that delivers the list-in-list structure. Not realy a solution but more of a workaround. I am also not sure this is a bug of a feature : )
Update: since I expected the current record of the first list to be the problem I created a copy of the second list before passing it through as an input parameter of the webblock. However this also did not work; i got the same result.

This has to work! :)

It seems a simple case. I'm just not sure I'm following your implementation, but an example would defnitly help on getting it
Hi,

I am now trying another new idea and if that also has no results then I will start creating an example :)
Instead of showing the second list on the same page, I created a new one where a passed the list to. In this second page the content is shown. A link is added to the field where a variable is set (same as above). And also in this scenario the variable is not filled. I will start creating an example oml now...
Cool Hans, just send it through!
I have created a example oml which uses the same action to get his data from. Still the same problem. Good to know that there wasn't something in the previous context that caused the problem. However, the data providing action can't be used externally so I need to create dummy data. I will try to implement it between other assignments :)
Here is the promissed example OML.
- It creates its own test data in the preparation
- Instead of a link an onclick on the container is used (second block/list)
Besides filling the variable no other code is added: via debugger it can be seen that it is not filled.

The goal is to get the variable value, close the second list and add the retreived value to the first list so that it is clear which value is selected.


Hi Hans,

Rule of thumb: If a variable or attribute is never used it will be optimized by the platform. You cannot see optimized fields in debugger.

If the value is actually used it will be filled correctly.

I only added this method to your action:


And here you can see a video of it working:
http://screencast.com/t/rTboMk5rU

Regards,
João Rosado
Hi Joãso,

Thanks for the reaction. The setting was a kind of test setting: the first setup had more code that I stripped to get to the bare metal problem but as you pointed out maybe it was to much. 

In previous code I used a Notify action to get the variable to the first list: here the getNotifyMess was always empty and in debug I saw that it never was filled. For the test setup I omitted the Notify construction (also because it didn't seem to work).
So in that case the next question is how to get the variable to the first list?

Ok, i recreated my code with the notify and it seems to work now.. this is very odd. Quit sure the variable was empty before.
:)
Good that you got it working
I am quite flabbergasted; my original code works now while it didn't in the past. 
(you can see it when adding the notify, in the screenaction OnClick_FilterContent_SHOW there is some original code left.)

No idea why it works now but I am happy this hurdle is taken..
Thanks everyone for their input!