[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Objectlist/ItemCommand/DefaultCommand does not work on WAP devices

Sven Betzold

10/11/2002 1:33:00 PM

Hi there,

I have an ObjectList with an DefaultCommand "ShowDetails (a sub wich handles
the ItemCommand). Everything works fine for me on the ce devices... BUT:
when I load the page on a WAP Device I just "browse" and my DefaultCommand
is not being used :-(!
Whats wrong here??? Here is some code....

filling the list:
--------
m_Result = oWCAManager.GetAllUsers

Dim m_ArrayList As New ArrayList()

For Each m_UserList In m_Result

m_Item = New myItem(m_UserList.sName, m_UserList.iID)

m_ArrayList.Add(m_Item)

Next

slUser.LabelField = "Name"

slUser.DataSource = m_ArrayList

slUser.DataBind()

------

Public Sub ShowDetails(ByVal sender As System.Object, ByVal e As
System.Web.UI.MobileControls.ObjectListCommandEventArgs) Handles
slUser.ItemCommand

Dim iUserID As Integer = e.ListItem("ID")

...some Code goes here

'and here we go...

ActiveForm = frmUserDetail

End Sub


1 Answer

Sven Betzold

10/11/2002 5:19:00 PM

0

Ok... rtfm before you post :-( sorry guys! Did this - and it worked...

"Even if a default command is defined, it is recommended that you include a
command with the same name in the commands collection. If the control cannot
render a graphical element that includes a shortcut for the default command,
it must revert to displaying the default command as part of a set of
commands."

YEP!
---sven


"Sven Betzold" <sven.betzold@nospamweb.de> wrote in message
news:#sE1jnRcCHA.2004@tkmsftngp12...
> Hi there,
>
> I have an ObjectList with an DefaultCommand "ShowDetails (a sub wich
handles
> the ItemCommand). Everything works fine for me on the ce devices... BUT:
> when I load the page on a WAP Device I just "browse" and my DefaultCommand
> is not being used :-(!
> Whats wrong here??? Here is some code....
>
> filling the list:
> --------
> m_Result = oWCAManager.GetAllUsers
>
> Dim m_ArrayList As New ArrayList()
>
> For Each m_UserList In m_Result
>
> m_Item = New myItem(m_UserList.sName, m_UserList.iID)
>
> m_ArrayList.Add(m_Item)
>
> Next
>
> slUser.LabelField = "Name"
>
> slUser.DataSource = m_ArrayList
>
> slUser.DataBind()
>
> ------
>
> Public Sub ShowDetails(ByVal sender As System.Object, ByVal e As
> System.Web.UI.MobileControls.ObjectListCommandEventArgs) Handles
> slUser.ItemCommand
>
> Dim iUserID As Integer = e.ListItem("ID")
>
> ...some Code goes here
>
> 'and here we go...
>
> ActiveForm = frmUserDetail
>
> End Sub
>
>