Views

MyMobileWeb SMSSend Tag

From Morfeo Wiki

Jump to: navigation, search

Contents

Overview

The smssend control allows the user to send sms by mobile operators directly from the browser, provided the device has that capability. If the control contains text, it will be shown as a link in the page. If not, the phone number will be displayed.

Note that this feature is only available for delivery contexts supports http://morfeo-project.org/mymobileweb:availableSmsClient property.

For example in extended WURFL:

  <device user_agent="Nokia 60 Developer Platform 3.0" fall_back="nokia_generic_series60_dp20" id="nokia_generic_series60_dp30">
     <group id="sms">
        <capability name="can_send_sms_from_browser" value="true" />		
     </group>
  </device>

Attributes

The attributes supported by this tag are the following:

  • Attribute: id (required)
    Identifier for this control.
  • Attribute: class
    Reference to the CSS2 style for this component or a E.L. which solves this reference.
  • Attribute: display
    E.L. which contains the condition to show the control or not.
    Default value: true.
  • Attribute: number (required)
    Represents the telephone number. It must not have any spaces or other characters between the digits and it is recommended to precede it always with the country number. For example a correct spanish phone number would be +34625889357. An E.L. which resolves the phone number is also allowed.

CSS styles

img-display style: This control has a resourceid associated: _MYMW_IMG_SMSSEND. With this style you can stay if the image should be shown at the left of the control. The allowed values are:

  • both: Show the image and also the phone number.
  • none: Only the phone number will be shown.

Default value is both.
If needed, the image resource provided by MyMobileWeb can be changed.

Image:_mymw_img_smssend_resource.gif

Figure 1 .- _MYMW_IMG_SMSSEND image resource

It inherits all styles from label control.

Example

This example is a MyMobileWeb presentation which contains the smssend control to allow the user to send sms. Note that the value of number attribute is an Expression Languages, so we use binding to associate context and control data. No style properties are explicity set so it will take default values, for example the image resource will be shown. For those devices that don't support the capability of sending sms, the phone number will appear.

  <?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet href="smssend.css" type="text/css"?>
  <mymw:document xmlns:mymw="http://morfeo-project.org/mymobileweb" id="example1">  
    <mymw:head>  
       <mymw:title>SMSSend</mymw:title>    
    </mymw:head>  
    <mymw:body>  
       <mymw:div id="p1" class="nowrap center vertical">
          <mymw:label id="lSMS">Contact by sms:</mymw:label>
          <mymw:smssend id="smsSend" number="${number}">Send sms</mymw:smssend>     
       </mymw:div>    
       <mymw:include content="Hr/generic/example1/foot"/>
    </mymw:body>  
  </mymw:document>
Figure 2 .- smssend control


Image:_mymw_smssend_nokia.jpg Image:_mymw_smssend_nokia_2.jpg Image:_mymw_smssend_opw.jpg

Figura 3 .- smssend rendering in different devices