Issue with Textarea xtype picking value from the JSP | Adobe Higher Education
Skip to main content
Level 9
October 16, 2015
Respondido

Issue with Textarea xtype picking value from the JSP

  • October 16, 2015
  • 2 respostas
  • 1578 Visualizações

Hello,

Is there a way to pass a data to a widget in a dialog from the JSP.

I am trying to have the value of the widget(textarea xtype) which is initially hidden, an onclick of a checkox i would have the texarea as xtype shown, bearing the value that is  stored under the dc:description property of a particular asset, which has been dragged and dropped onto the drop target area in the same dialog.

I managed to use selectionchanged listener for the checkbox and i am able to populate the text area with the asset's dc:description value, but if i have multiple such components on the page the first component's dc:description value gets picked up.

In jsp:     <input id ="desc" type ="text" value ="<%=assetDesc%>"/>  //prints the right dc:description values(stored in assetDesc variable) for each component dropped on the page,

in listener: var desc=document.getElementById("desc").value;// always returns the value of the component that has been dropped on the page first.

 

Any help ?

Este tópico foi fechado para respostas.
Melhor resposta por Ojjis

Hi,
it will be difficult to use this since you can't really have several elements on a page with the same id (or you can but definitely should not).
You need to create a unique id for each element if you want to user getElementById. Otherwise it will just pick the first element with that id on the page.

/Johan

2 Respostas

Ojjis
OjjisResposta
Level 7
October 16, 2015

Hi,
it will be difficult to use this since you can't really have several elements on a page with the same id (or you can but definitely should not).
You need to create a unique id for each element if you want to user getElementById. Otherwise it will just pick the first element with that id on the page.

/Johan

Level 9
October 16, 2015

Anyone ?