[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

RE: Selection Lists & Softkeys

(Joseph Croney (MSFT))

2/22/2002 12:08:00 AM

1 Answer

Dan Black

3/6/2002 1:06:00 AM

0

OK, call me stupid, but I've tried everything and I can't get this to work.
Am I missing something or is the released version different and this
solution doesn't work anymore?

Please help, Dan


"Joseph Croney (MSFT)" <jcroney@microsoft.com> wrote in message
news:wXKtZzyuBHA.1884@cpmsftngxa08...
> Hi Steve,
> In our default rendering of lists we did not choose to set the softkey
> value because it can interfere with other softkey commands on the card.
> However, since we have and extensible model, you could modify the adapter
> used for wml output to provide softkey labels for selection lists. To do
> this modify the RenderSelectOption methods in the WmlMobileTextWriter
class
> as shown below.
>
> Thanks.
> Joseph Croney
>
> public virtual void RenderSelectOption(String text)
> {
> if (!AnalyzeMode)
> {
> WriteBeginTag("option");
>
> // Make sure the SoftkeyLabel is the proper length
> // And set the title attribute of this element
> if (text.length() > Device.MaximumSoftkeyLabelLength)
> writeAttribute("title",
> text.SubString(0,Device.MaximumSoftkeyLabelLength), true);
> else
> WriteAttribute("title", text, true);
>
> Write(">");
> WriteEncodedText(text);
> WriteEndTag("option");
> }
> }
>
> public virtual void RenderSelectOption(String text, String value)
> {
> if (!AnalyzeMode)
> {
> WriteBeginTag("option");
> WriteAttribute("value", value, true);
>
> // Make sure the SoftkeyLabel is the proper length
> // And set the title attribute of this element
> if (text.length() > Device.MaximumSoftkeyLabelLength)
> writeAttribute("title",
> text.SubString(0,Device.MaximumSoftkeyLabelLength), true);
> else
> WriteAttribute("title", text, true);
>
> Write(">");
> WriteEncodedText(text);
> WriteEndTag("option");
> }
> }
>
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.