Problem call query in custom tag
I use this code to call a custom tag called broadcast.cfm< cf_broadcast query = orgID "fe" = "4" >
The fe application is a file included on my website and is available to the page, that I call the custom tag.
In the custom tag, I am referencing the query as:
< cfloop query = "#attributes.query #" >
but I get this error message:
"The value of the query of the attribute, which is currently 'fe', is not valid."
I must be missing something really simple here, but cannot understand what he.
rdk8487 wrote:
It's a scope issue. The query is defined in the calling page. To access by name, within the custom tag, use the 'calling '.
> In the custom tag I am referencing the query as:
>
> but I get this error message:
> "The value of the query of the attribute, which is currently 'fe', is not valid."
Tags: ColdFusion
Similar Questions
-
Call the custom tag javascript CF
Could someone help me please by publishing some pseudo-device code to call a custome cf tag JavaScript? I feel pretty stupid, but may not know...
Thank you bunches!
TalHaving the button submit a form to another page of CF that calls the custom tag. If you don't want to actually leave the page you are on, put the target page in a little bitty iframe.
-
Custom tag of the standard errors - complex M6rne
I am at a loss here again...
But is a little more complex, because it's a custom tag - pulling some xml parsing...
And I get the error: work in CF5, however...
----------------------------------
Here is the code calls the custom tag...
< cfoutput > #term #-final just before 7 < / cfoutput > < br >
[the code before it is properly spit the 'term' in the below custom 7xml]
"< cf_7xmlparser = mt" #URLEncodedFormat (term) "#" ip = "#REMOTE_ADDR #" mode = 'array' > < / cf_7xmlparser >
<! - table output test - >
< cfset x = 1 >
< cfloop condition = "x LTE arraylen (dataArry)" >
< table border = 0 cellspacing = 0 cellpadding = 5 >
< cfoutput >
< b >
< td valign = top class = verd9 >
< b > < a href = "#dataArry [x] ["URL"] #" > #dataArry [x] ["name"] # < /a > < / b > ""
< br / > < span class = verd7 > #dataArry [x] ['description'] # </span >
< table > < /tr >
< / cfoutput >
< /table >
< cfset x = incrementvalue (x) >
< / cfloop >----------------------------------
It's the 7xml - code "cf_7xmlparser" - that worked great in CF5 - not in CF8 however...
< cfsetting enablecfoutputonly = "yes" >
<!-Make sure he treats only once-->
< thisTag.executionMode cfif EQ 'Start' >
<!-by default is array mode, mode can also be display->
< cfset mode = "array" >
< isdefined ("attributes.mt") cfif >
< cfset mt = attributes.mt >
< cfif len (trim (mt)) EQ 0 >
< cfoutput >
< br > < br >
The value of the < b > < /b > mt attribute has the value null, please check the custom tag call.
< / cfoutput >
< cfexit >
< / cfif >
< cfelse >
< cfoutput >
< br > < br >
The < b > < /b > mt attribute is an attribute required for this tag.
< / cfoutput >
< cfexit >
< / cfif >
< isdefined ("attributes.ip") cfif >
< cfset attributes.ip = ip >
< cfif len (trim (ip)) EQ 0 >
< cfoutput >
< br > < br >
The value of the < /b > < b > intellectual property attribute has the value null, please check the custom tag call.
< / cfoutput >
< cfexit >
< / cfif >
< cfelse >
< cfoutput >
< br > < br >
The < /b > < b > intellectual property attribute is an attribute required for this tag.
< / cfoutput >
< cfexit >
< / cfif >
<! - generation stream url - >
< cfset feedURL = "http://meta.7search.com/feed/xml.aspx?affiliate=63381 & token = F6 D963B03891934F789ABA8E0F3D66E4 & pn = 1 & r = 20 & filter = & st = typein & rid = medexplorer.com & what=" & mt & "& ip_address =" & ip > "<! - retrieve data xml - >
< cfhttp method = url "" #feedURL # "="get"> < / cfhttp >"
< cfset feedData = cfhttp.filecontent >
< cfset findOne = ' < site ">"
< cfset findTwo = ' < / site ' > >
< cfset posTest findnocase (findOne, feedData) = >
< cfset passcnt = 1 >
< cfset recLen = 0 >
<!--create table on the calling page-->
< cfif mode EQ 'array' >
< cfset caller.dataArry = arraynew (1) >
< / cfif >
< cfloop condition = "pretest NEQ 0" >
<!--create new structure for each pass-->
< cfif mode EQ 'array' >
< cfset dataStruct = structnew() >
< / cfif >
< cfset findOne = ' < site ">"
< cfset findTwo = ' < / site ' > ><! - starting point of get - >
< cfif passcnt NEQ 1 >
< cfset posTest findnocase (findOne, feedData, posTestx) = >
< / cfif >
< cfif posTest EQ 0 >
< cfbreak >
< / cfif >
<! - get the data of the registration - >
"< cf_parsetext vContent =" ' #feedData # ' posOne = ' #int (pretest + 7) # "findOne =" #findOne # "findTwo =" #findTwo #">< cfset recordData = HD >
< cfset posTestx = posTwo + 7 >
<! - analyze each element-->
<!--get url-->
< cfset findOne = "<>url" >
< cfset findTwo = ' < / url > ">".
< cfset p1 = findnocase (findOne, recordData) >
"< cf_parsetext vContent =" ' #recordData # ' posOne = ' #int ((p1 + len (findOne))-1) # "findOne =" #findOne # "findTwo =" #findTwo #">
< cfset url = replacenocase (replacenocase (HD, "<!")) [CDATA ["," ")," ']] (">", "") >
< cfif mode EQ 'array' >
< cfset rc = structinsert (dataStruct, "url", url) >
< / cfif >
<!--get name-->
< cfset findOne = '< name >' >
< cfset findTwo = ' < / name "> >
< cfset p1 = findnocase (findOne, recordData) >
"< cf_parsetext vContent =" ' #recordData # ' posOne = ' #int ((p1 + len (findOne))-1) # "findOne =" #findOne # "findTwo =" #findTwo #">
< cfset = replacenocase name (replacenocase (HD, "<!")) [CDATA ["," ")," ']] (">", "") >
< cfif mode EQ 'array' >
< cfset rc = structinsert (dataStruct, 'name', name) >
< / cfif >
<! – get description - >
< cfset findOne = '< description >' >
< cfset findTwo = ' < / description > ">".
< cfset p1 = findnocase (findOne, recordData) >
"< cf_parsetext vContent =" ' #recordData # ' posOne = ' #int ((p1 + len (findOne))-1) # "findOne =" #findOne # "findTwo =" #findTwo #">
< cfset description = replacenocase (replacenocase (HD, "<!")) [CDATA ["," ")," ']] (">", "") >
< cfif mode EQ 'array' >
< cfset rc = structinsert (dataStruct, "description", description) >
< / cfif ><! - record data on the structure of table and table of the calling page - >
< cfif mode EQ 'array' >
< caller.dataArry [cfset passcnt] = dataStruct >
< / cfif >
< cfset passcnt = incrementvalue (passcnt) >
< / cfloop >
< / cfif >< cfsetting enablecfoutputonly = "no" >
----------------------------------
Here is the error code...
I'm lost...
----------------------------------
Line 108 below was the error line in bold...
Complex object types cannot be converted to simple values.
Expression asked a variable or a result of the intermediate expression as a simple value, however, the result can not be converted to a simple value. Simple values are strings, numbers, Boolean values, and date/time values. Queries, tables, and COM objects are examples of complex values. The most likely cause of the error, is that you try to use a complex value as a single. For example, you could try to use a query variable in a cfif tag.
The error occurred in C:\ColdFusion8\CustomTags\cfwcustom.cfm: line 108
Called from D:\medexplorer\cfinclude\_navigate.cfm: line 41
Called from D:\medexplorer\navigate.cfm: line 14106 : <tr> 107 : <td valign=top class=verd9> 108 : <b><a href="#dataArry[x]["URL"]#">#dataArry[x]["name"]#</a></b> 109 : <br><span class=verd7>#dataArry[x]["description"]#</span> 110 : </td></tr>
In CF5, URL was not reservered Word.
From CF6 and, it is now a reserved word for the URL of the application domain, IE the GET the request headers.
If this isn't the problem. Empty the variable at the origin of the problem
And see what the structure looks like. -
Facing a problem with writing the custom for WLS identity assertion provider
I am facing a problem with writing the custom for WLS identity assertion provider.
Requirement:
Asserter identity configured in WLS should get called when the following cookie is sent in a request by my application
cookie name: OAMAuthnCookie_blr1234567.idc.oracle.com:7777
I added the name of the cookie as a token of support and Active token in WeblogicCustomIdentityAsserter.xml
< MBeanAttribute
Name = "SupportedTypes.
Type = "java.lang.String [].
Writeable = "false".
Default = "new String() {& quot; OAMAuthnCookie_blr1234567.idc.oracle.com:7777 & quot ;}.
/ >
<!-ActiveTypes attribute contains the subset of your mbean SupportedTypes who are active in the area. ->
< MBeanAttribute
Name = "ActiveTypes".
Type = "java.lang.String [].
Default = "new String() {& quot; OAMAuthnCookie_blr1234567.idc.oracle.com:7777 & quot ;}.
/ >Problem:
Identity asserter provider is not invoked for the request that has the cookie named OAMAuthnCookie_blr1234567.idc.oracle.com:7777.
I did some experiments with the cookie name, to see where the problem could be
Identity asserter provider is triggered for the following cookies:
OAMAuthnCookie_blr1234567.idc.oracle.com7777.
blr1234567. IDC. Oracle
blr12_XXX. IDC. Oracle.com
and it does not work for cookie name - OAMAuthnCookie_blr1234567.idc.oracle.com:7777
I think that the name of the token supports not the colon. I don't have control over the name of the cookie, two points will always be
Tried it with giving the name of the cookie after the encoding of the colon< MBeanAttribute
Name = "SupportedTypes.
Type = "java.lang.String [].
Writeable = "false".
Default = "new String() {& quot; OAMAuthnCookie_blr2211441.idc.oracle.com & #58;. 7777 & quot ;} »
/ >
But still does not work
Am I missing something? Any help will be appreciated.
Help, please!colon ': ' is an illegal character in the name of the cookie.
RFC 2616, Section 2.2 says:
token = 1 *.
separators = "(" | ")" | " <" |="" "="">" | " @"
| "," | ";" | ":" | " \" |<">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
It is clear ":" a "separator" and thus not allowed in a token or a cookie name.
">"> -
CF10 can't find my Custom Tag. CFParam will take a hint!
It's a parody beyond parody the cfparam tag can't stand not an attribute 'index. So I aim to fix that with a custom label! It's the first time I messed with custom tags, but so far I can't get to work.
I created a file called param.cfm, it just displays a cfparam which converts the provided ATTRIBUTES but allows specifying a suspicion on the tag < cf_param > attribute to satisfy this need.
I placed this file in c:\inetpub\wwwroot\project\custom-tags.
In my application.cfc, he simply says:
<cfset THIS.name = hash( getCurrentTemplatePath() )> <cfset THIS.customTagPaths = 'c:|inetpub\wwwroot\project\custom-tags'> <cf_param name="test" type="string" default="foo" hint="YES! WE CAN PUT HINTS ON PARAMS!">
-
Hello
I'm new to CF and I create a tag custom with two attributes. However, when you call the tag, personalized with the name as "datefrom" and date of publication 01/01/2008, the calling page came up with this error: "DATEFROM Variable is not defined.
In my tag custom:
< cfparam name = "Attributes.date" >
< cfparam name = "Attributes.name" >
< cfset date = ' #Attributes.date # ' >
< cfset dateB = ' (date, 7, 4) #mid & "-" & mid (date, 4, 2) &'-' & mid (date, 1, 2) #">".
< cfset #Attributes.name # = "#dateB #" >
«"" "Page of appeal:»»"»
< cf_convertdatetoSQL date = "url.fromdate" name = "datefrom" > "
< cf_convertdatetoSQL date = "url.todate" name = "dateto" > "
< name cfquery = 'investment' datasource = #url.code # >
SELECT AccountCategories.accountcategoryname, sum (Transactions.debit) AS Total, dbo.accountcategories.acctype
FROM dbo. AccountCategories, dbo. Beneficiaries, dbo. Transactions
WHERE the dbo. AccountCategories.accountcategoryno = dbo. AccountNumbers.accountcategoryno
AND dbo. AccountNumbers.accountno = dbo. Transactions.accountno
AND dbo. Transactions.date BETWEEN ' #datefrom # ' AND ' #dateto #
GROUP BY dbo.accountcategories.accountcategoryname, dbo.accountcategories.acctype
ORDER BY CHARINDEX(dbo.accountcategories.acctype, 'Asset,Liability,Equity') ASC
< / cfquery >
etc...
Can someone please let me know what I am doing wrong?
Thank youThe thing the most basic you're hurting is to re - organize a string instead of creating a date object.
Other things are:
In your custom tag, your cfparam tags do not have default attributes.
When you attempt to set the value of attributes.name, octothorps around the names of variables are spoil you.
In the custom tags, to return the values in the model of the appellant, you use the scope of the appellant. -
IM using a custom tag that just happens to have the same name as the page I use in it, but the page I use isn't in my way of custom tags, but it causes an infinite loop which returns the content of the page.
the tag is called login.cfm and is used on a page of the same name in a different folder, if the connection fails, the tag cflocations to the login.cfm (the tag not login) and the success he cflocations to another page.
I changed the tag to login_user and it works, but I wonder why she did this.Because when a custom tag is called the ColdFusion server will first search this model in the directory of the calling page and then in the path of the custom as defined in your administrator tag. This makes it possible to use custom tags and not them have defined within the administrator.
-
clientListener does not work with my rich input Custom tag
Hello
clientListener does not work with my rich input Custom tag
I have a custom tag myInputText and here are some details abt it...
MyInputText extension of RichInputText
MyInputTextTag extension UnifiedInputTextTag (Tag Handler)
AjaxTextFieldRenderer extension SimpleInputTextRenderer (for purposes of rendering)
So, when I use
< mc:myInoutText id = 'test100' >
< af:clientListener method = "clientMethodCall" type = "keyUp" / >
< / mc:myInoutText >
< af:inputText id = "test101" label = "test101Label" >
< af:clientListener method = "clientMethodCall" type = "keyUp" / >
< / af:inputText >
in my page and run the clientMethodCall page is called for test101 but NOT for test100.
Don't know why,
Could someone help me please...
Thank you
MuraliHello
I still think you're missing one rendering engine, else your rendering engine would not be called, because it must be returned by a method protected createFormInputRenderer (FacesBean.Type type) FormInputRenderer.
In addition, renderScript does exactly? Its positioning can be really messy in this case since the element root dom was not yet written in the Responsewriter and can also be dangerous in a PPR request (if not more). The correct way to do this would be to create a custom JavaScript counterpart and place the code in the InitDomElement function.
Kind regards
~ Simon
-
I'm the original purchaser of Creative Suite Premium. Still, she meets my needs but will not re - install after I upgraded my box to win 10. Win 10 is not the problem, and my Adobe customer profile indicates that the product is registered. Adobe just doesn't let me activate it. Can you help me?
If you're referring at the origin of Creative Suite (CS1) then this activation server was closed by Adobe a few years ago.
The only way to re - install now is to download a new version without activation for CS2 (also applies to CS1 owners).
Error: "Activation Server is not available. CS2, Acrobat 7, pass a hearing 3
Install, then enter the new, without activation serial number provided at this link (column next to the download link). Your existing serial number no longer works.
-
return a value from a custom tag?
By example, if I have a custom tag that calcs area, for example
< cf_calcArea width = "2" height = "3" >
How can I return the response if I can put it in a variable?
< cfset variables.answer = < cf_calcArea width = "2" height = "3" > >
You can add an attribute to the name of the result variable. Then inside the custom tag, create this variable in the scope of the APPELLANT. See #4
http://www.coldfusionjedi.com/index.cfm/2006/8/17/ColdFusion-custom-tag-tips
-
Problems calling contextual AIRHelp to Adobe Flex App
Hello world...
I m of the problems, call the context-sesitive Flex AIRHelp.
I can launch the help of flex using the following (flex) code, but allways starts on the default theme.
private void invocarAirHelp(tema:String):void {}
var appID:String = 'pc1 ';
var pubID:String = "8C47FDE4638CAF7F210634E52A5F8318D893A57C.1";
var mgr:ProductManager = new Manager ("airappinstaller");
Mgr.Launch ("-launch" + appID + "" + pubID);}
the launch method can receive parameters after the publisherID, but I do not know the settings that I should give the method to start the AIRHelp on a specific topic.
I tried to use the settings that the call was on the command line, e.g.:
mgr.launch ("-launch" + appID + "" + pubID + "csh - mapnumber 12");
but I get no results... with these settings using startup application doesn´t
Someone has an idea to make this work?
Thanks in advance, Sabin
Hi Sabin,
The only way to support launch AIR applications from the browser is air "browser API": http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html#1035834
The browser API uses the Manager and exposes the API of browser next level so that we are changing the implementation if necessary one day. The browser API will remain the same, even if the interactions by Manager (or something else) changes.
The browser API (air.swf) has other features that make it the best way to launch applications. For example, it provides specific information which platforms support AIR and can therefore manage to install new applications and the execution itself.
In addition, if the application is not installed then browser displays error API application flex, but it can't in the case of Manager.
That said, you can probably use "-" to separate the arguments for airappinstaller of the arguments that should be passed through the application itself.
Mgr.Launch ("-launch" + appID + "" + pubID + "- mapnumber csh - 12");
Praful - Jean
-
Problem call for different versions of BPEL process leave an ESB
We are currenlty have a problem calling a service of BSE BPEL process.
We initially developed the solution and the two releases correctly, however, it was necessary to make some changes to the BPEL process and we have redeployed later the BPEL process incrementing the version number.
However, the BSE service when insider trading was still called the initial version of the ESB service.
Is it possible to do BSE call the default version of BPEL process as configured in the BPEL console.You can accomplish this task by calling the SOAP Service in BSE that points to the current WSDL of BPEL process, for example:
http://localhost: 8888/orabpel/default/SOAOrderBooking/SOAOrderBooking? WSDL
Instead of
http://localhost:8888/ORABPEL/default/SOAOrderBooking/1.0/SOAOrderBooking?WSDLThis information is available in Metalink Note: 430206.1
-
SQL +-PROBLEM OF QUERY IN MULTI TABLE
HAI ALL,
ANY SUGGESTION PLEASE?
SUP: SQL +-PROBLEM OF QUERY IN MULTI TABLE
SQL + QUERY DATA:
-----------
SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
PATIENTS_MASTER1 DLC_POLYMORPHS_NORMAL_VALUE, HAEMATOLOGY1,
DIFFERENTIAL_LEUCOCYTE_COUNT1
WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
= & PATIENT_NUM;
-----------
RESULT:
& PATIENT_NUM = 1
no selected line
---------
& PATIENT_NUM = 2
no selected line
------------
& PATIENT_NUM = 3
PATIENT_NUM 3
PATIENT_NAME KKKK
HMTLY_TEST_NAME HEMATOLOGY
HMTLY_RBC_VALUE 4
4.6 - 6.0 HMTLY_RBC_NORMAL
DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM
DLC_POLYMORPHS_VALUE 60
DLC_POLYMORPHS_NORMAL_VALUE 40-65
-------------
-------------
REAL WILL BE:
& PATIENT_NUM = 1
PATIENT_NUM 1
PATIENT_NAME BBBB
HMTLY_TEST_NAME HEMATOLOGY
HMTLY_RBC_VALUE 5
4.6 - 6.0 HMTLY_RBC_NORMAL
-----------
& PATIENT_NUM = 2
PATIENT_NUM 2
PATIENT_NAME GEORGE
DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM
DLC_POLYMORPHS_VALUE 42
DLC_POLYMORPHS_NORMAL_VALUE 40-65
---------------
& PATIENT_NUM = 3
PATIENT_NUM 3
PATIENT_NAME KKKK
HMTLY_TEST_NAME HEMATOLOGY
HMTLY_RBC_VALUE 4
4.6 - 6.0 HMTLY_RBC_NORMAL
DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM
DLC_POLYMORPHS_VALUE 60
DLC_POLYMORPHS_NORMAL_VALUE 40-65
----------------------------
4 TABLES OF LABORATORY CLINIC FOR DATA ENTRY AND GET REPORT ONLY FOR THE TESTS CARRIED OUT FOR PARTICULAR
PATIENT.
TABLE1:PATIENTS_MASTER1
COLUMNS: PATIENT_NUM, PATIENT_NAME,
VALUES:
PATIENT_NUM
1
2
3
4
PATIENT_NAME
BENAMER
GIROT
KKKK
PPPP
---------------
TABLE2:TESTS_MASTER1
COLUMNS: TEST_NUM, TEST_NAME
VALUES:
TEST_NUM
1
2
TEST_NAME
HEMATOLOGY
DIFFERENTIAL LEUKOCYTE COUNT
-------------
TABLE3:HAEMATOLOGY1
COLUMNS:
HMTLY_NUM, HMTLY_PATIENT_NUM, HMTLY_TEST_NAME, HMTLY_RBC_VALUE, HMTLY_RBC_NORMAL_VALUE
VALUES:
HMTLY_NUM
1
2
HMTLY_PATIENT_NUM
1
3
MTLY_TEST_NAME
HEMATOLOGY
HEMATOLOGY
HMTLY_RBC_VALUE
5
4
HMTLY_RBC_NORMAL_VALUE
4.6 - 6.0
4.6 - 6.0
------------
TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
COLUMNS: DLC_NUM, DLC_PATIENT_NUM, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE, DLC_POLYMORPHS_
NORMAL_VALUE,
VALUES:
DLC_NUM
1
2
DLC_PATIENT_NUM
2
3
DLC_TEST_NAME
DIFFERENTIAL LEUKOCYTE COUNT
DIFFERENTIAL LEUKOCYTE COUNT
DLC_POLYMORPHS_VALUE
42
60
DLC_POLYMORPHS_NORMAL_VALUE
40-65
40-65
-----------------
Thank you
RCS
E-mail:[email protected]
--------I think you want an OUTER JOIN
SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE, HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE, DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1, DIFFERENTIAL_LEUCOCYTE_COUNT1 WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+) AND PATIENT_NUM = DLC_PATIENT_NUM (+) AND PATIENT_NUM = &PATIENT_NUM;
Published by: shoblock on November 5, 2008 12:17
the outer join brands became stupid emoticons or something. try hard -
Problem with fieldChanged() and custom button field
Hello
I created a custom button class by extending LabelField. I chose LabelField over field because the LabelField contains desirable properties that are already being implemented. The only problem I'm having has to do with the change listener. It seems to 'steal' the event click on other areas in my application.
For example, when I click on the custom button, a popupscreen with a listfield opens. When I click on an item in the listfield, then the fieldChanged() of custom button is called again...
Can you see anything wrong with my code?
package com.rantnetwork.fields; import com.rantnetwork.app.Constants; import net.rim.device.api.system.Display; import net.rim.device.api.ui.Color; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.Font; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.Ui; import net.rim.device.api.ui.XYEdges; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.decor.BackgroundFactory; import net.rim.device.api.ui.decor.BorderFactory; public class CustomButtonField extends LabelField { private boolean highlighted = false; public CustomButtonField(String text, long style) { super(text, style | Field.FOCUSABLE | LabelField.ELLIPSIS); setPadding(10, 0, 10, 5); setFont(Font.getDefault().derive(Font.BOLD, Constants.DEFAULT_FONT_SIZE, Ui.UNITS_pt)); setBackground(BackgroundFactory.createLinearGradientBackground( 0x163d7c, 0x163d7c, 0x03162d, 0x03162d)); setBorder(BorderFactory .createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges( Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK))); } public int getPreferredWidth() { return Display.getWidth() / 3; } protected void paint(Graphics graphics) { graphics.setColor(Color.WHITE); super.paint(graphics); } protected void drawFocus(Graphics graphics, boolean on) { // Do nothing } protected boolean navigationClick(int status, int time) { fieldChangeNotify(1); return true; } protected void onFocus(int direction) { if (!highlighted) { setBackground(BackgroundFactory.createLinearGradientBackground( 0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da)); setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK))); } } protected void onUnfocus() { if (!highlighted) { setBackground(BackgroundFactory.createLinearGradientBackground( 0x163d7c, 0x163d7c, 0x03162d, 0x03162d)); setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK))); } } public void showHighlighted(boolean focus) { if (focus) { highlighted = true; setBackground(BackgroundFactory.createLinearGradientBackground( 0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da)); setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK))); } else { highlighted = false; setBackground(BackgroundFactory.createLinearGradientBackground( 0x163d7c, 0x163d7c, 0x03162d, 0x03162d)); setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK))); } invalidate(); } public boolean isHighlighted() { return highlighted; } }
behrk2 wrote:
Now, I'm not sure why customButton.setText (calling) would trigger the fieldChanged(). Can anyone think of a reason why he can do?
Thank you!
Can you think of a reason why we can't do that? The field has changed, after all! Of course, the context (second argument to fieldChanged) will be PROGRAMMATIC in this case, that might be a pretty good indication for you. But not invoke fieldChanged at all would be wrong.
This is why I don't like the idea of extending LabelField and not just the field for your custom badges - you have much less control over his behavior. If you want an example showing how to create abstract off-screen buttons, take a look at BaseButtonField and his descendants in managers, fields and advanced buttons.
-
Unable to make a call to the custom class
Hi all
I train to call the custom since the screen as below class, but its not picking up the custom class features and gives the result, I don't know if something is not in the below class or the way I call this method.
package com.ge.bbcalendar;
Import net.rim.device.api.ui.Color;
Import net.rim.device.api.ui.Graphics;
Import net.rim.device.api.ui.component.LabelField;public class TestClass extends {LabelField
Private boolean brought;
private string text;
style long private;public {TestClass (String text, long style)
Super();
This.Text = text;
This.style = style;
}protected void onFocus (int direction) {}
focused = true;
Invalidate();
super.onFocus (branch);}
protected void onUnfocus() {}
concentrate = false;
Invalidate();
super.onUnfocus ();
}protected void paint (Graphics graphics) {}
graphics.setColor (Color.WHITE);
graphics.setBackgroundColor (0x544E4F);
If {(targeted)
graphics.setColor (Color.BLUE);
}
Graphics.Clear;
Super.Paint (Graphics);
}
}Called as of the screen
SerializableAttribute public class NativeScreen extends form {}
final cas15 TestClass = new TestClass("",LabelField.FOCUSABLE);
}What is the problem above?
I suspect that your problem is the LabelField don't think it has any text to display.
You really need this, I think
public TestLabel (String text, long style) {}
Super (Text, FOCUSABLE);...
Maybe you are looking for
-
Satellite A300-1MC, does not need the recovery cd
Hi all. My friend has a laptop Satellite A300-1MC that no longer works. When the laptop is on, it indicates that the hal file is missing. I know that we need to buy the recovery cd, since she did not have one when she bought the laptop. Can someone d
-
Qosmio F750: Activator screen 3D works and give me an error message
Hello... I have a problem in the activator of the 3D screen...When the laptop starts the activator of 3D screen not working and give me a message'already Look for the icon next to the clock running' I looked there but I have not found the icon of the
-
How can I get the full mail message header?
Hi guys,. before that I was able to show full e-mail header by activating an option in Mail preferences, but now it's gone - do you know how to get the full header of an email (for purposes of debugging of course)? Thank you in advance. See you soon.
-
I've updated my machine to El Capitan but can't seem to download a second copy for a friend. I intended to put on a USB key since they do not have access to the internet. It is like downloading but after 4 hours it has nothing. Everything I need is
-
I can receive email, but can't send. Can you help me?