<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay 7.2 - How to get the aui:select index?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=115351084" />
  <subtitle>Liferay 7.2 - How to get the aui:select index?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=115351084</id>
  <updated>2026-04-08T05:31:11Z</updated>
  <dc:date>2026-04-08T05:31:11Z</dc:date>
  <entry>
    <title>RE: Liferay 7.2 - How to get the aui:select index?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115693281" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115693281</id>
    <updated>2019-09-14T07:28:46Z</updated>
    <published>2019-09-14T07:28:46Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&amp;nbsp;May be you can have hidden input tag for description and onChange() event show which this on.&lt;pre&gt;&lt;code&gt;&amp;lt;aui:input name="descrption&amp;lt;%=product.getProductId() %&amp;gt;" value="&amp;lt;%=product.getDescription() %&amp;gt;" &amp;nbsp;type="hidden" /&amp;gt;
function updateDesc() {
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;//Show description input tag
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;
}&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-09-14T07:28:46Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.2 - How to get the aui:select index?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115351083" />
    <author>
      <name>Fabio Carvalho</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115351083</id>
    <updated>2019-09-14T01:28:22Z</updated>
    <published>2019-09-14T01:28:22Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;&lt;br&gt;I have the following view.jsp:&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;%@ include file="/init.jsp" %&amp;amp;gt;

&amp;amp;lt;%@ page import="java.util.List" %&amp;amp;gt;
&amp;amp;lt;%@ page import="packagename.servicebuilder.service.ProductLocalServiceUtil" %&amp;amp;gt;
&amp;amp;lt;%@ page import="packagename.servicebuilder.model.Product" %&amp;amp;gt;

&amp;amp;lt;% List&amp;lt;product&amp;gt; products = ProductLocalServiceUtil.getProducts(0, ProductLocalServiceUtil.getProductsCount()); %&amp;amp;gt;

&amp;lt;aui:select label="Delete Product" name="productId"&amp;gt;&amp;amp;nbsp;
    &amp;amp;lt;% for (Product product : products) { %&amp;amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; 
&amp;amp;nbsp;       &amp;lt;aui:option value="&amp;lt;%= product.getProductId() %&amp;gt;"&amp;gt;&amp;amp;lt;%= product.getProductName() %&amp;amp;gt;&amp;lt;/aui:option&amp;gt;
    &amp;amp;lt;% } %&amp;amp;gt;
&amp;lt;/aui:select&amp;gt;
&amp;lt;aui:input label="Product Description" value="this should change" type="text" readonly="true" /&amp;gt;&amp;lt;/product&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;My goal is to change the Product Description when we select something from the&amp;nbsp;aui:select. I was thinking that maybe, if I can get the selected index, I could change the value of the label by using something like this:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;aui:input label="Product Description" value="&amp;lt;%=&amp;amp;nbsp;products.get(aui:select:index).getProductDescription()&amp;amp;nbsp; %&amp;gt;" type="text" readonly="true" /&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;How can I get the select index of my aui:select? I think that I also need the&amp;nbsp;changesContext param to update the values?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fabio Carvalho</dc:creator>
    <dc:date>2019-09-14T01:28:22Z</dc:date>
  </entry>
</feed>
