B4J Question [ABMaterial] dynamic height in ABMList items

rbirago

Active Member
Licensed User
Longtime User
In ABMList I can add any type of ABM component, but if I add different height items they are compressed at the same standard height. I tried the InitializeWithMaxHeight hoping could be the solution, but it seems to work in the same way as the standard Initialize.
any suggestions?
thanks
Roberto
 

rbirago

Active Member
Licensed User
Longtime User
The items are just embedded in a container, more or less like this forum messages. Anyway using Initialize or InitializeWithMaxHeight the heights of the items are the same.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
The items are just embedded
I don't know if I understand your response, but:
@alwaysbusy meant -put a single item into a new container - then add this new container to the ABMList.... and repeat for each item...

using Initialize or InitializeWithMaxHeight the heights of the items

I don't know about ABMLists (I don't use) - but when using ABMCombo, this restricts the height of the dropdown to show only 4 items (for example) with a scrollbar to access other items...

Sometimes, when all else fails, I resort to the ABMTable which may adjust the row size (height) depending on the content - such as an image (bitmap not resized) in a cell...

Good luck with this. I am sure you will work it out...

Thx
 
Last edited:
Upvote 0

rbirago

Active Member
Licensed User
Longtime User
I confirm: first I put my item in a new container and then I add each container in the ABMList.
Originally I used a direct load of the container's items in the page:
B4X:
    For i = 0 To mySe.myTh.lstClassThreadEl.Size - 1
        Dim thEl As ThreadEl = mySe.myTh.lstClassThreadEl.Get(i)
        Dim singleMessage As ABMContainer = ABMShared.BuildSingleMessage(page,mySe,i,thEl)
        page.Cell(2,1).AddComponent(singleMessage)
'        liMsgs.AddItem("limsgs-" & i,singleMessage)
    Next
and the result was this:
form Moder.png

but I need to select a single item and so I tried to insert the items in an ABMList like this:
B4X:
liMsgs.InitializeWithMaxHeight(page,"liMsgs",ABM.COLLAPSE_ACCORDION,500,"")
    For i = 0 To mySe.myTh.lstClassThreadEl.Size - 1
        Dim thEl As ThreadEl = mySe.myTh.lstClassThreadEl.Get(i)
        Dim singleMessage As ABMContainer = ABMShared.BuildSingleMessage(page,mySe,i,thEl)
'        page.Cell(2,1).AddComponent(singleMessage)
        liMsgs.AddItem("limsgs-" & i,singleMessage)
    Next
    page.Cell(2,1).AddComponent(liMsgs)
and the result is this.
moder list err.png

is now my target clear ?
 

Attachments

  • moder sample.png
    moder sample.png
    27.6 KB · Views: 105
  • moder sample.png
    moder sample.png
    27.6 KB · Views: 96
Upvote 0

Harris

Expert
Licensed User
Longtime User
is now my target clear ? - CRYSTAL...


B4X:
For i = 0 To mySe.myTh.lstClassThreadEl.Size - 1
        Dim thEl As ThreadEl = mySe.myTh.lstClassThreadEl.Get(i)
        Dim singleMessage As ABMContainer = ABMShared.BuildSingleMessage(page,mySe,i,thEl)

        singleMessage.Tag = "Some_Key_You_Use_To_ID_This_Record" ' can be an object....
        page.Cell(2,1).AddArrayComponent(singleMessage,"MessageArray")
     
Next
 
Sub MessageArray_Clicked(Target as String)
 
    Log(" Target: " &Target)
    ' You will see that the Target contains the ID of the container clicked...
    ' Now get the tag of the container and do what you want with selected record
 
End Sub

The above may substitute as a ABMList - using your Container method...



Example of using AddArrayComponent...
 
Last edited:
Upvote 0
Top