cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript

Former Member
0 Kudos

Hi all,

I'm working on developing a web dynpro application that requires the use of an element similar to the HTMLB "HTML Edit".

The approach I'm working on is to use a text edit and JavaScript. Since there is no direct way to place JavaScript in Web Dynpro I am considering using WD URL Actions to trigger JavaScript functions. I have been able to execute small commands like windows.close and such. To achieve my goal of simulating an "HTML Edit" I need to be able to have each action load and trigger a JavaScript function or multiple lines of script.

Any help in being able to call a JavaScript function from Web Dynpro would be greatly appreciated.

Thanks,

Jonathan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Forget it, it will not work. Javascript is no part of the Web Dynpro programming model.

Armin

Answers (2)

Answers (2)

Former Member
0 Kudos

Jonathan,

Dead way. You'll end up with something like this:


For Each Release In WD.Releases(wdPreviousCurrentAndFuture, wdEnumerateAllsServicePacks)
  Dim HtmlClientOutputFeatures As WD.Internal.VeryUndocummented.Features
  Set HtmlClientOutputFeatures = CreateObject( _
    "WD.Internal.VeryUndocummented.Features." + Release.Version _
  )
  'Anyway you cannot support SmartClients and hand-helds
  'so let set filter by client
  HtmlClientOutputFeatures.Filter = wdHtmlClients
  Dim htmlTemplate As String
  htmlTemplate = HtmlClientOutputFeatures.ViewHtmlSourceAndTryToUnderstandWhatIsHere()
  If HtmlClientOutputFeatures.supportJsHacks Then
    Dim jsSources() As String
    jsSources = HtmlClientOutputFeatures.GetMegsOfJsSources(wdForEverySupportedBrowser)
    Dim i As Integer
    For i = LBound(jsSources) To UBound(jsSources)
      Dim jsSource As String
      jsSource = jsSources(i)
      'While next operation takes too much time
      'It's better to yield control temporary
      Sleep 1 'One second
      If StillCryptic(jsSource) Then
        jsSource = gGoogle.DecryptThis(jsSource)
      End If
      if StillCryptic(jsSource) Then
        gProjectDeadline.Extend 10 'Number of working days
        jsSource = gAllCollegues.DecryptThis(jsSource)
      End If
      if StillCryptic(jsSource) Then
        gProjectDeadline.Extend 10 'Number of working days
        Dim result As MailReply
        Set result = gMailToSDNers.send( subject:="DecryptThis", body:=jsSource)
        While result.readyState <> 4 Do
          gProjectDeadline.Extend 1
          Sleep 60 * 60 * 24
        End While
        jsSource = result.bodyAsString
        'Rest of code is ommited while program
        'never reaches it in practice
      End If
    Next i
  End If
  
Next Release

VS

thomas_szcs
Active Contributor
0 Kudos

Wow, wished I could award points as a reader.

/bow3

thomas_szcs
Active Contributor
0 Kudos

Hi Jonathan,

If you use Web Dynpro ABAP, the better solution will be to use a textedit to enter a tagged syntax like it is used here for the forums and to display the result using a FormattedTextView.

Best regards,

Thomas