Forum Stats

  • 3,874,265 Users
  • 2,266,717 Discussions
  • 7,911,796 Comments

Discussions

writer.writeAttribute("onError", "(this.src=variable)", "onError")

1004526
1004526 Member Posts: 197
edited Jan 2, 2014 12:31PM in JDeveloper and ADF

    Below line works perfectly

    writer.writeAttribute("onError", "(this.src='/path/image.png')", "onError");  //it assigns src attribut of html img tag with "/path/image.png" value if error occurs

    What i need

    String variable = "Something";

    writer.writeAttribute("onError", "(this.src=variable)", "onError");  //it want to use a variable

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,923 Red Diamond

    User, I fail to see the connection with jdev and ADF.

    We are used to have more information about the environment like jdev version and use case.

    Your question is basic java knowledge. You should be able to figure this out after a basic java tutorial.

    String variable = "Something";
    writer.writeAttribute("onError", "(this.src="+variable+")", "onError"); // should do
    

    Timo

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,923 Red Diamond

    User, I fail to see the connection with jdev and ADF.

    We are used to have more information about the environment like jdev version and use case.

    Your question is basic java knowledge. You should be able to figure this out after a basic java tutorial.

    String variable = "Something";
    writer.writeAttribute("onError", "(this.src="+variable+")", "onError"); // should do
    

    Timo

  • 1004526
    1004526 Member Posts: 197

                        writer.writeAttribute("onError",   " (this.src= ' " + this.variable+ " ' )",  "onError");  //solved my problem

    1004526
This discussion has been closed.