CFQUERY results return a null value for a varchar(MAX) field in SQL
I'm using ColdFusion 9 and SQL Server 2008.
One the fields in a table is defined as a varchar(MAX). Other fields in the table are ints, varchar(8000) varchar(256), etc.
When doing a query for records in the table and displaying the results using the cfdump tag, I see values in all fields in a row EXCEPT for the data in the varchar(MAX) field. The varchar(MAX) field shows a null value. Yet, I can verify through the SQL interface or through Microsoft Access querying the database that the varchar(MAX) fields have data.
How can I retrieve data from this field type?
Thanks in advance for your help.
I'm wrong. I AM getting query results, but not what I expect. I had maxrows set as a variable in my original query, so when it returned 5 rows, the first row always showed as [empty string]. I've tried numerous queries now (where UID >100, where UID >200, where UID> 300, etc.) When I use <CFDUMP> to return the query, the first records always shows empty strings.
Here's an example of some records retrieved from this simple query:
<CFQUERY NAME="BuildBack" DATASOURCE="STORBASE">
SELECT *
FROM CallUnit
WHERE CCU_ID>172
</CFQUERY>
Any ideas?
173
P
tuse
322
340
174
E
323
340
175
P
tuses.
324
341
176
E
325
341
177
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupC
326
342
178
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCa
327
343
179
E
328
344
180
E
329
345
181
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_
330
346
182
P
331
347
183
E
332
348
184
P
333
349
185
P
tuses.SCStat_ID)
334
350
186
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Prior
335
352
187
E
336
353
188
P
337
354
189
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Priorities.SCPriority_ID) LEFT JOIN SupCall_CommTypes ON SupCall_MetaData.CommunicationType = SupCall_CommTypes.SCComm_ID) INNER JOIN SupCall_CallStages ON SupCall_
338
355
190
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Priorities.SCPriority_ID) LEFT JOIN SupCall_CommTypes ON SupCall_MetaData.CommunicationType = SupCall_CommTypes.SCComm_ID) INNER JOIN SupCall_CallStages ON SupCall_M
339
356
191
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_
340
357
192
P
tuses.SCStat_ID) á àh\ (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Priorities.SCPriority_ID) LEFT JOIN SupCall_CommTypes ON SupCall_MetaData.CommunicationType = SupCall_CommTypes.SCComm_ID) INNER JOIN SupCall_CallSta
341
358
193
P
tuses.SCStat_ID) á àh\
Similar Messages
-
Delete after trigger returns a NULL value for the old primary key??
I am creat an After trigger that I was using to delete a row from another table. However, the OLD value returned for my primary key is a NULL value. I have an UPDATE and an INSERT portion to this same trigger that work fine with just grabbing NEW values, but this OLD value cannot be grabbed for some reason, although it seems to work on other tables when the owner is me, the problem table is not owned by me though. Has anyone run into this before? Is there a view that I need access to from this table or perhaps a setting I need to turn on? I am at a loss. Thanks.
Cannot reproduce with this modified trigger code ⦠right now I believe the problem is in this part:
BEGIN
col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
EXCEPTION
WHEN lost_connection OR lost_connection2 THEN
col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
END;
In schema CORE:
SQL> create table oinftabl
2 ( akey number(9) primary key
3 ,astring varchar2(10)
4 ,astring2 varchar2(10)
5 );
Table created.
SQL>
SQL> grant all on oinftabl to flip;
In schema FLIP (which has âCREATE ANY TRIGGERâ):
flip@FLOP> CREATE OR REPLACE TYPE VDAT AS VARRAY(100000) OF VARCHAR2(50);
2 /
create or replace trigger sbt3_system_oinftabl_x
after insert or update or delete on core.oinftabl
REFERENCING NEW as n OLD as o
FOR EACH ROW
DECLARE
col_ret INT;
dmltype CHAR(1);
tpid VARCHAR2(30);
vdata VDAT; --varray datatype I created;
lost_connection EXCEPTION;
lost_connection2 EXCEPTION;
already_there EXCEPTION;
PRAGMA EXCEPTION_INIT(lost_connection, -28576);
PRAGMA EXCEPTION_INIT(lost_connection2, -28579);
PRAGMA EXCEPTION_INIT(already_there,-1);
BEGIN
tpid := SYS.DBMS_TRANSACTION.LOCAL_TRANSACTION_ID();
IF INSERTING THEN dmltype := 'I';
ELSIF UPDATING THEN dmltype := 'U';
ELSE dmltype := 'D';
END IF;
IF INSERTING OR UPDATING THEN
dbms_output.put_line('new akey='||nvl(to_char(:n.akey),'null'));
dbms_output.put_line('new astring='||:n.astring);
vdata := VDAT(
to_char(:n.AKEY),
:n.ASTRING,
:n.ASTRING2,
NULL);
ELSIF DELETING THEN
dbms_output.put_line('old akey='||nvl(to_char(:o.akey),'null'));
vdata := VDAT(
to_char(:o.AKEY),
NULL);
END IF;
for i in 1..vdata.count
loop
dbms_output.put_line('vdata('||i||')='||nvl(vdata(i),'null'));
end loop;
--BEGIN
-- col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
--EXCEPTION
-- WHEN lost_connection OR lost_connection2 THEN
-- col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
--END;
END;
Trigger created.
flip@FLOP> show errors
No errors.
flip@FLOP> insert into core.oinftabl values (1,'abc',null);
new akey=1
new astring=abc
vdata(1)=1
vdata(2)=abc
vdata(3)=null
vdata(4)=null
1 row created.
flip@FLOP> update core.oinftabl set akey=2, astring='cba' where akey=1;
new akey=2
new astring=cba
vdata(1)=2
vdata(2)=cba
vdata(3)=null
vdata(4)=null
1 row updated.
flip@FLOP> delete from core.oinftabl where akey=2;
old akey=2
vdata(1)=2
vdata(2)=null
1 row deleted.
So the trigger has the OLD AKEY value when DELETING and it does successfully store it in the VARRAY.
Hence the problem is in that pl/sql block at the end.
What are you doing in there? -
I would like to know how to return a Null value for a number based on users input.
Somethingh like where A = DECODE(:input,'any',return is not null,:input)
A is a number datatype.
Thank you in advance
-PLike if the input variable is 'any' then decode should return 'is not null' i.e. the query should return all the records where a particular column is not null.
select * from EXAMPLE_TABLE where EXAMPLE_COLUMN =
decode( :input, 'any', is not null, :input )
Thanks for the quick response.
-P -
Validations: Null value for LOVs
See http://htmldb.oracle.com/pls/otn/f?p=24317:239
I have a "Item is not null" validation on that LOV item. The item has "Display null value" set to Yes and a LOV of STATIC2:1,2,3
If I leave the Null return value for the item to blank, the engine defaults it to %null% and the validation "knows" that this is really the same as a null value and so it kicks in (good).
But if I change the Null return value to something like %, the validation doesn't complain, it thinks that this is a not-null value.
Why the inconsistency? Does this mean that we are expected to use the default value of the Null return value i.e. leave it blank and let the engine put in %null%?
Comments? ThanksVikas - The declarative not null validation types recognize "actual" null or %null% as null values. This equivalence holds in numerous other situtations during page processing. Why does %null% get special treatment? A convention was chosen and that's it. And it works for almost everybody in almost all situations. In other words, it's useful, if not perfect. If you want a different value, you can specify one in the LOV (as you described). Then you can recognize and convert these values to null or %null% in an after-submit computation so that validations and other mechanisms work normally. (Perhaps it would help if the Builder created such a computation for items having LOVs with specified null values.) One use case for using a specified null return value might be where you want to distinguish a POSTed "actual" null value from the selected "null" value for which you have specified a null return value. Then you can tell if the value was selected from the LOV or whether it got a null value from the item's cache or source methods.
Scott -
How can I get null values for the later weeks
Hi All,
When I execute this code I get the records till current week.
How can I display the output so that I get null values for the later weeks. (with the help of v_numOfWeeks variable in the code)
Thanks,
Vikram
DECLARE
v_query VARCHAR2(4000);
TYPE ref_cursor IS REF CURSOR;
v_refcur ref_cursor;
v_sum NUMBER;
v_id NUMBER;
v_name VARCHAR2(1000);
v_weeknum NUMBER;
v_pernum NUMBER;
v_numOfWeeks NUMBER := 5;
BEGIN
v_query := ' SELECT SUM(product_bkg), postn_id, postn_tbl.postn_name, b.week_num, b.period_num
FROM ops_cv_extract b, (SELECT row_id, desc_text postn_name
FROM s_postn) postn_tbl
WHERE lvl_6_id = 5767
AND fiscal_year = 2008
AND b.week_num < 4
AND b.period_num = 3
AND b.postn_id = TO_NUMBER(postn_tbl.row_id)
GROUP BY postn_id, postn_tbl.postn_name, b.week_num, b.period_num
ORDER BY postn_tbl.postn_name, b.week_num';
OPEN v_refcur FOR v_query;
LOOP
FETCH v_refcur INTO v_sum, v_id, v_name, v_weeknum, v_pernum;
EXIT WHEN v_refcur%notfound;
dbms_output.put_line('P'|| v_pernum||'W'|| v_weeknum||' '||v_name||' '||v_sum);
END LOOP;
END;
This is the output when I execute this code.
P3W1 COMM CNTRL ISAM 213 26961.61
P3W2 COMM CNTRL ISAM 213 12870.4
P3W3 COMM CNTRL ISAM 213 245.88
P3W1 COMM CNTRL ISAM 273 72831.2
P3W2 COMM CNTRL ISAM 273 8739.38
P3W3 COMM CNTRL ISAM 273 3764.92
P3W1 COMM CNTRL TAM 213 49844
P3W2 COMM CNTRL TAM 213 20515.17
P3W3 COMM CNTRL TAM 213 16167.46
P3W2 COMM CNTRL TAM 216 12561.4
P3W3 COMM CNTRL TAM 216 2027.1
P3W1 COMM CNTRL TAM 273 -3336.71
P3W2 COMM CNTRL TAM 273 -1376.68
P3W3 COMM CNTRL TAM 273 19707.42
P3W1 Damon Walters -609.07
P3W2 Damon Walters 30030.24
P3W3 Damon Walters 37475.1
This is the output I'd like to get
P3W1 COMM CNTRL ISAM 213 26961.61
P3W2 COMM CNTRL ISAM 213 12870.4
P3W3 COMM CNTRL ISAM 213 245.88
P3W4 COMM CNTRL ISAM 213
P3W5 COMM CNTRL ISAM 213
P3W1 COMM CNTRL ISAM 273 72831.2
P3W2 COMM CNTRL ISAM 273 8739.38
P3W3 COMM CNTRL ISAM 273 3764.92
P3W4 COMM CNTRL ISAM 273
P3W5 COMM CNTRL ISAM 273
P3W1 COMM CNTRL TAM 213 49844
P3W2 COMM CNTRL TAM 213 20515.17
P3W3 COMM CNTRL TAM 213 16167.46
P3W4 COMM CNTRL TAM 213
P3W5 COMM CNTRL TAM 213
P3W1 COMM CNTRL TAM 273 -3336.71
P3W2 COMM CNTRL TAM 273 -1376.68
P3W3 COMM CNTRL TAM 273 19707.42
P3W4 COMM CNTRL TAM 273
P3W5 COMM CNTRL TAM 273
P3W1 Damon Walters -609.07
P3W2 Damon Walters 30030.24
P3W3 Damon Walters 37475.1
P3W4 Damon Walters
P3W5 Damon Walters Edited by: polasa on Oct 28, 2008 6:42 PMSure, in a Single SQL ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.01
satyaki>
satyaki>
satyaki>-- Start Of Test Data --
satyaki>with week_tab
2 as
3 (
4 select 1 period_num, 1 week_num, 10 bkg1 from dual
5 union all
6 select 1, 2, 40 from dual
7 union all
8 select 1, 3, 30 from dual
9 union all
10 select 1, 2, 20 from dual
11 union all
12 select 1, 1, 10 from dual
13 union all
14 select 1, 1, 20 from dual
15 union all
16 select 1, 3, 10 from dual
17 union all
18 select 2, 1, 15 from dual
19 union all
20 select 2, 2, 20 from dual
21 union all
22 select 2, 3, 10 from dual
23 union all
24 select 2, 1, 15 from dual
25 union all
26 select 2, 2, 30 from dual
27 union all
28 select 2, 3, 20 from dual
29 )
30 -- End Of Test Data --
31 select period_num,
32 week_num,
33 (
34 select sum(week_tab.bkg1)
35 from week_tab
36 where period_num = m.period_num
37 and week_num = m.week_num
38 group by week_num, period_num
39 ) sum_bkg1
40 from (
41 select dum.week_num,
42 wk.period_num
43 from (
44 select 1 week_num from dual
45 union all
46 select 2 from dual
47 union all
48 select 3 from dual
49 union all
50 select 4 from dual
51 union all
52 select 5 from dual
53 ) dum ,
54 (
55 select distinct period_num
56 from week_tab
57 ) wk
58 ) m;
PERIOD_NUM WEEK_NUM SUM_BKG1
1 1 40
1 2 60
1 3 40
1 4
1 5
2 1 30
2 2 50
2 3 30
2 4
2 5
10 rows selected.
Elapsed: 00:00:00.48
satyaki>Regards.
Satyaki De. -
FM returns wrong total value for Limit type PO's
Hi all,
I am working on SRM 5.0 (SP13) ECS.
I have implemented the BADI "BBP_WFL_APPROVAL_BADI" for determining the Approvers for PO whenevr a PO is changed.If the diference between the Old PO value and new PO value is > 1000 and the approval text field(custom text under "Documents" link) is set to "YES",then the WF approval is required and the approvers are determined.
The above logic works fine for the Standard type PO's where the difference between the old value and new value is determined using FM "BBP_PD_PO_GETDETAIL" by passing the GUID (for the change version and the active vesion) obtained at runtime in the BADI.
However for the limit type PO's,whenevr I change the total value for the Limit item,I see that the FM "BBP_PD_PO_GETDETAIL" doesnt return the changed value but always returns blank!
Bcause I need to check bth the values i.e. Custom text set to "YES" as well as Total value diff ,I cant use the start conditions in tcode SWB_COND.ALso I need to fetch the approvers based on the price diff so I need this value at runtime in the BADI using the FM "BBP_PD_PO_GETDETAIL".
Please advise why the FM is not returning the changed values for the Limit type PO and is there any other way(other table/FM) to get the changed value at runtime for the LIMIT type PO.
Thanks for your time.
Edited by: Rads1234 on Nov 18, 2010 4:39 AMThanks for the rpely.
Yes.I am using the GUID available at runtime in the BADI "BBP_WFL_APPROV_BADI" which is the current change version GUID.I tried using that GUID to get the data from both FM as well as CDHDR and CDPOS tables.
I think this is something related to LImit type PO because for Standard type PO's the FM returns the corretc changed value (as in the screen) for the change version GUID.I fail to understand why the changed values are shwon on the screen but are not stored anywhere in the system before actually ordering the PO! -
Pro*C & SQLDA with NULL value for predicate column
Hi: I am using a C program to update a table via a dynamic sql (method 4) and SQLDA. In the update statement predicate, I have place holders (as in TBLCOL=:C000). One of the columns in the predicate contains null values, so I set L[n] = 0, V[n] = pData (which pData[0] = '\0'), *(I[n]) = -1, and T[n] = 5 (for text). I cannot find the row that I know is there.
I cannot change my statement to contain TBLCOL IS NULL, since I don't know ahead of time if I'm looking for rows with null values for this column. The Pro*C manual says that by setting the appropriate *(I[n]) = -1, it indicates to Oracle to simulate the "IS NULL" clause, and update the appropriate rows. In my case, I receive 1403 as SQLCODE when I use TBLCOL=:C000 vs TBLCOL IS NULL. What am I doing wrong? Thank you for your help.You should include these columns as well;
ChangeType (see mxi_changetype)
ValOwner (repository)
UserID ("jobid=<>", usermskey, GUI (mmc), DG (dyngrp), reconcile)
IdAudit (This is the event task (add and del member for assignments)
ParentAuditId (AuditID of parent which last updated the attribute, not consistent)
ChangedBy (Holds the MSKEY of the user which last changed the attribute)
ExpiryTime
to make sure you get a fuller picture of the audit record.
Your selection does not cover all events and descriptions
br,
Chris -
How do I set a NULL value for the parameter field
Hi
I've another question. I'm going to set single values for parameter fields.
// e.g. set today for StartDate parameter field
fc.setCurrentValue("", "StartDate", new Date());
It should be possible to set a NULL value for date parameter fields.
fc.setCurrentValue("", "StartDate", (Date)null);
But this do not work. How do I set a NULL value correctly?
Thank you in advance.
Best regards,
ThomasFirst question - is it a stored procedure parameter?
You can't set a regular parameter field value to a null value.
There was an issue with old version of the JRC, where it was allowing null to go through, but had unexpected behavior at times.
Sincerely,
Ted Ueda -
I need to pass value for Actual GI date field in VL01N t code, I am using BAPI_DELIVERYPROCESSING_EXEC. can any one tell me how can i pass vaule ?
Hi Abdul,
Sorry for my unprecise answer, but you talk about a tcode, but you're using a BAPI Call. Maybe you want to call the transaction in batch mode?
http://help.sap.com/saphelp_erp60_sp/helpdata/de/fa/09715a543b11d1898e0000e8322d00/content.htm
Regards,
Franz -
How do I get a new value for the service name field and update it in Connection Properties?
I am running Windows Vista. I just upgraded to Firefox 4. When I try to log on to the internet, it tells me the proxy server is refusing connections. A diagnostic reported Error 815 and said the remote server is not responding because there is an invalid value for the "Service Name" field. It said to get a new value and update it in Connection Properties. How do I do this?
When you create a new film script, the first page you see is a title page.
The page after this title page is the one where you generally type in your scenes.
It looks like you are facing some issue and not able to delete any text.
Can you please send me this script so that I can have a better look at your issue?
You can save this script to disk by using option 'File -> Save to disk'. This will create a '.stdoc' file on your system.
Just mail this '.stdoc' file to me at 'roverma <at> adobe <dot> com'
Thanks -
Can you set default values for person/group picker fields? To current user?
Two-part question/issue . . .
Part 1:
In InfoPath 2013 in use with SharePoint 2013, how do you set a Default Value for Person/Group Picker fields? Other field types like Text Boxes have a Default Value section in the Data tab of Properties. There doesn't appear to be any equivalent for
the Person/Group Picker field type in Properties. I'd like to set a default person for a few fields in a form I've created. Is this possible?
Part 2:
The default user I want to set for one of those Person/Group fields is the "current user." I want a user to log into our SharePoint 2013 intranet, load a new form for edit/creation, and have one of the Person/Group fields in that form to
automatically populate this particular user. Is this possible?Hi Stephen,
You can auto populate your InfoPath farm with current user Name and all other property that you have in your User profile, you have couple of options.
First you can make a secondary connection in your InfoPath form with user profile and can use the UserProfileService.asmx and call the GetUserProfileByName method. Here is the steps you can follow.
http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
Secondly you can use JQuery and SPServices ,
$().SPServices.SPGetCurrentUser function to populate the values with script to achieve the same in this case you no need to use InfoPath form just create simple text type column in SharePoint
list and auto populate it with getting the current user Name from User Profile here is the scripts
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery.SPServices-0.5.4.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
var userCurrentName = $().SPServices.SPGetCurrentUser({
fieldName: "CurrentUser"
$("input[Title='CurrentUser']").val(userCurrentName);
var userPhone = $().SPServices.SPGetCurrentUser({
fieldName: "WorkPhone"
$("input[Title='Phone']").val(userPhone);
</script>
Krishana Kumar http://www.mosstechnet-kk.com -
How to assign values for more than one field
Hi,
I have written following code
constants: fieldname(30) value '(SAPMF02D)KNA1-AUFSD'.
constants: fieldname1(30) value '(SAPMF02D)KNA1-LISFD'.
constants: fieldname2(30) value '(SAPMF02D)KNA1-FAKSD'.
field-symbols: <L_FIELD> TYPE ANY.
field-symbols: <L_FIELD1> TYPE ANY.
field-symbols: <L_FIELD2> TYPE ANY.
Assign (fieldname) to <l_field>.
<L_FIELD> = 'ZB'. " value according to your requirement
Assign (fieldname1) to <l_field1>.
<L_FIELD1> = 'ZB'.
while debugging <l_field1> is not assinging (fieldname1).
Im able to assing for (fieldname).
how to assign value for (fieldname1).
plz suggest me to assign values for more than one field.
Regards,
BrahmajiHello,
Because there is no field name called LISFD in KNA1. Actually you misspelled the field name.
It is KNA1-LIFSD -
Using Convert to handle NULL values for empty Strings ""
After having had the problem with null values not being returned as nulls and reading some suggestion solution I added a converter to my application.
<converter>
<converter-id>NullStringConverter</converter-id>
<converter-for-class>java.lang.String</converter-for-class>
<converter-class>com.j2anywhere.addressbookserver.web.NullStringConverter</converter-class>
</converter>
...I then implemented it as follows:
public String getAsString(FacesContext context, UIComponent component, Object object)
System.out.println("Converting to String : "+object);
if (object == null)
System.out.println("READING null");
return "NULL";
else
if (((String)object).equals(""))
System.out.println("READING null (Second Check)");
return null;
else
return object.toString();
public Object getAsObject(FacesContext context, UIComponent component, String value)
System.out.println("Converting to Object: "+value+"-"+value.trim().length());
if (value.trim().length()==0 || value.equals("NULL"))
System.out.println("WRITING null");
return null;
else
return value.toUpperCase();
...I can see that it is converting my values, however the object to which the inputText fields are bound are still set to empty strings ""
<h:inputText size="50" value="#{addressBookController.contactDetails.information}" converter="NullStringConverter"/>Also when reading the object values any nulls are already converted to empty strings before ariving at the converter. It seems that there is a default converter handling string values.
How can I resolve this problem as set nulls when the input value is an empty string other then checking every string in my class individually. I would really hate to pollute my object model with empty string tests.
Thanks in advance
Edited by: j2anywhere.com on Oct 19, 2008 9:06 AMI changed my converter as suggested :
public Object getAsObject(FacesContext context, UIComponent component, String value)
if (value == null || value.trim().length() == 0)
if (component instanceof EditableValueHolder)
System.out.println("SUBMITTED VALUE SET TO NULL");
((EditableValueHolder) component).setSubmittedValue(null);
else
System.out.println("COMPONENT :"+component.getClass().getName());
System.out.println("Converting to Object: " + value + "< to " + null);
return null;
System.out.println("Converting to Object: " + value + "< to " + value);
return value;
}which produces the following output :
SUBMITTED VALUE SET TO NULL
Converting to Object: < to null
Info : The INFO line however comes from my controller object where I print out the set value :
package com.simple;
import java.util.ArrayList;
import java.util.List;
public class Controller
private String information;
/** Creates a new instance of Controller */
public Controller()
System.out.println("Createing Controller");
information = "Constructed";
public String process()
System.out.println("Info : "+getInformation());
return "processed";
public String reset()
setInformation("Re-Constructed");
System.out.println("Info : "+getInformation());
return "processed";
public String setNull()
setInformation(null);
System.out.println("Info : "+getInformation());
return "processed";
public String getInformation()
return information;
public void setInformation(String information)
this.information = information;
}I also changes my JSP / JSF page a little. Here is the updated version
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%--
This file is an entry point for JavaServer Faces application.
--%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<f:view>
<h:form>
<h:inputText id="value" value="#{Controller.information}"/>
<hr/>
<h:commandLink action="#{Controller.process}">
<h:outputText id="clicker" value="Process"/>
</h:commandLink>
<hr/>
<h:commandLink action="#{Controller.reset}">
<h:outputText id="reset" value="Reset"/>
</h:commandLink>
<hr/>
<h:commandLink action="#{Controller.setNull}">
<h:outputText id="setNull" value="Set Null"/>
</h:commandLink>
</h:form>
</f:view>
</body>
</html>The converter is declared for the String class in the faces configuration file. From the log message is appears to be invoked, however the object is not set to null.
I tested this with JSF 1.2_04-b20-p03 as well as 1.2_09-b02-FCS.
any other suggestions what could be causing this. -
AJAX - How do we check if the response text returns a null value
Hello,
Could someone please help me with this issue?
I am trying to disable a select box based on my responseText value.
I need to check if my responseText is a null and disable my select if it is a null.
Here is my code:
if (xmlHttp.readyState==4)
if(xmlHttp.status==200)
var getVal = xmlHttp.responseText;
alert(getVal); //MY ALERT SHOWS A NULL
if(getVal == null) //but my null comparison fails
document.all[ajaxBean.ajaxId2].disabled = true; var valarray=getVal.split(",");
else
for (var i=0; i < valarray.length;++i)
var valarrayinner = valarray.split("|"); addOption(document.getElementById("secondBox"), valarrayinner[1], valarrayinner[0]);
could someone tell me if its the right way to check for null value in responseText? or an alternative way to do the same
Your help is appreciated!
Thanks
PriyaHello,
Thank you for your promt response...I tried doing them as well. but nothing seems to work.
It returns a length value of 1. It appears to be strange. I even tried to catch the null and set some junk text. When i try to check for the returned text again it returns a false.
I dont know if this is the way responseText works. I tried setting a form variable but it doesnt do that too. Is there a specific way to check for the values in returned responseText?
Thanks
Priya -
How to restrict the Null Values for Key Figules in the Bex Query
Hi Friends,
I want to restrict the Null values of a perticular key figure in the Bex Query Output.
I will explain in details. i have 3 key figures in my query.. let us assume.. key1 key2key3
key1 key2 key3
4 4 100.00
5 0 200.00
1 0 19.00
0 1 10.00
i don't want to see the the records for which key 2 is 0.
we have a setting in the Bex Query for restricting the Zero values in the query properties. If we enable that setting it will show
4 4 100.00
but i want the report to display..
4 4 100.00
0 1 10.00
can any body guide me. <b>i want to display the values if key2 <> 0.</b>
Regards,
Nagesh.Hi AVR,
nice to see reply.
can you eloborate your view...how can i put the condition.
<b>i want to put the condition key2 <> 0.</b>
Regards,
Nagesh.
Maybe you are looking for
-
Where can I buy a USB Cable for my iPod 2g Classic
Does anyone sell a USB Cable to connect a iPod 2nd a Generation to my Dell Computer?? I would like to get assess to iTunes with it!
-
Hi, We are currently having Oracle Applications 11i (11.5.10.2) Instance. I need to install Identity Management (OIM), SSO and configure these to 11i instance. Can you please provide me below, - What are the documents to be followed. - What are the p
-
I want to clear the values for the controls
Hi all, After Adding Process, i want to clear the values for the controls in the form. Any one help me.
-
Questionary for PM implementation project
Hello Gurus, I am getting an opportunity to work on PM implementaion project, Scoping will start soon, can you pl guide me which are the things I need to take care during scoping. Can you pl provide me if any questionary available. Thanks in advance.
-
Hi All, Do you know the transaction code, if available to change the GL account number? I'm not talking about GL account description change through FS00. If the existing gl account number is 123445, I want to change it to AB12345. Is it possible? Re