how to get a field content inside - jsp page

hi

how can i get a field content inside “jsp page”

An exaple from old framework

“”

how it’s work now ??

thank you

Gideon

Hi Gidon,
You are talking about the methodology of the old JSP framework but now Applinx is working differently.
The methodology of the new JSP framework is to get the screen properties like field content in the code behind (java class) and to bind the value with the JSP side.
If you like to do some logic against the field content like display or remove some area in the JSP page, you should wrap the area with

תודה רבה

hi,

sorry to dig up this topic, but i can’t find the best way to retreive in my jsp data coming from the back ground screen.

i found something, but i don’t know if it’s a good way.

in the java class associated with the jsp (gx_onInit() method) i put a link to “GXScreenBasedJspContext.getGXForm()” into request attribute.
getRequest().setAttribute(“GXForm”, getGXForm());

in the jsp i declare
<%!
public String gxField(GXScreenBasedJspContext gxForm, String field) {
String fieldValue=null;
try {
fieldValue=gxForm.getAppFieldContent(field);
} catch (com.sabratec.applinx.baseobject.GXGeneralException e) {
}
return (fieldValue==null)?"":fieldValue;
}
%>
<% GXScreenBasedJspContext gx=(GXScreenBasedJspContext)request.getAttribute(“GXForm”); %>

then i do <%=gxField(gx,“EMAIL”)%> to have the email data which was previously identified in the background screen

Is there a problem when doing do
Is there a better way to do that ?
You spoke about methodology for old JSP framework… Which is the new methodology ?

thanks for your help

Hi Pascal,

The new methodology is having all you server-side (JAVA) code in the java class associated with the JSP file.

In addition, host screen data can be easily retrieved by defining the field in the screen entity and then on the JSP Page placing either a gx:span... or gx:input... with an ID attribute value that is exactly the same as the name of the field in the Screen entity.

example: <gx:span id=“Email”></gx:span>

When the host gets to this particular screen (lets call it screenX) the web application will automatically load screenX.jsp and fill it the SPAN with the appropriate host content.

Hope this helps,
regards,
Ohad

Hi Ohad M.,

Thanks for your respons.

In fact, i want a link to the email, so i do this:

<a href=“mailto:<%=gxField(gx,“EMAIL”)%>”>
<gx:span id=“EMAIL” cssClass=“gx_uf”></gx:span>

Method “gxField” explained previously.

Is there a beter way to do that ? It should be great to have a tag that could do that.

best regards