Dynamic Table creation Problem
Hi All,
I have a requirement to create tables dynamically based on data coming from backend .
The problem is there can be muliple tables created based on data.and I need to fill each row of tables correspondingly.Row and column values might very for each and every tables.
Other issue is how will I attach a selection listener to any column created dynamically.
It will be useful if anyone can provide some example for implementing same.
Thanks in Advance.
Hi,
1. You don't add a selection listener to a column but the table. The selection listener is a MethodExpression that points to a managed bean method. You can manually create a MethodExpression from FacesContext --> Application --> ExpressionFactory (for this you need FacesContext --> ELContext). Once you have the MethodExpression you can call the setter on RichTable
2. For querying the data, you can build tables based on Arrays. So queue the data in an array and you will be good to go. The question however is, what is the object type to put into the array and this I don't know because I no nothing about how the data arrives in your managed bean
However, since tables rows are not stuffed cell-by-cell you need to provide a row object
Frank
Similar Messages
-
Dynamic Table Creation & Fill Up
Hello,
Can anyone please guide where I can find examples for dynamic table creation (programmaticaly), with dynamic number of columns and rows, used to place inside text components (or whatever) to fill them with data.
All programmatic.
Using JSF, ADF BC
JDeveloper 10.1.3.1
Thanks
Message was edited by:
RJundiHi,
Meybe this article helps: http://technology.amis.nl/blog/?p=2306
Kuba -
Dynamic Table Creation with the sortable collection model in the bean.
Hi all,
My requirement: I want to create the table dynamically with the set of rows. This set of rows will be holded in the Bean for the sortable variable.
(private SortableModel viewDeleteCollectionModel)
Issue: "_No Data to Display_" is coming in the Dynamic Table. Whereas when i checked with the collection model row count it is showing the correct no of rows.
Code for Dynamic Table in JSFF:
<af:table varStatus="rowStat" value="#{ViewHistoryDelete.viewDeleteCollectionModel}"
rows="#{ViewHistoryDelete.viewDeleteCollectionModel.rowCount}"
rowSelection="single" width="99%" var="row" id="t2" summary=" " >
<af:forEach items="#{ViewHistoryDelete.viewDeleteColumnNames}" var="name">
<af:column headerText="#{name}" sortable="true" sortProperty="#{name}" id="pt_c1">
<af:inputText value="#{row[name]}" label="#{row[name]}" readOnly="true" id="it2"/>
</af:column>
</af:forEach>
</af:table>
Bean Code:
Varaible DEclaration : private SortableModel viewDeleteCollectionModel;
Row assignig to collection model : viewDeleteCollectionModel = new SortableModel(new ArrayList<Map<String, Object>>());
((List<Map<String, Object>>) viewDeleteCollectionModel.getWrappedData()).addAll(viewDeletedData);
viewHistoryDelete.setViewDeleteCollectionModel(viewDeleteCollectionModel);
After this iam checked by putting sop for the table row count
iam getting actual no.of rows. But to the screen it is not showing the rows.
Any solution............
reg,
bakkia.
Edited by: Bakkia on Oct 11, 2011 11:20 PMDid you find solution to this problem ?
-
Why dynamic table creation with struts working only for JDK1.3.1_02 version
Row
import java.util.Vector;
public class Row
private static int colsize;
private Column[] columns;
public void setColumns(Column[] columns)
System.out.println("SetColumns");
this.columns = columns;
public void setColumn(int i, Column column)
System.out.println("setting"+ i+"th column"+column);
public Column[] getColumns()
return null;
public Column getColumns(int i)
System.out.println("Column"+i);
System.out.println("Colsize"+colsize);
if(columns == null)
columns= new Column[colsize];
if(columns[i] == null)
columns[i] = new Column();
return columns;
public int getColsize()
return colsize;
public static void setColsize(int size)
colsize = size;
Column:
public class Column
private String value;
public void setValue(String value)
System.out.println("Value="+value);
this.value = value;
public String getValue()
return value;
ApplicationResources:
button.cancel=Cancel
button.confirm=Confirm
button.reset=Reset
button.save=Save
database.load=Cannot load database from {0}
error.database.missing=<li>User database is missing, cannot validate logon credentials</li>
error.fromAddress.format=<li>Invalid format for From Address</li>
error.fromAddress.required=<li>From Address is required</li>
error.fullName.required=<li>Full Name is required</li>
error.host.required=<li>Mail Server is required</li>
error.noSubscription=<li>No Subscription bean in user session</li>
error.password.required=<li>Password is required</li>
error.password2.required=<li>Confirmation password is required</li>
error.password.match=<li>Password and confirmation password must match</li>
error.password.mismatch=<li>Invalid username and/or password, please try again</li>
error.replyToAddress.format=<li>Invalid format for Reply To Address</li>
error.transaction.token=<li>Cannot submit this form out of order</li>
error.type.invalid=<li>Server Type must be 'imap' or 'pop3'</li>
error.type.required=<li>Server Type is required</li>
error.username.required=<li>Username is required</li>
error.username.unique=<li>That username is already in use - please select another</li>
errors.footer=</ul><hr>
errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
errors.ioException=I/O exception rendering error messages: {0}
heading.autoConnect=Auto
heading.subscriptions=Current Subscriptions
heading.host=Host Name
heading.user=User Name
heading.type=Server Type
heading.action=Action
index.heading=MailReader Demonstration Application Options
index.logon=Log on to the MailReader Demonstration Application
index.registration=Register with the MailReader Demonstration Application
index.title=MailReader Demonstration Application (Struts 1.0-b1)
index.tour=A Walking Tour of the Example Application
linkSubscription.io=I/O Error: {0}
linkSubscription.noSubscription=No subscription under attribute {0}
linkUser.io=I/O Error: {0}
linkUser.noUser=No user under attribute {0}
logon.title=MailReader Demonstration Application - Logon
mainMenu.heading=Main Menu Options for
mainMenu.logoff=Log off MailReader Demonstration Application
mainMenu.registration=Edit your user registration profile
mainMenu.title=MailReader Demonstration Application - Main Menu
option.imap=IMAP Protocol
option.pop3=POP3 Protocol
prompt.autoConnect=Auto Connect:
prompt.fromAddress=From Address:
prompt.fullName=Full Name:
prompt.mailHostname=Mail Server:
prompt.mailPassword=Mail Password:
prompt.mailServerType=Server Type:
prompt.mailUsername=Mail Username:
prompt.password=Password:
prompt.password2=(Repeat) Password:
prompt.replyToAddress=Reply To Address:
prompt.username=Username:
registration.addSubscription=Add
registration.deleteSubscription=Delete
registration.editSubscription=Edit
registration.title.create=Register for the MailReader Demostration Application
registration.title.edit=Edit Registration for the MailReader Demonstration Application
subscription.title.create=Create New Mail Subscription
subscription.title.delete=Delete Existing Mail Subscription
subscription.title.edit=Edit Existing Mail Subscription
LogonForm
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class LogonForm extends ActionForm
private String username;
private String password;
private String errors;
public String getUsername()
return username;
public void setUsername(String username)
this.username = username;
public void setPassword(String password)
this.password = password;
public String getPassword()
return password;
public String getErrors()
return errors;
public void setErrors(String errors)
this.errors = errors;
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((username == null) || (username.length() < 1))
errors.add("username", new ActionError("error.username.required"));
if ((password == null) || (password.length() < 1))
errors.add("password", new ActionError("error.password.required"));
return errors;
TableForm
import org.apache.struts.action.ActionForm;
import java.util.Vector;
public class TableForm extends ActionForm
private static int rowsize;
private Row[] rows;
public Row getRows(int i)
System.out.println("Row"+i);
System.out.println("Rowsize"+rowsize);
if(rows == null)
rows = new Row[rowsize];
if(rows[i] == null)
rows[i] = new Row();
return rows[i];
public Row[] getRows()
return null;
public void setRows(Row[] rows)
System.out.println("SetRows");
// this.rows=rows;
public static void setRowsize(int size)
rowsize = size;
public int getRowSize()
return rowsize;
LogonAction
import java.io.IOException;
import java.util.Hashtable;
import java.util.Locale;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.MessageResources;
public class LogonAction extends Action
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
LogonForm logonForm = (LogonForm) form;
System.out.println(logonForm);
System.out.println(logonForm.getUsername());
System.out.println(logonForm.getPassword());
if(logonForm.getUsername().equals("test") && logonForm.getPassword().equals("test"))
//TableForm tform = new TableForm();
//tform.setRowsize(2);
//tform.getRows(0).setColsize(2);
//tform.getRows(1).setColsize(2);
//request.getSession().setAttribute("tableForm",tform);
System.out.println("Table Form setRowSize");
TableForm.setRowsize(2);
System.out.println("Table Form set ColSize");
Row.setColsize(2);
System.out.println("Returning success");
return mapping.findForward("success");
else
ActionErrors errors = new ActionErrors();
errors.add("password",
new ActionError("error.password.mismatch"));
saveErrors(request, errors);
//logonForm.setErrors("LoginError");
return mapping.findForward("failure");
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<!--
This is the Struts configuration file for the example application,
using the proposed new syntax.
NOTE: You would only flesh out the details in the "form-bean"
declarations if you had a generator tool that used them to create
the corresponding Java classes for you. Otherwise, you would
need only the "form-bean" element itself, with the corresponding
"name" and "type" attributes.
-->
<struts-config>
<form-beans>
<!-- Logon form bean -->
<form-bean name="logonForm"
type="LogonForm"/>
<form-bean name="tableForm"
type="TableForm"/>
<form-bean name="profileForm"
type="ProfileForm"/>
</form-beans>
<global-forwards>
<forward name="success" path="/Profile.jsp"/>
</global-forwards>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<!-- Edit user registration -->
<action path="/logon"
type="LogonAction"
name="logonForm"
scope="request"
validate="false"
input="/Test.jsp">
<forward name="success" path="/Table.jsp"/>
<forward name="failure" path="/Test.jsp"/>
</action>
<action path="/table"
type="TableAction"
name="tableForm"
scope="request"
validate="false">
<forward name="success" path="/Bean.jsp"/>
<forward name="failure" path="/Table.jsp"/>
</action>
<action path="/profile"
type="ProfileAction"
name="profileForm"
scope="request"
validate="false"
parameter="method">
<forward name="edit" path="/EditProfile.jsp"/>
<forward name="show" path="/Profile.jsp"/>
</action>
</action-mappings>
</struts-config>
Test.jsp
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<html:form action="/logon" >
<center>
<table>
<tr>
<td> Username </td>
<td> <html:text property="username" size="16" maxlength="16"/> </td>
<td> <html:errors property="username" /> </td>
</tr>
<tr>
<td> Password </td>
<td> <html:password property="password" size="16" maxlength="16"
redisplay="false"/> </td>
<td><html:errors property="password" /> </td>
</tr>
</table>
</center>
<center> <html:submit property="submit" value="Submit"/> </center>
</html:form>
</html:html>
Table.jsp
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<html:form action="/table" >
<center>
<table>
<tr>
<td> <html:text property="rows[0].columns[0].value" /> </td>
<td> <html:text property="rows[0].columns[1].value" /></td>
</tr>
<tr>
<td> <html:text property="rows[1].columns[0].value" /> </td>
<td> <html:text property="rows[1].columns[1].value" /></td>
</tr>
</table>
</center>
<center> <html:submit property="submit" value="Submit"/> </center>
</html:form>
</html:html>The above application runs only with JDK1.3.1_02 and not with any other version. This application is creating dynamic table using struts.
Can anybody help me on the same
also appending web.xml contents:
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--Welcome file list starts here -->
<welcome-file-list>
<welcome-file>
/test.jsp
</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
validate-rules.xml
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
<!--
This file contains the default Struts Validator pluggable validator
definitions. It should be placed somewhere under /WEB-INF and
referenced in the struts-config.xml under the plug-in element
for the ValidatorPlugIn.
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>
These are the default error messages associated with
each validator defined in this file. They should be
added to your projects ApplicationResources.properties
file or you can associate new ones by modifying the
pluggable validators msg attributes in this file.
# Struts Validator Error Messages
errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.
errors.byte={0} must be a byte.
errors.short={0} must be a short.
errors.integer={0} must be an integer.
errors.long={0} must be a long.
errors.float={0} must be a float.
errors.double={0} must be a double.
errors.date={0} is not a date.
errors.range={0} is not in the range {1} through {2}.
errors.creditcard={0} is an invalid credit card number.
errors.email={0} is an invalid e-mail address.
-->
<form-validation>
<global>
<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
msg="errors.required">
<javascript><![CDATA[
function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (trim(value).length == 0) {
if (i == 0) {
focusField = field;
fields[i++] = oRequired[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
// Trim whitespace from left and right sides of s.
function trim(s) {
return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
]]>
</javascript>
</validator>
<validator name="requiredif"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequiredIf"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"
msg="errors.required">
</validator>
<validator name="minlength"
classname="org.apache.struts.validator.FieldChecks"
method="validateMinLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.minlength">
<javascript><![CDATA[
function validateMinLength(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oMinLength = new minlength();
for (x in oMinLength) {
var field = form[oMinLength[x][0]];
if (field.type == 'text' ||
field.type == 'textarea') {
var iMin = parseInt(oMinLength[x][2]("minlength"));
if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
if (i == 0) {
focusField = field;
fields[i++] = oMinLength[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
}]]>
</javascript>
</validator>
<validator name="maxlength"
classname="org.apache.struts.validator.FieldChecks"
method="validateMaxLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.maxlength">
<javascript><![CDATA[
function validateMaxLength(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oMaxLength = new maxlength();
for (x in oMaxLength) {
var field = form[oMaxLength[x][0]];
if (field.type == 'text' ||
field.type == 'textarea') {
var iMax = parseInt(oMaxLength[x][2]("maxlength"));
if (field.value.length > iMax) {
if (i == 0) {
focusField = field;
fields[i++] = oMaxLength[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
}]]>
</javascript>
</validator>
<validator name="mask"
classname="org.apache.struts.validator.FieldChecks"
method="validateMask"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.invalid">
<javascript><![CDATA[
function validateMask(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oMasked = new mask();
for (x in oMasked) {
var field = form[oMasked[x][0]];
if ((field.type == 'text' ||
field.type == 'textarea') &&
(field.value.length > 0)) {
if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
if (i == 0) {
focusField = field;
fields[i++] = oMasked[x][1];
isValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return isValid;
function matchPattern(value, mask) {
return mask.exec(value);
}]]>
</javascript>
</validator>
<validator name="byte"
classname="org.apache.struts.validator.FieldChecks"
method="validateByte"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.byte"
jsFunctionName="ByteValidations">
<javascript><![CDATA[
function validateByte(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oByte = new ByteValidations();
for (x in oByte) {
var field = form[oByte[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
if (!isAllDigits(value)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oByte[x][1];
} else {
var iValue = parseInt(value);
if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
if (i == 0) {
focusField = field;
fields[i++] = oByte[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
}]]>
</javascript>
</validator>
<validator name="short"
classname="org.apache.struts.validator.FieldChecks"
method="validateShort"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.short"
jsFunctionName="ShortValidations">
<javascript><![CDATA[
function validateShort(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oShort = new ShortValidations();
for (x in oShort) {
var field = form[oShort[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
if (!isAllDigits(value)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oShort[x][1];
} else {
var iValue = parseInt(value);
if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
if (i == 0) {
focusField = field;
fields[i++] = oShort[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
}]]>
</javascript>
</validator>
<validator name="integer"
classname="org.apache.struts.validator.FieldChecks"
method="validateInteger"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.integer"
jsFunctionName="IntegerValidations">
<javascript><![CDATA[
function validateInteger(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oInteger = new IntegerValidations();
for (x in oInteger) {
var field = form[oInteger[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
if (!isAllDigits(value)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oInteger[x][1];
} else {
var iValue = parseInt(value);
if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
if (i == 0) {
focusField = field;
fields[i++] = oInteger[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
function isAllDigits(argvalue) {
argvalue = argvalue.toString();
var validChars = "0123456789";
var startFrom = 0;
if (argvalue.substring(0, 2) == "0x") {
validChars = "0123456789abcdefABCDEF";
startFrom = 2;
} else if (argvalue.charAt(0) == "0") {
validChars = "01234567";
startFrom = 1;
} else if (argvalue.charAt(0) == "-") {
startFrom = 1;
for (var n = startFrom; n < argvalue.length; n++) {
if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
return true;
}]]>
</javascript>
</validator>
<validator name="long"
classname="org.apache.struts.validator.FieldChecks"
method="validateLong"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.long"/>
<validator name="float"
classname="org.apache.struts.validator.FieldChecks"
method="validateFloat"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.float"
jsFunctionName="FloatValidations">
<javascript><![CDATA[
function validateFloat(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oFloat = new FloatValidations();
for (x in oFloat) {
var field = form[oFloat[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'select-one' ||
field.type == 'radio') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
} else {
value = field.value;
if (value.length > 0) {
// remove '.' before checking digits
var tempArray = value.split('.');
var joinedString= tempArray.join('');
if (!isAllDigits(joinedString)) {
bValid = false;
if (i == 0) {
focusField = field;
fields[i++] = oFloat[x][1];
} else {
var iValue = parseFloat(value);
if (isNaN(iValue)) {
if (i == 0) {
focusField = field;
fields[i++] = oFloat[x][1];
bValid = false;
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
return bValid;
}]]>
</javascript>
</validator>
<validator name="double"
classname="org.apache.struts.validator.FieldChecks"
method="validateDouble"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.double"/>
<validator name="date"
classname="org.apache.struts.validator.FieldChecks"
method="validateDate"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.date"
jsFunctionName="DateValidations">
<javascript><![CDATA[
function validateDate(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oDate = new DateValidations();
for (x in oDate) {
var value = form[oDate[x][0]].value;
var datePattern = oDate[x][2]("datePatternStrict");
if ((form[oDate[x][0]].type == 'text' ||
form[oDate[x][0]].type == 'textarea') &&
(value.length > 0) &&
(datePattern.length > 0)) {
var MONTH = "MM";
var DAY = "dd";
var YEAR = "yyyy";
var orderMonth = datePattern.indexOf(MONTH);
var orderDay = datePattern.indexOf(DAY);
var orderYear = datePattern.indexOf(YEAR);
if ((orderDay < orderYear && orderDay > orderMonth)) {
var iDelim1 = orderMonth + MONTH.length;
var iDelim2 = orderDay + DAY.length;
var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
if (iDelim1 == orderDay && iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
} else if (iDelim1 == orderDay) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
} else if (iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
} else {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
var matched = dateRegexp.exec(value);
if(matched != null) {
if (!isValidDate(matched[2], matched[1], matched[3])) {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else if ((orderMonth < orderYear && orderMonth > orderDay)) {
var iDelim1 = orderDay + DAY.length;
var iDelim2 = orderMonth + MONTH.length;
var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
if (iDelim1 == orderMonth && iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
} else if (iDelim1 == orderMonth) {
dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
} else if (iDelim2 == orderYear) {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
} else {
dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
var matched = dateRegexp.exec(value);
if(matched != null) {
if (!isValidDate(matched[1], matched[2], matched[3])) {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else {
if (i == 0) {
focusField = form[oDate[x][0]];
fields[i++] = oDate[x][1];
bValid = false;
} else if ((orderMonth > orderYear && orderMonth < orderDay)) {
var iDelim1 = orderYear + YEAR.length;
var iDelim2 = orderMonth + MONTH.length;
var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
if (iDelim1 == orderMonth && iDelim2 == orderDay) {
dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
} else if (iDelim1 == orderMonth) {
dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
} else if (iDelim2 == orderDay) {
dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
} else {
dateRegexp = new Reg -
Issue in Dynamic table creation in userform
Hi all,
My userform displays a simpletable using an arraylist returned from the WF as data source. I have all the columns of this dynamic table displayed as labels.
Question:
Now I have added another new column to this table which I want to be editable (textfield) while the rest of the existing columns should be the same labels. How do I accomplish this task since the fieldloop for the table uses only a single arraylist?
this is how my code looks like
<FieldLoop for='abc'>
<expression>
<block>
<ref>List</ref>
</block>
</expression>
<Field name='tmptable'>
<Display class='SimpleTable'>
<Property name='noNewRow' value='true'/>
<Property name='border' value='0'/>
<Property name='align' value='center'/>
</Display>
<Field name='$(abc)'>
<Display class='Label' action='true'>
<Property name='value'>
<ref>abc</ref>
</Property>
</Display>
</Field>
</Field>
</FieldLoop>
thanks in advance
kpThat was pretty simple solution. I made a disable clause to the label control for the last column and instead displayed a textbox control.
thanks anyway -
Hi All,
I know how to create a dynamic table with dynamic tablecolumn.
How can I create a dynamic table using only tablecolumngroup (which is not deprecated).
AviadIWDColumn column = ...;
table.addGroupedColumn(column);
What exactly is the question?
Armin -
Dynamic table creation using JDBC
hi all, i am working in JDBC and using prepared statements.the problem i have is i need to create and read from tables,dynamically and i should also create tables with keys dynamically,i.e the user gives the table name and i should create it using JDBC.the user does not enter the full query he just types the table name.i am using oracle as backend.i have tried prepared statements to retrieve datas from tables whose names r given dynamically like
"select * from ?"
and then using
setString(1,the variable which holds the table name);
but this doesnt seem to work.it says invalid table name.how can i do this.i shd also create tables the same way like
"create table ? ..."
is there a way out of this problem or is there any other type of statement that i can use.please give a detailed example.thanks in advance.Usually when I work with Oracle DBA's they get real excited when I suggest that the application could create the tables dynamically. Because this means that there is absolutely no chance that there is a coherent implemetation of table allocation.
Seemed like a good point to me. -
Dynamic Table Creation using RTTS - Question on Issue
I am using the RTTS services to dynamically create a table. However, when I attempt to use the get_components method it does not return all the components for all tables that I am working with.
Cases and End Results
1) Created structure in data dictionary get_components works.
2) Pass PA0001, P0001 or T001P to get_components and I do not receive the correct results. It only returns a small subset of these objects. The components table has all the entries; however, the get_components method only returns about 4 rows.
Can you explain this and point me to the correct logic sequence? I would like the logic to work with all tables.
Code excerpt below:
The logic for the get components works for case 1, but not case 2. When I pass into this method a "Z" custom table or structure name for parameter structure_name and the get_components() method executes and returns the correct results. However, when I pass in any of the objects listed above in case 2, the get_components method does not return the correct number of entries. When I check typ_struct which is populated right before the get_components line, I see the correct number of components in the components table.
method pb_add_column_headings .
constants: c_generic_struct type c length 19 value 'ZXX_COLUMN_HEADINGS'.
data: cnt_lines type sytabix,
rf_data type ref to data,
typ_field type ref to cl_abap_datadescr,
typ_struct type ref to cl_abap_structdescr,
typ_table type ref to cl_abap_tabledescr.
data: wa_col_headings type ddobjname.
data: rf_tbl_creation_exception type ref to
cx_sy_table_creation,
rf_struct_creation_exception type ref to
cx_sy_struct_creation.
data: t_comp_tab type
cl_abap_structdescr=>component_table,
t_comp_tab_new like t_comp_tab,
t_comp_tab_imported like t_comp_tab.
field-symbols: <fs_comp> like line of t_comp_tab,
<fs_col_headings_tbl> type any table.
**Get components of generic structure
wa_col_headings = c_generic_struct.
typ_struct ?= cl_abap_typedescr=>describe_by_name(
wa_col_headings ).
T_COMP_TAB = typ_struct->get_components( ).
**Determine how many components in imported structure.
typ_struct ?= cl_abap_typedescr=>describe_by_name(
structure_name ).
t_comp_tab_imported = typ_struct->get_components( ).
cnt_lines = lines( t_comp_tab_imported[] ).Hi Garton,
1. GET_COMPONENT_LIST
Use this FM.
It gives all fieldnames.
2. Use this code (just copy paste)
REPORT abc.
DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
DATA : pa0001 LIKE TABLE OF pa0001 WITH HEADER LINE.
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = sy-repid
fieldname = 'PA0001'
TABLES
components = cmp.
LOOP AT cmp.
WRITE :/ cmp-compname.
ENDLOOP.
regards,
amit m. -
SQL script: dynamic table creation
Hello,
I should write a sql script to do the following (simplified):
- Create a table if it doesn't exist yet
- Select something from the newly created table and do further conditional actions
I've tried something like that:
DECLARE
lv_count INTEGER;
BEGIN
DBMS_OUTPUT.enable();
SELECT COUNT(*) INTO lv_count FROM user_tables WHERE table_name = 'DATABASEINFO';
IF(lv_count = 0)
THEN
DBMS_OUTPUT.PUT_LINE('Create DatabaseInfo');
EXECUTE IMMEDIATE
'CREATE TABLE DATABASEINFO(
ZDatabaseInfoId RAW(16) NOT NULL,
ZInfo VARCHAR2(30) NOT NULL,
ZValue VARCHAR2(100) NOT NULL,
CONSTRAINT DatabaseInfo_U_NC_PK PRIMARY KEY
ZDatabaseInfoId
END IF;
SELECT COUNT(*) INTO lv_count FROM DatabaseInfo WHERE ZInfo = 'anything';
The select statement fails with error message "Table or view cannot be found". As far as I know, this is because the table is created dynamically and validation of the sql script fails because the table doesn't exist on compile time.
How to solve that?
Best Regards
Andreas866121 wrote:
Hello,
I should write a sql script to do the following (simplified):
- Create a table if it doesn't exist yet
- Select something from the newly created table and do further conditional actions
I've tried something like that:
DECLARE
lv_count INTEGER;
BEGIN
DBMS_OUTPUT.enable();
SELECT COUNT(*) INTO lv_count FROM user_tables WHERE table_name = 'DATABASEINFO';
IF(lv_count = 0)
THEN
DBMS_OUTPUT.PUT_LINE('Create DatabaseInfo');
EXECUTE IMMEDIATE
'CREATE TABLE DATABASEINFO(
ZDatabaseInfoId RAW(16) NOT NULL,
ZInfo VARCHAR2(30) NOT NULL,
ZValue VARCHAR2(100) NOT NULL,
CONSTRAINT DatabaseInfo_U_NC_PK PRIMARY KEY
ZDatabaseInfoId
END IF;
SELECT COUNT(*) INTO lv_count FROM DatabaseInfo WHERE ZInfo = 'anything';
The select statement fails with error message "Table or view cannot be found". As far as I know, this is because the table is created dynamically and validation of the sql script fails because the table doesn't exist on compile time.
How to solve that?
why, oh why, are you dynamically making table?
DDL should be done only once via static SQL.
dig a deeper hole & EXECUTE IMMEDIATE the SELECT. -
DYNAMIC TABLE CREATION USING JSP
I WANT TO CREATE A DATABASE TABLE IN AN INTERACTIVE WAY ie MY QUESTION IS: HOW TO CREATE A TABLE USING JSP WITH TWO ARRAYS(FIRST ARRAY CONTAINS FIELD(COLUMN) NAMES AND THE SECOND ARRAY CONTAINS ITS CORRESPONDING DATATYPE)BOTH ARRAYS ARE OF VARYING SIZE.IF THE USER ENTERS SUPPOSE '6' AS THE INPUT TO FORM A TABLE OF 6 FIELDS SO, THE QUERY SHOULD BE DYNAMICALLY FORME USING THE ARRAY NAME FOR FIELD AND THE ARRANAME FOR ITS CORRESPONDING DATATYPE.HAVE ANY IDEA ON THIS PLEASE LET ME KNOW.
THANKSu need to know quite a few java technologies to make archieve your dream.
JDBC, dynamic array and JSP.
after reading tutorial regarding to these 3 materials, you should be able to get your job done. -
JSP : Dynamic Table creation
HI Frds
I am looking for solution for my following problem ...
I want to create dyanmic table i.e rows & column on the basis of user
input
Thanks
Ashishok if you want a sample here it is;
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="200">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<%for(int x=0;x<5;x++){%>
<tr>
<td>Row</td>
<td><%=x%></td>
</tr>
<%}%>
</table>
</body>
</html> -
Dynamic Table Creation Question
Can you dynamically add a column to a data table at run time using JSC and JSF? I have a case where I want to add a column to a table based on a selection by the user.
Hi
I have been trying to this when I saw your question first time two days back. I tried changing the rowset's query but nothing seems to work. I will try again and I am sure that I can give you something on this if there is any straight solution to this.
Thanks
Srinivas -
Hi,
I am trying to implement a dynamic JSF menu, by coding for it in a request bean, and have hit a stumbling block with regards to adding a panelMenu to another panelMenu. I understand how to add outputLink and outputText to the menu and even how to add another panelMenu to the menu.
Here is the code:
HtmlPanelMenu panelMenu = new HtmlPanelMenu();
panelMenu.setId("menuMain");
panelMenu.setStyleClass("panelMenu");
HtmlPanelMenu subMenu = new HtmlPanelMenu();
subMenu.setId("subMenu");
HtmlOutputText text1 = new HtmlOutputText();
text1.setValue("Enquiry Menu");
text1.setId("text1");
subMenu.getChildren().add(text1);
HtmlOutputLinkEx outputLink1 = new HtmlOutputLinkEx();
outputLink1.setId("link1");
outputLink1.setValue("enquiry.faces");
HtmlOutputText text2 = new HtmlOutputText();
text2.setId("authoritiesLinkText");
text2.setValue("Branch Enquiry");
outputLink1.getChildren().add(text2);
subMenu.getChildren().add(outputLink1);
panelMenu.getChildren().add(subMenu);When I try to run the page I get the following error:
javax.servlet.ServletException: nested menu's require a menu owner - some item that is contained in a f:facet with name = "header"
This is running on Websphere v7. I can see from the specification that the outputText for the submenu (text1) should have a surrounding facet, but I cannot find such an object anywhere. I have tried using FacetTag but this doesn't work as it hasn't got a children property to attach the outputText to it.
Am I missing something or is it that this is the wrong way?
Any help would be appreciated!
Steve
Edited by: Steve-Waterfall on Oct 22, 2009 1:37 PM
Edited by: Steve-Waterfall on Oct 22, 2009 1:38 PMAhhh you were nearly there
try
HtmlPanelMenu panelMenu = new HtmlPanelMenu();
panelMenu.setId("menuMain");
panelMenu.setStyleClass("panelMenu");
HtmlPanelMenu subMenu = new HtmlPanelMenu();
subMenu.setId("subMenu");
HtmlOutputText text1 = new HtmlOutputText();
text1.setValue("Enquiry Menu");
text1.setId("text1");
here is the key
subMenu.getFacets().put("header",text1);
HtmlOutputLinkEx outputLink1 = new HtmlOutputLinkEx();
outputLink1.setId("link1");
outputLink1.setValue("enquiry.faces");
HtmlOutputText text2 = new HtmlOutputText();
text2.setId("authoritiesLinkText");
text2.setValue("Branch Enquiry");
outputLink1.getChildren().add(text2);
subMenu.getChildren().add(outputLink1);
panelMenu.getChildren().add(subMenu); -
Dynamic tables limitations problem
I'm trying to output rows of a table with some conditional
spry:when statements. I got it all working, but it seems that the
only way to do so is by outputing a zillion tables:
<!-- spry -->
<div spry:region="dsProducts">
<div spry:repeat="dsProducts">
<table>
<tr spry:choose="spry:choose">
<td spry:when="'{ID}' < 20">{ID} small</td>
<td spry:when="'{ID}' > 20">{ID} big</td>
</tr>
</table>
</div>
</div>
<!-- END spry -->
You can't put the spry code in the table tags or it gives an
error in IE. You can't get the table tag out of the repeat or it
just breaks, meaning, you can't add div tags inbetween the table
and it's rows or data cells.
What other way is there around this?
I could use divs, but the page is in quirks mode, which makes
the pixel level formatting of the table (which will be much more
complex than this) vary too much for nice neat columns between IE
and FF, even with fixed widths floats, etc.
DougFirst, the code is correct. I'm evaluating (in this simple
example) if the value of "ID" is greater or less than 20. The
example provided works perfect. The first 20 say "small" and the
next 20 say "big". Again, that's just a simple mockup and not
anything I'm really trying to build. What I'm trying to do is more
complex, so I'm just trying to get the right method down.
That said, I'm trying generate a page that has 3 columns of
text. The xml has a field called "column_number" and it's a 1, 2,
or 3. So, I want to run either choose / when loops, or simple ifs,
when I'm in the first column and output the 1s, and likewise for
columns 2 and 3.
I can do this with divs and classes easy (setting margins to
simulate columns), but because the page is in quirks mode, I
decided to try tables. But the proper nesting of the right spry
region, repeat, and choose, (etc) for use with tables is eluding
me.
Any suggested strategies? Seems like tables are really kind
of limited. -
Hi all,
I am trying to create a node through Java code bellow is the code
IWDNodeInfo graph = wdContext.nodeGraph().getNodeInfo();
for(int i=0;i<10;i++)
int nodeNumber = i+4;
IWDNodeInfo seriseNode = graph.addChild("Serise"+nodeNumber,null,true,false,false,false,false,false,null,null,null);
seriseNode.addAttribute("S"+nodeNumber+"_size","com.sap.dictionary.double");
seriseNode.addAttribute("S"+nodeNumber+"_xVal","com.sap.dictionary.double");
seriseNode.addAttribute("S"+nodeNumber+"_yVal","com.sap.dictionary.double");
//seriseNode.addAttribute("S"+nodeNumber+"_tooltip","com.sap.dictionary.string");
IWDNode node = wdContext.nodeGraph().getChildNode("Serise"+nodeNumber,IWDNode.NO_SELECTION);
IWDNodeElement nodeElem = node.createElement();
nodeElem.setAttributeValue("S"+nodeNumber+"_xVal",new Double(0));
nodeElem.setAttributeValue("S"+nodeNumber+"_yVal",new Double(0));
nodeElem.setAttributeValue("S"+nodeNumber+"_size",new Double(0));
node.addElement(nodeElem);
IWDNode node = wdContext.nodeGraph().getChildNode("Serise4",IWDNode.NO_SELECTION);
node.getCurrentElement().getAttributeAsText("S4_size");
now it is giving me null pointer exception at last line any idea why it coming.
ThanksHi,
This problem is solved but now there is another problem,
I am creating a Node and attributes at runtime and want to bind to a business graphics UI element bellow is the code for that
IWDPoint se_point = (IWDPoint) view.createElement(IWDPoint.class,"Series"+seriseNumber+"_Point");
se.setPoint(se_point);
se.getPoint().bindValueSource("Graph.Serise"+seriseNumber);
se.setLabel(supp.getSupplier_Name());
IWDNumericValue numXVal = (IWDNumericValue) view.createElement(IWDNumericValue.class,"S_"+seriseNumber+"numXVal");
numXVal.bindValue("Graph.Series"+seriseNumber+".S"+seriseNumber+"_xVal");
numXVal.setType(WDValueTypeEnumeration.X);
numXVal.setValue(supp.getXcord());
and it gives bellow error for last line in the code
com.sap.tc.webdynpro.progmodel.context.ContextException: Node(GraphView.Graph): no child node 'Series1' at index -1
Can any one help in this
Thanks
Maybe you are looking for
-
HOW DO I INSTALL TWO DIFFERENT ITUNES ON ONE COMPUTER
how do i install two itunes accounts on one computer using windows 7
-
I have tried syncing my iPod to my Macbook and then my iPhone into it asfter...no luck....
-
With an IMAP account, if "Store sent messages on the server" is checked (in Mailbox behaviors) does Mail only store sent mail on the server? So should it not be checked if you want Mail to store sent mail on the server and the computer? Thank you. iH
-
Hi, I'm not new to Java, but this seems like the best place for this question: I have some code dealing with parsing and reading schedules: Calendar now = Calendar.getInstance(); Calendar startDateTime = (Calendar) startTime.clone();
-
ICM_HTTP_SSL_ERROR when calling web service
Summary: ICM_HTTP_SSL_ERROR was met when I called web service in ABAP with logical port & RFC Connection of type G. Details: 1. the <b>test of RFC Connection of type G in SM59 works OK</b>, with SSL inactive and basic authentication. 2. while <b>in A