Dynamically populate the text propert of the Button in JSP
Hello,
I have the following code in the doInitialization() method:
IPortalComponentRequest request =((IPortalComponentRequest)this.getRequest());
myBean = new MyBean();
myBean.setText("Submit");
request.getComponentSession().putValue("myBean", myBean);
doProcessBeforeOutput forwards the request to JSP
this.setJspName("MyView.jsp");
and the JSP is:
<%@ taglib uri="tagLib" prefix="hbj"%>
<jsp:useBean
id="myBean"
scope="session"
class="Test.portal.MyBean"
/>
<hbj:button
id="MyButton"
text="<%= myBean.getText() %>"
onClick="click"
tooltip="submit">
</hbj:button>
By doing this I was hoping to see the text of the button to be 'Submit' but it is empty. Any ideas on what I am doing wrong?
Thanks,
Asheesh
I found a similar post on the forum. I had to remove the following from portalapp.xml
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/MyView.jsp"/>
Once I did that the Submit text on the button appeared.
Do you know why having these properties were causing the problem?
Similar Messages
-
Dynamically populate a record group on the fly uisng LOV
Hi,
I want to create dynamically populate a record group on the fly uisng LOV.
1. This is how the RG_BANKNAME Record Group object look like
Object : Record Group
Name : RG_BANKNAME
Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
2. I create the Push Button and when user click it will popup the LOV.
DECLARE
rg_id RecordGroup;
errcode NUMBER;
status BOOLEAN;
BEGIN
rg_id := Find_Group('RG_BANKNAME');
IF Id_Null(rg_id) THEN
Message('No such group: ',ACKNOWLEDGE);
RAISE Form_Trigger_Failure;
ELSE
errcode :=POPULATE_GROUP(rg_id);
SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);
SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);
status := Show_LOV('LV_NAME',10,20);
IF NOT status THEN
Message('You have not selected a value.');
Bell;
END IF;
END IF;
END;
My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
create on my design times, because I thought it can be done dynamically on the fly.
The problem is compliant that the Lov Id is not valid.
Thanks
David
Edited by: user445990 on May 24, 2011 9:19 PMHello,
You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
Francois -
I want to know how to clear the text area by the push off my next question button and ask a new ques
I want to know how to clear the text area by the push off my next question button and ask a new question - also I want to know how to code in my project to where a user can enter a math question in one border container and the answer enters into the next container
heres my code so far
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" backgroundColor="#1E5C75">
<fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
//convert text area into labelid to be identified by actionscript
richTextLabel.text = myArea.text;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<!--container 1-->
<s:BorderContainer borderWeight="7" x="28" y="10" width="200" height="138">
<s:layout>
<s:VerticalLayout paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10"/>
</s:layout>
<!--data Entry control-->
<s:TextArea id="myArea" width="153" height="68"/>
<!--end of data entry control-->
<s:Button width="151" label="ask a question" click="button1_clickHandler(event)"/>
</s:BorderContainer>
<!--container2-->
<s:BorderContainer borderWeight="7" x="509" y="10" width="200" height="138">
<s:layout>
<s:VerticalLayout paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10"/>
</s:layout>
<!--data entry control-->
<!--convert tne data entry control into a label id in actionscript-->
<s:Label id="richTextLabel" width="153" height="68"/>
<s:Button width="151" label="next question" click="button1_clickHandler(event)"/>
</s:BorderContainer>
</s:Application>This is a user to user support forum. We are all iphone users just like you.
You are not addressing Apple here at all.
This is an odd way to ask your fellow iphone users for help. Berating oterh users will not help you.
"it's too fragile"
No it is not. i have never damaged one, nor has anyone I know.
" U loose data when Ur phone is locked"
No you don't. Why do you think this?
"and there is no customer support!!! "
Wrong yet again. Apple has an 800 number and they have many retail stores and they have support articles that you can access using the search bar. Or you can contact them throgh express lane online
"but I will go back with Blackberry "
Please do.
Good ridance -
How can I get the "text" field from the actionEvent.getSource() ?
I have some sample code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.ArrayList;
public class JFrameTester{
public static void main( String[] args ) {
JFrame f = new JFrame("JFrame");
f.setSize( 500, 500 );
ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
buttonsArr.add( new JButton( "first" ) );
buttonsArr.add( new JButton( "second" ) );
buttonsArr.add( new JButton( "third" ) );
MyListener myListener = new MyListener();
( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
JPanel panel = new JPanel();
panel.add( buttonsArr.get( 0 ) );
panel.add( buttonsArr.get( 1 ) );
panel.add( buttonsArr.get( 2 ) );
f.getContentPane().add( BorderLayout.CENTER, panel );
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.setVisible( true );
public static class MyListener implements ActionListener{
public MyListener() {}
public void actionPerformed( ActionEvent e ) {
System.out.println( "hi!! " + e.getSource() );
// I need to know a title of the button (which was clicked)...
}The output of the code is something like this:
hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
I need this: "first" (from this part: "text=first" of the output above).
Does anyone know how can I get the "text" field from the e.getSource() ?System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
In a real-world application, no.
In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button). -
How to retrieve the Text entered in the Text Box provided in the UWL Inbox
Hi Experts,
I have created a workflow with user decision task. for that task in UWL inbox i provided a text box using XML Code, but i couldnt retrieve the Text entered in the text box. I hope the text will automatically upload in the "_Attach_object" container element of the Workflow, but it couldnt upload in that, If anyone can help me to solve this issue.
Thanks & Regards,Hi,
<ItemType name="uwl.task.webflow.decision.TS91100000" connector="WebFlowConnector" defaultView="DefaultView">
<ItemTypeCriteria connector="WebFlowConnector" externalType="TS91100000"/>
<Actions>
<Action name="accept" groupAction="yes" handler="UserDecisionHandler">
<Properties>
<Property name="decisionKey" value="2"/>
<Property name="UserDecisionNote" value="true"/>
</Properties>
</Action>
<Action name="reject" groupAction="yes" handler="UserDecisionHandler">
<Properties>
<Property name="decisionKey" value="1"/>
</Properties>
</Action>
</Actions>
</ItemType>
I have implemented the above code and i got the Text Box, but now the problem is i couldnt retrieve the
text entered in the Text box. I checked in the attachobjects container element related to the task and the subsequent task but the text is not appearing there. Can you help me to get the text entered in the text box.
Thanks & Regards,
Manikandan.S -
Display instantly the length of the text entered in the rich text editor
Hi everybody,
I'm developing an apex application with apex 4.1.1 and Oracle 11.2.
I have a page in which I have a form that allows to create a new message on the database.
A message has a title, description, text and date.
For the text I use the item "rich editor text". The problem is that item doesn't show the length of characters entered (character counter for the textarea). In the database the corresponding column is varchar2(2000). What I do is a validation after submit that checks if the limit 2000 was exceeded or not.
But what I want to do more is to display instantly the length of the text entered in the editor. I have tried to do that through a dynamic action. But the event "onChange" for the item "rich text editor" didn't work.
Has anyone any idea about that issue?
Thanks for helping.
Kind regards,
Edited by: Khadija Khalfallah on Apr 25, 2013 4:06 AMsorry about that, I missed that tidbit in your OP... well I think there is a good reason why there isn't a count character option -- due to the hidden "html" characters responsible for the "richness" (bold/color, etc) applied to the text would be difficult to count true characters.. if I was bent on doing this, I'd continue using the item you are using, but have a HIDDEN text area that is updated via javascript onkeyup for each keystroke (again, keeping in mind you'd have to filter certain keys) and then that intelligence could be used. I would probably dig through the javascript responsible for the rich text editor (is it still fckeditor??) -- there might already be code in there that isn't clearly visible to you that does this already.. alas, I see now the validity of your challenge.
-
Using the text and not the value of a filed
Hi there,
I'm programming a pdf form using life cycle, I'm using the following script in a "SEND TO" button in order to email an XML file with the data extracted from the form:
var emailAddress = F.P1.Line.rawValue;
var veicle = F.P1.Vehicle.rawValue;
var shipper = F.P1.Shipper.rawValue;
var date = F.P1.Date.rawValue;
event.target.submitForm({cURL:"mailto:"+emailAddress+"?subject=Booking request from "+shipper+" date:"+date+" &body=Dear Sirs,Please find attached the completed PDF booking form for the following "+veicle+".",cSubmitAs:"XML",cCharset:"utf-8"});
The problem is that I would like to use in a variable the text and not the value of the F.P1.Line.raw field.
Thanks in advanceHi,
This is not the appropriate forum to post this type of question. Please post all designer related queries in LiveCYcle Designer Forum to receive better response.
From you query I understand you have a dropdown box with name as "Line". And you want to the "text" part of the selected item and not the "value" part. If it is so then do the following -
1. Write the below code in onCHange event of your dropdown box.
var ddValue = this.boundItem(xfa.event.newText);
var nodeList = this.resolveNode("#items").nodes;
var ddText = null;
for (var i = 0; i < nodeList.length; i++)
if (this.boundItem(nodeList.item(i).value) == ddValue)
ddText = nodeList.item(i).value;
break;
global.selectedtxt = ddText;
In the above code I am basically getting the "text" part of the item selected and then I am storing it in a global variable.
2.
Write the below code on click event of your button -
var emailAddress = global.selectedtxt;
Hope this helps.
Thanks,
Shivajiv. -
Change the position of the text field in the report region
Hi,
I am having a report region in whch there are 2 buttons which are in the Region Template position #Create# and a
text field. I added a text field in the same region. I tried to change the position of the text field near the buttons. I
tried to change "label-Horizontal/vertical alignment" and "Element horizontal vertical alignment". But the postion of the
text field is not changing. Plz help,
Thanks,
TJHi Andy,
Sorry to ask this questions.
1.Where exactly i need to change the HTML code(By uisng the view source?)
2.My taskname part html code when viewing the source is given below
tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" />
</a><tr></td><td nowrap align="left">
<label for="P1_TASK_NAME" tabindex="999">
<a class="t16OptionalLabelwithHelp" href="javascript:popupFieldHelp('5853137628393530415','676839962625525')"
tabindex="999">Task Name</a></label></td>
<td colspan="1" rowspan="1" align="left" valign="top"><input type="hidden" name="p_arg_names"
value="5853137628393530415" /><input type="text" name="p_t06" size="10" maxlength="20" value=""
id="P1_TASK_NAME" /><a class="eLink" title="Edit" href="javascript:popupURL('f?
p=4000:371:676839962625525::::P371_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:5853137628393530415,107,1');"
tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" /></a></td></table>
<table summary="" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td align="right"><table
cellpadding="0" cellspacing="0" border="0" summary="" class="t16Button">please suggest what changes i need in this code to change the alignment of the task_name text field,
Thanks,
TJ -
I am trying to use motion tracking to have text follow a section of the background.The text box follows the motion path, but the text just sits there. What am I doing wrong?
Motion basically looks at the the source footage and it's timing (in the timing section of the Inspector) when analyzing for tracking. Filters are basically ignored by the tracker. Retiming actions, like time re-mapping, or retiming behaviors that are applied before the tracker should be used by the tracker. Did you change the timing after doing the tracking? If so this would also require you to re-track the shot. Understanding that you found a workaround, describing the effects you applied would help to explain why you ran into problems.
Cheers! -
How can I make a table cell extend beyond a page? The text disappears when the cell becomes bigger than the page. I want the table to continue to the next page.
As a student, you might be able to get Office for Mac from the college bookstore at a substantial discount. Otherwise, I think your best option for documents that need to be shared with Office users is to get one of the free Office clones such as LibreOffice.
-
How to use the separate symbol in the text field in the adobe form.
Hi,experts,
I dont know how to use the separate symbol to make a paragraph separate into several lines correctly in the text field in the adobe form.
Action:
1. config the ADS successfully.
2. create the adobe form with a mult-line textfield(binding the 'remark' context in the interface of the form) using sfp.
3. create a WDA for invoke the form and transfer the 'remark' context data.
I use the following codes to display the paragraph in the PDF document:
CONCATENATE
'1、aaaaaaaaaaa;'
'2、bbbbbbbbb '
'3、ccccccccccc'
'4、ddddddddd'
INTO remark .
lo_nd_z_hr_php_payslip->set_attribute(
EXPORTING
name = `REMARK`
value = remark ).
But I found all the content aren't paragraph separate correctly in the text field in the adobe form when I run the WDA.
Could you please give me some hints to make the paragraph separate correctly in PDF document? Thanks a lot in advance!
My email is : [email protected]
Best regards,
Tao
Edited by: wang tao on Apr 8, 2008 1:58 AMHi,
If it is just a one word value then you could use this in the exist event;
this.rawValue
= util.printx(">?<*",this.rawValue);
This changes the first character (represented by the ?) to uppercase (represented by the >) and all trailing characters (represented by the *) to lowercase (represented by the <).
If you wanted something more general ... if they could also enter a middle name then you could call a function like;
function toTitleCase(textValue)
return textValue.toLowerCase().replace(/\b[a-z]/g, function replacer(match) { return match.toUpperCase(); });
This uses a regex to change all lowercase letters following a word boundary to uppercase.
Bruce -
This is my first use of this program. How do I remove a page break? How do line up my drop down box along side the text box on the left of it? The drop down is for a multiple choice answer for the question to the left of each drop down.
See McAfee support to find out how to disable that McAfee feature - that isn't part of the normal Firefox installation.
-
Calendar on iOS 7. Anyone noticed that when you enter text into the "notes section" of a day, the text disappears behind the keyboard rather than scrolling down to keep pace with text entry ? Looks like an 7 glitch to me ?
Doesn't do that for me. Try resetting the phone
-
Am new at this forum and also at pages and can't figure out how to insert a bullet where I want it in the text, not at the beginning of the paragraph. I found word much easier to use. Please help. Trying to do a resume.
On a US keyboard it is Option + 8 (above the letters). •
-
Field Length of the text field on the screen
Hello Experts,,
I have field with its label on the screen. Now the label text is picked up from data dictionary as defined.
Data element J_3ARQDA Active
Short Description: Requested delivery date
Length Field Label
Short 10 RqDlv.date
Medium 16 Req.deliv.date
Long 20 Requested deliv.date
Heading 5 Dldat
Now the text in different laguage say russian is quite bigger in length as compared to english ones. Now on the sales order screen i have the text 'Dldat', but the russian user needs a bigger word than just 'Dldat'.
Approach : I changed the heading length to some '25' from '5' to accomedate the russian text in DDIC for data element. But if i have to adjust the same on the screen with new text length i have to extend the screen border as well.
Is this right approach ? If not how do we actually accomedate the other language texts on the screen with out altering the screen borders ( length and breadth).Hi Radhika,
I tried doing that with a couple of invoices but I dont see the Long text printed on the check after the automatic payment run. Can you please suggest me if I am missing on anything. I inserted a long text and a '*" before this to have it printed on the check which does not seem to work. Can you please suggest me alternative solution.
Thanks in advance.
Ramya
Maybe you are looking for
-
Is anyone having problems with Firefox today? My websites are not loading correctly
Firefox just isn't working right today. My home page (yahoo.com) will not load correctly, nor does a university site for a course that I am teaching online. I can do both of these if I use Internet Explorer.
-
Conversion of page maker document into PDF format
I am a professional translator. I translate books from English to telugu.The DTP professional typed my translation work in page maker using Anu fonts (Priyanka & priyanka bold). it has to be converted into PDF format. But the DTP fellow can not do it
-
We want to change the standard search help of GL Account in the Shopping Cart line item. Currently it fetches the value from ECC backend but we need to utilise a custom search help from SRM system. Pease let me know how do we do this. Thanks.
-
I am trying to copy something and I can not figure out how to open more than i window at a time.
-
My internal webcam on HP EliteBook 8460w not detected in device manager and not detected by driver
Hello all... I just bought HP EliteBook 8460w, after I installed all the program and driver I find out that the internal webcam is not working. When I have check in the device manager the webcam is not listed. Then I tried to download the newest soft