6 Replies Latest reply: Jan 25, 2013 4:03 AM by Ryansun-Oracle RSS

    How to add a simple hyperlink field in Apex

    Ryansun-Oracle
      Version : 4.1.0

      Hi There,

      I have a simple requirement and was trying to find the best option. I was drawing a blank.

      I need to show one single field "Overview" on an Apex page at the top which when clicked opens a new page and goes to the underlying URL.

      Now I have to add this field after my existing radio buttons which is the top "parameter" region. What is the best way to do this.

      I guess we could do this by creating a new HTML region if I am not wrong. But wondering if we can do this maybe using a Display item or something. Where we use a before regions process and populate the hyperlink and display the "Overview" text which the user can click on

      Any suggestions!

      Thanks,
      Ryan
        • 1. Re: How to add a simple hyperlink field in Apex
          fac586
          ryansun wrote:
          Version : 4.1.0

          Hi There,

          I have a simple requirement and was trying to find the best option. I was drawing a blank.

          I need to show one single field "Overview" on an Apex page at the top which when clicked opens a new page and goes to the underlying URL.

          Now I have to add this field after my existing radio buttons which is the top "parameter" region. What is the best way to do this.

          I guess we could do this by creating a new HTML region if I am not wrong. But wondering if we can do this maybe using a Display item or something. Where we use a before regions process and populate the hyperlink and display the "Overview" text which the user can click on
          The layout you are attempting to describe is not clear. "at the top"..."after my existing radio buttons"..."the top 'parameter' region". This is all subjective. You know what you mean, but we've never seen this page.

          At the very least you need to provide a more objective description so others can attempt to visualize or reproduce this. This requires the following information:

          <li>Theme
          <li>Page template
          <li>Region position and template of the "the top 'parameter' region"

          An example on apex.oracle.com is so much eloquent in these situations...

          As a rough guess, I'd probably create link HTML in the Post-Element Text of the radio group item, or the Region Footer of the "top 'parameter' region".
          • 2. Re: How to add a simple hyperlink field in Apex
            Ryansun-Oracle
            Hi Fac586,

            I am using Theme2 builder blue.

            Page template 2.

            Basically, Ignore the radio buttons etc. I just have a blank page with two display items . One shows the date and the other shows my name. on the same line. I just want to add a third display item on the same line which is a hyperlink and when clicked open www.google.com

            However, the only condition is that I want to select the URL www.google.com from table "Table_URLS'.

            So basically the third field should shown text "Google" but should be a hyperlink which when clicked opens google.com.

            Does that make sense? Let me know if you need more information.

            I think with the pre text and post text we can only hardcode the href URL. I want to select the url from a table so that its dynamic.

            thanks,
            Ryan

            Edited by: ryansun on Jan 25, 2013 12:41 AM
            • 3. Re: How to add a simple hyperlink field in Apex
              fac586
              ryansun wrote:
              I think with the pre text and post text we can only hardcode the href URL. I want to select the url from a table so that its dynamic.
              Kind of an important requirement to leave out of the original post, don't you think?

              How dynamic does it need to be? How frequently does the underlying information change?
              • 4. Re: How to add a simple hyperlink field in Apex
                Ryansun-Oracle
                Its basically environment specific. So , I have a Process (before Regions) which checks what DB environment it is and accordingly populates the url into a display item :P1_URL
                So if DB = 'TEST' then 
                
                :P1_URL :=   http://www.test-google.com
                
                 if DB = 'STAGE' then 
                
                  :P1_URL :=   http://www.stage-google.com
                
                if DB = 'PROD' then
                
                  :P1_URL :=   http://www.google.com
                Now I just want to show the :P1_URL as a hyperlink on the page.

                Question is how can we show a display item as a Hyperlink . Currently it just shows the whole text

                Thanks

                Edited by: ryansun on Jan 25, 2013 1:14 AM
                • 5. Re: How to add a simple hyperlink field in Apex
                  fac586
                  ryansun wrote:

                  Question is how can we show a display item as a Hyperlink . Currently it just shows the whole text
                  That looks like the question that should have been asked 2 hours ago...

                  To get a Display Item to render as HTML, in the item definition page Security section set Escape special characters to No.
                  • 6. Re: How to add a simple hyperlink field in Apex
                    Ryansun-Oracle
                    Thanks Fac586. That worked.

                    Apologies for the confusion.