Note that there are some explanatory texts on larger screens.

plurals
  1. POdynamically build html input textbox similar to STRUTS and Jakarata Tag Lib
    primarykey
    data
    text
    <p>Can a custom tag be utilized to clean up this form input element?</p> <pre><code>&lt;input name="action_for" type="text" value="&lt;c:if test="${empty commitmentItem.action_for}"&gt; &lt;c:out value="${param.action_for}" escapeXml='false' /&gt;&lt;/c:if&gt; &lt;c:if test="${not empty commitmentItem.action_for}"&gt; &lt;c:out value="${commitmentItem.action_for}" /&gt;&lt;/c:if&gt;" size="16" maxlength="16" /&gt; </code></pre> <p>I'd like to just type:</p> <pre><code>&lt;myTag:input field="action_for" obj="commitmentItem" /&gt; </code></pre> <p>or something similar.</p> <p>I just don't know how to access the request and also the bean data from within the tag handler class for the <strong>value</strong> attribute</p> <p>I could figure out how to do a simple tag for generating a link to the javascript POP-Up widget. </p> <pre><code>&lt;myTag:calPOP field="ecd_date" /&gt; </code></pre> <p>which generates this link:</p> <pre><code>&lt;A HREF="javascript:cal1xx.select(document.forms[0].ecd_date,'ecd_date_anchor','MM/dd/yyyy');" TITLE="Click to Select a Date" NAME="ecd_date_anchor" ID="ecd_date_anchor"&gt; CALENDAR&lt;/A&gt; </code></pre> <p>... here is a bit of the tag handler for that...</p> <pre><code>public int doStartTag() throws JspException { try { JspWriter out = pc.getOut(); out.println("&amp;nbsp;&amp;nbsp;&lt;a href=\"javascript:cal1xx.select(document.forms[0]." + field + ",'" + field + "_anchor','MM/dd/yyyy');\" TITLE=\"Click to Select a Date\" NAME=\"" + field + "_anchor\" ID=\"" + field + "_anchor\"&gt;CALENDAR&lt;/a&gt;"); } catch (IOException e) { throw new JspTagException("An IOException occurred."); } return EVAL_BODY_AGAIN; } </code></pre> <p>I am not using STRUTS and can not utilize EL</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload