Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking JSF buttons which act like "Backspace" and "Enter" Keys for an inputTextArea?
    primarykey
    data
    text
    <p><strong>UPDATE:</strong> I updated here for clarity, instead of writing in the comments or making an answer post.</p> <p>This is a piece of how the code those buttons will operate upon looks:</p> <p>I made the buttons like this:</p> <pre><code> &lt;h:commandButton value="Delete" onclick="return addBackspace();"&gt; &lt;f:ajax execute="@form" render="formula"/&gt; &lt;/h:commandButton&gt; //the backspace button </code></pre> <p>The textArea:</p> <pre><code> &lt;h:inputTextarea id="formula" value="#{output.formula}" /&gt; </code></pre> <p>I made some simple buttons which would write their value to the textArea so the user sees the formula as he builds it: </p> <pre><code> &lt;h:commandButton value="+ " onclick="return checkButtons(this.value);"&gt; &lt;f:ajax execute="@form" render="formula"/&gt; &lt;/h:commandButton&gt; </code></pre> <p>I'm not entirely sure about the ajax part i put in there, used it to stop the page refresh on every click.</p> <p>And the selectBoxes I use which have some hardcoded values now but will eventually be filled with data taken from a WS.</p> <pre><code> Property: &lt;h:selectOneMenu value ="#{output.propertyReferenceValue}" id="selectTwo" onchange="return checkItem(this.value);"&gt; &lt;f:selectItems value="#{property.propertyReference.keySet()}"/&gt; &lt;/h:selectOneMenu&gt; </code></pre> <p>Now if i make the textArea disabled or readOnly, I'm still able to write the content of the selctBoxes in it(which is good) but if i try the simple buttons like "+" their value will just appear quickly and then dissapear just as fast. If i try the backspace , it will delete the whole content of the textArea, same if i put some of the content of the selectboxes in the textArea and then if I click the "+" button (for example), the whole content of the area will be deleted. I'm still digging through the code to see what it is that makes it behave this way :)</p> <p><strong>END OF UPDATE</strong></p> <p>Would it be possible to make some commandButtons in JSF which will operate on an inputTextArea just like the "Enter" and "Backspace" keys? For example:</p> <p>The "Enter Button" when pressed, will move the cursor to a new line of the textArea. The "Backspace Button" will delete the next letter or space which is behind the cursor.</p> <p>I've been searching for a while , but i seem to find only details on how to make all the text dissapear.</p> <p>Thanks, Daniel</p>
    singulars
    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.
 

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