Mingcedar

Product: Mingcedar Studio DESIGNER

Open Link (Click to Navigate) | Mingcedar Studio

Configure a component to open a page, URL, system menu, or scripted destination on click. Select Destination first, then enter the fields for that type.

Published Updated

<div class="manual-doc-article manual-doc-article-section"><h2 id="interaction-open-link">Interactions: Open Link (Click to Navigate)</h2>

Configure a component to open a page, URL, system menu, or scripted destination on click. Select Destination first, then enter the fields for that type.

<div class="doc-card-list">

<article class="doc-card">

<h3 id="interaction-open-link-item-1">What it is and what it&#39;s for</h3>

<p>Open Link runs when a user clicks its component at runtime. Choose Internal page, External URL, System menu, or Run script under Destination.</p>

</article>

<article class="doc-card">

<h3 id="interaction-open-link-item-2">How to use it: editor fields</h3>

<p>Drag Open Link onto the target component, open the editor, and choose Destination. Fill the fields for the selected target type:</p>

<ul>

<li>Internal page: enter an exported page file such as Main.html in Page address, or click Select PPT page... to choose from this presentation. Relative addresses resolve from the current exported page and must stay within the asset root.</li>

<li>External URL: select this destination for a complete external or intranet URL, then fill the fields shown for that mode.</li>

<li>System menu: select this destination for a host menu and confirm the target configured in the host.</li>

<li>Run script: use this when the destination depends on runtime state or the click combines actions.</li>

<li>Open options: choose HMI window or Page only, then set Fullscreen and New tab as needed.</li>

<li>Parameters (optional): add Key / Value pairs only when the destination needs context.</li>

</ul>

<div class="manual-code" data-code-language="text"><div class="manual-code-toolbar"><span>Text</span><span class="manual-code-tools"><small>Text</small><button type="button" data-copy-code data-copied="Copied" data-failed="Select and copy the code" aria-label="Copy code: Text">Copy code</button><span class="manual-code-status" role="status"></span></span></div><pre tabindex="0" class="docs-code-block shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span>// Run script: choose a page by state</span></span>

<span class="line"><span>if (ReadTagBoolean("PLC_LINE01.PUMP01.FAULT", false)) {</span></span>

<span class="line"><span> hqVisuDesigner.openPage("alarm_overview");</span></span>

<span class="line"><span>} else {</span></span>

<span class="line"><span> hqVisuDesigner.openPage("production_overview");</span></span>

<span class="line"><span>}</span></span></code></pre></div>

</article>

<article class="doc-card">

<h3 id="interaction-open-link-item-3">Parameters: sending values and reading them on the destination</h3>

<p>For Internal page, add Key / Value rows under Parameters when the destination needs context. A scripted openPage call may supply strings, numbers, booleans, or null; the destination reads text values. Repeated keys keep their original order.</p>

<ul>

<li>Editor sender: select Internal page and add Key / Value rows.</li>

<li>Script sender: hqVisuDesigner.openPage(pageCode, { frameTarget, parameters }); parameters must be an array, not a plain object.</li>

<li>Read the first value: GetPageParameter(&quot;PLC&quot;, &quot;&quot;).</li>

<li>Read every repeated value: GetPageParameterValues(&quot;Area&quot;).</li>

<li>Read every parameter in original order: GetPageParameters().</li>

<li>The equivalent hqVisuDesigner.getPageParameter / getPageParameterValues / getPageParameters methods are also available.</li>

</ul>

<div class="manual-code" data-code-language="javascript"><div class="manual-code-toolbar"><span>JavaScript</span><span class="manual-code-tools"><small>JavaScript</small><button type="button" data-copy-code data-copied="Copied" data-failed="Select and copy the code" aria-label="Copy code: JavaScript">Copy code</button><span class="manual-code-status" role="status"></span></span></div><pre tabindex="0" class="docs-code-block shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#6A737D">// Source page: navigate within the package and pass context</span></span>

<span class="line"><span style="color:#24292E">hqVisuDesigner.</span><span style="color:#6F42C1">openPage</span><span style="color:#24292E">(</span><span style="color:#032F62">"device_details"</span><span style="color:#24292E">, {</span></span>

<span class="line"><span style="color:#24292E"> frameTarget: </span><span style="color:#032F62">"frame"</span><span style="color:#24292E">,</span></span>

<span class="line"><span style="color:#24292E"> parameters: [</span></span>

<span class="line"><span style="color:#24292E"> { key: </span><span style="color:#032F62">"PLC"</span><span style="color:#24292E">, value: </span><span style="color:#032F62">"PLC_LINE01"</span><span style="color:#24292E"> },</span></span>

<span class="line"><span style="color:#24292E"> { key: </span><span style="color:#032F62">"Device"</span><span style="color:#24292E">, value: </span><span style="color:#032F62">"PUMP_01"</span><span style="color:#24292E"> },</span></span>

<span class="line"><span style="color:#24292E"> { key: </span><span style="color:#032F62">"Area"</span><span style="color:#24292E">, value: </span><span style="color:#032F62">"AREA01"</span><span style="color:#24292E"> },</span></span>

<span class="line"><span style="color:#24292E"> { key: </span><span style="color:#032F62">"Area"</span><span style="color:#24292E">, value: </span><span style="color:#032F62">"AREA02"</span><span style="color:#24292E"> }</span></span>

<span class="line"><span style="color:#24292E"> ]</span></span>

<span class="line"><span style="color:#24292E">});</span></span>

<span class="line"></span>

<span class="line"><span style="color:#6A737D">// Destination Page Script</span></span>

<span class="line"><span style="color:#D73A49">var</span><span style="color:#24292E"> plc </span><span style="color:#D73A49">=</span><span style="color:#6F42C1"> GetPageParameter</span><span style="color:#24292E">(</span><span style="color:#032F62">"PLC"</span><span style="color:#24292E">, </span><span style="color:#032F62">""</span><span style="color:#24292E">);</span></span>

<span class="line"><span style="color:#D73A49">var</span><span style="color:#24292E"> device </span><span style="color:#D73A49">=</span><span style="color:#6F42C1"> GetPageParameter</span><span style="color:#24292E">(</span><span style="color:#032F62">"Device"</span><span style="color:#24292E">, </span><span style="color:#032F62">""</span><span style="color:#24292E">);</span></span>

<span class="line"><span style="color:#D73A49">var</span><span style="color:#24292E"> areas </span><span style="color:#D73A49">=</span><span style="color:#6F42C1"> GetPageParameterValues</span><span style="color:#24292E">(</span><span style="color:#032F62">"Area"</span><span style="color:#24292E">);</span></span></code></pre></div>

</article>

<article class="doc-card">

<h3 id="interaction-open-link-item-4">When to use it</h3>

<p>Use it to switch pages or open content, for example:</p>

<ul>

<li>A Pump Details button on the overview page: use Internal page to select the exported Pump page.</li>

<li>For a host menu, choose System menu and verify its target in the host.</li>

<li>For a help, work-order, or reporting site, choose External URL and enter an address reachable at runtime.</li>

<li>For a static help page in the same package, enter its exported page address under Internal page.</li>

<li>For a destination computed from live state, use Run script.</li>

</ul>

</article>

<article class="doc-card doc-card-warn">

<h3 id="interaction-open-link-item-5">Limitations and troubleshooting</h3>

<p>An Internal page relative address must stay inside the current package&#39;s asset directory. Use a screen code for another package or System menu for a host menu. Do not use a path such as <code>../../other-screen/index.html</code> to navigate between packages.</p>

</article>

</div>

<div class="docs-note-grid manual-doc-image-grid">

<figure class="docs-note-card manual-doc-image-card" id="interaction-open-link-image-1">

<img src="/WEB_img/HQPPT/current-20261021/open-link-internal-page.png" alt="Open Link editor showing Internal page, opening options, and optional parameters" loading="lazy" decoding="async" />

<figcaption>

<strong>Figure 1: Open Link: Internal page</strong>

<p>For Internal page, enter Page address, select a presentation page, and configure Open options and Parameters.</p>

</figcaption>

</figure>

</div>

</div>