How to pre-select in netui:select
I am new to workshop. I need to use netui:select for a list box with multiple selection. I want to pre-select the listbox with several entries. I am wondering how to do this?
Cindy,
You can set multiple default values on a select tag by binding the
defaultValue attribute to a String[] or anything else (collection, etc)
that can be turned into an Iterator.
For example, here is how I modified Workshop's Sample Application
(specifically the "select multiple" example)
<netui:form action="submit">
<netui:select multiple="true" dataSource="{actionForm.selections}"
size="5" defaultValue="{pageInput.defaultValues}">
<netui:selectOption value="red" />
<netui:selectOption value="blue" />
<netui:selectOption value="green" />
<netui:selectOption value="yellow" />
<netui:selectOption value="orange" />
</netui:select>
<netui:button type="submit" value="Submit"/>
</netui:form>
here is the code from the controller showing the page flow variable
defaultValues being passed to the page as a page input in fhe Forward
contstructor.
private String[] defaultValues = {"green", "yellow"};
* @jpf:action
* @jpf:forward name="success" path="index.jsp"
protected Forward begin()
return new Forward("success", "defaultValues", defaultValues);
- john
"Cindy" <[email protected]> wrote in message
news:407170f4$[email protected]..
I am new to workshop. I need to use netui:select for a list box withmultiple selection. I want to pre-select the listbox with several entries.
I am wondering how to do this?
Similar Messages
-
How to Pre-Select a View for ALV dashboard at runtime
Hello Experts,
The requirement is to pre-select 1 view initially (out of several configured) for 'All' users and disable the 'View-selection' dropdown function in a standard ALV dashboard. So whenever the dashboard loads, a particular view has to be set automatically for all users.
I need your help for the first part, which is to always pre-set a 'View' in a standard dashboard.
I tried to implement the suggestion provided in the following thread:
How to apply ALV view at runtime
However I couldn't make this work in my case. I created a Post-Exit of a method in Comp Ctlr of dashboard (Initialize method) - where I receive the refrence 'IWCI_SALV_WD_TABLE'. Then calling the method 'GET_CONFIG_DATA' with action 'if_salv_wd_table=>set', I try to set the view, but it has no effect.
Thanks a lot for your help,
AbirHi abir,
Use this and alv1 is my alv component name
DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV1( ).
IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LO_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV1( ).
LS_PARAM_IN TYPE IF_SALV_WD_TABLE=>S_TYPE_PARAM_CONFIG_IN.
ls_param_in-default = "your view name " ( view is of type wdr_pers_variant)
DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LO_VALUE = LO_INTERFACECONTROLLER->GET_CONFIG_DATA( ls_param_in )
Regards
Srinivas
Edited by: sanasrinivas on Dec 30, 2011 7:15 AM -
How to Pre-select Value in auto drop down list
Hi,
I have an automatically populated drop down list, and I'm trying to have it display with a pre-selected value (in the example 5). I didn't know where to start, so I modified the Dreamweaver code for "Set value equal to" from the Dynamic list function.The list displays, but the value defaults to 0. What am I missing?
<?php
echo '<select name="firstnumber" id="number">';
for ($j=0; $j<11; $j+=1)
echo "<option value=\"$j\" <?php if (!(strcmp(\"$j\",5))) {echo \"selected=\"selected\"\";} ?>$j</option>\n";
echo '</select>';
?>
Thanks,
TimThe problem is that you have nested PHP tags inside a PHP block. You can't do that. In fact, it's surprising that the code works at all. Normally, nesting PHP tags inside a PHP code block will trigger a syntax error.
Also, your code is very difficult to read because of the way you use double quotes all the time. It's best to use single quotes for strings, except when you need to display the value of a variable inside a string. You can also nest double quotes inside a single-quoted string and vice versa, making for code that's much easier to read without all the backslashes.
This is how I have rewritten your code:
<select name="firstnumber" id="number">
<?php
for ($j=0; $j<11; $j+=1) {
echo "<option value='$j'";
if (!(strcmp($j,5))) {
echo 'selected="selected"';
echo ">$j</option>\n";
?>
</select> -
How to Pre-select an item when making an ISR DDL.
I am trying to mimic the functionality of the "Position Field' in the SPPD, but I can't figure out how it is pre-selecting the PLANS_CURR box with the current position.
I basically want a drop down bo, which I am populating with data using ls_special_data, and I am able to do that fine, but now I would like to specify and certain record to be pre-selected.
Does anyone know how to do this?
Thanks,hi Tim and Sridhar,
How do we do the binding.
On the Adobe dynamic binding I See see.
for example for the forms field PERSK_NEW
ITEM Binding
Item value text
Item key key
but the source code in ls_additional_data has this code
ls_additional_data-fieldindex = index.
ls_additional_data-fieldname ='PERSK_KEY'.
ls_additional_data-fieldvalue = int_table-key.
append ls_additional_data to additional_data.
ls_additional_data-fieldindex = index.
ls_additional_data-fieldname = 'PERSK_LABEL'.
ls_additional_data-fieldvalue = int_table-label.
append ls_additional_data to additional_data.
endloop.
In this case how is PERSK_KEY bound to Item key
and 'PERSK_LABEL' bound to item value
Please guide. I am trying to create a PCR from scratch and got stuck up big time at this point -
How to Pre-select Checkboxlist
I am using struts 2 checkboxlist to display the list of checkboxes... Everything works fine except I am unable to preselect the checkboxes at the time of update...
<s:checkboxlist list="usersList" name="users" listKey="id" listValue="name" value="users"/>I have search extensively on google, but no help yet.. anyone can help me please.
ThanksCreate a session scope in the struts.xml using the Java bean object used in the action class
in my example, I used the Java bean instance name to be model, so every model object will have the session scope,this is work .
<interceptor-ref name="scope">
<param name="session">model</param>
<param name="autoCreateSession">true</param>
</interceptor-ref> -
Pre select datagrid with multiple colors
how to pre select rows in a datagrid with multiple colors based on a condition?
for eg: I have a status column.Based on the value of the status,the rows should be highlighted.
if(status=='arrived'){
highlight in green;
}else
if(status=='delayed'){
highlight in red;try this, override drawRowBackground function
public CustomDataGrid extends DataGrid
override protected function drawRowBackground(s:Sprite,rowIndex:int,y:Number, height:Number, color:uint, dataIndex:int):void
var item:Object = this.dataProvider.getItemAt(dataIndex);
if (item.status == 'arrived')
color = 0x00FF00;
else if (item.status == "delayed")
color = 0xFF0000;
super.drawRowBackground(s, rowIndex, y, height, color, dataIndex); -
How to set a default pre-select for radio buttons?
Hi
I have some text form fields that I've set up to display some paired variables stored in a .txt file. When the swf loads, the form fields are populated with the text.
I've also set it up so that if you change the text and hit a submit button, the .txt file gets updated.
I'm now tryng to set it up so that I can store radio button selections in the .txt file too.
I've started doing it a certain way, but am wondering if there is a more straightforward way of doing ?
Here's what I've done...
I've set up the butttons to spit out "on" or "off" depending on the selection, and apply that to the variable that gets stored.
Now, in the same way I loaded the variables into the text form fields when the swf is refreshed, I want to load the on/off variable, and then somehow apply it to the radio buttons so that one of them is pre-selected.
So my questions are a) how do I take that loaded variable, and use an if statement to make it pre-select the button, and b) is there a simpler way to pre-select a button based on an external variable?
Thanks
ShaunNevermind guys - I did it using the 'rb_on.selected' command on the "on" radio button if the .txt file variable was "on", else the "off" radio button is selected.
Thanks for taking a look though!
Shaun -
How can I control the Product Category in the Pre-select screen
Dear ,my expert :
I work in ROS scenario . In my case ,the supplier can select Product Category A, Product Category B,and Product Category C when they filled the data in the registration scren . And the purchaser A just is responsibility for the Product Category A ,and the purchaser B ,C are the same situation .
So ,my question is :
1,How can I control the Product Category in the Pre-select screen? I mean that the Purchaser A can just select the Product Category A in the Pre-select screen .
2,You know the supplier select two category is one BP in the system ,So if the purchaser A accepe the supplier ,the purchaser B will find the status is "accepted ",So the purchaser B will be confused about it .
SO ,in my case ,any one has the suggestions ,any link welcome .
Bestregards
alexHi Alex,
As per standard SRM solution, this is not supported. Purchasers who accept new suppliers, accept them on the whole and not for any specific product category. There is no such thing as Purchaser being responsible for specific prod category in ROS.
What you could do however is to build a custom workflow to achieve it. You could have category approvers after the purchaser has accepted the supplier. Based on the category provided by the supplier in the reg form, you could route these suppliers to appropriate category approvers.
Regards,
Nikhil -
I need to know how to make my a button pre-selected. When the
user comes to the screen, I'd like it to show up just like it does
in the rollover state. Is there a way to do this? I already tried
using the my_btn.selected property, but that does't do it (didn't
think it would).
Similar issue: I have three buttons in a movieclip, and I'd
like them to be the only items the user can choose from and
navigate to, I haven't figured that one out yet either. If anyone
knows how to do that, please tell me, I'd like to be able to tell
which items have the "focus" similar to the getFocus() method used
for text fields, is there anything like that for movieclipsIf you want to hide a radio button from a group, you have to use individual IWDRadioButton elements instead of IWDRadioButtonGroupBy{Index, Key}.
Armin -
Need button so be pre-selected
I need to know how to make my a button pre-selected. When the
user comes to the screen, I'd like it to show up just like it does
in the rollover state. Is there a way to do this? I already tried
using the my_btn.selected property, but that does't do it (didn't
think it would).
Similar issue: I have three buttons in a movieclip, and I'd
like them to be the only items the user can choose from and
navigate to, I haven't figured that one out yet either. If anyone
knows how to do that, please tell me, I'd like to be able to tell
which items have the "focus" similar to the getFocus() method used
for text fields, is there anything like that for movieclipsSolved.
My final code:
data: lv_tree_size TYPE i,
ls_layout_item TYPE lvc_s_laci,
lt_layout_item TYPE lvc_t_laci,
lv_ind TYPE LVC_INDEX.
CLEAR ls_layout_item.
ls_layout_item-fieldname = 'SEL'.
ls_layout_item-class = cl_gui_column_tree=>item_class_checkbox.
ls_layout_item-editable = 'X'.
ls_layout_item-u_class = 'X'.
ls_layout_item-u_editable = 'X'.
ls_layout_item-u_chosen = 'X'.
ls_layout_item-chosen = 'X'.
append ls_layout_item to lt_layout_item.
call method g_tree9001->set_table_for_first_display
EXPORTING
i_save = 'A'
is_variant = ls_variant
CHANGING
it_sort = gt_sort9001
it_outtab = gt_tree9001
it_fieldcatalog = gt_treefcat9001.
DESCRIBE TABLE gt_tree9001 LINES lv_tree_size.
DO lv_tree_size TIMES.
CALL METHOD G_TREE9001->CHANGE_LAYOUT
EXPORTING
I_OUTTAB_INDEX = sy-index
IT_ITEM_LAYOUT = lt_layout_item .
ENDDO.
The main trick is in u_class, u_editable, u_chosen. These params say that layout should be changed. Only this way it will work.
And some helpful links:
ALV tree get selected checkbox
Checkbox ALV Tree CL_GUI_ALV_TREE
ALV TREE-Checkbox
CL_GUI_ALV_TREE and Checkboxes
Report BCALV_TREE_ITEMLAYOUT is also very helpful. -
Prompt's customized LOV is not pre-selected when webi report is refreshed
BO XI R 2 SP 1
DB: Oracle10g
Hi - I have customized LOV in every dimension and it's value is '*All'....it appears at the top of LOV values in the prompt list.
When I open the report, it shows the *All is already selected; but when I refresh this report using 'Refresh Data'; everythings comes up fine but *All no longer shows up as pre-selected value.
Is there a way to handle this situation? Please let me know if you need more explanation.
Note that when I hit the save button; report comes back with all '*All' pre-selected in all prompts.I don't know how to access the document you mentioned...
anyway, to display All as customized value; edit the dimension's SQL and add
UNION
SELECT 'All' FROM DUAL (for oracle)
SELECT 'All' FROM anytablename (for SQL Server)
select the checkbox not to generate SQL and then click Run...click Display and then you should be able to see All as one of your custom value. -
How to programatically select text for editing in an af:inputText control?
Hello, I am new to jdeveloper 11.1.1.3.0 and have searched and searched for info. I must be using the wrong terms as I cannot find any info or example on how to programatically select text for editing in an inputText field.
My request is to change an existing app so when the user presses a button, control should go to the inputText control (this part works, see existing backing bean code from another developer below) but automatically select the text within for editing by the user (saving the user from having to select the text first before editing).
Backing bean code to set the focus to an inputText field:
* sets the cursor to the given component id
* @param componentId of item on page
public void setFocusOnUIComponent(String componentId) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service =
Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
UIComponent uiComponent = facesContext.getViewRoot().findComponent(componentId);
service.addScript(facesContext,
"Component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); Component.focus();");
} I hope this isn't a dumb question and would appreciate it if someone can steer me in the right direction.
Thank you for any info,
GaryHi,
not a dumb question at all. Before answering it, here some comments on the code you pasted in your question
1. UIComponent uiComponent = facesContext.getViewRoot().findComponent(componentId);
This code line is not used at all in your method. So it seems you can get rid of it
2. "Component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); Component.focus();");
I suggest to change it to
"var component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); component.focus();");
as it is better coding practice to have variable names starting with a lower case letter and being flagged with the "var" identifier
For pre-selecting text in an an input component, there is no API available in ADF Faces, which means you need to reach out to the rendered HTML ouput. To access the markup for the rendered component, you can try
var markup = AdfRichUIPeer.getDomContentElementForComponent(component)
If this markup returns the HTML input component then you can use JavaScript you find on the Internet to select the area of it. If it does not return the input component then you may have to use
document.getElementById(componentId+'::content')
Note however that working directly with generated HTML output bears the risk that your code breaks when - for whatever reason - the ADF Faces component rendering changes in the future
Frank
Frank -
How to randomly select links in e-tester and how to get VU# in e-load
1. How to randomly select one from links in a webpage in e-tester?
For example: there is a root-page. On it, there are about 2000 links to its subpages. They all have the following pattern:
<pre>
multiline<TD width="50%"><NOBR>
<img src="/images/tfold.gif" border="0" alt="GXC_.+?" align="texttop">
{a href="(.+?)"}<font class="titleorimageid1siteid0">GXC_.+?</font>{a} </NOBR>
</TD>
</pre>
So how can randomly select one link and then navigate to it?
2.how to get VU# in e-load?
For example: we launch 4000 VU to load-stress our server. But we want to use different user names to login for different VU#. such as VU#1's username is ADF1, VU#2's username is ADF2, VU#100's username is ADF100 and so on. How can we implement the feature?
Thanks a lot.
Edited by: user783927 on Dec 1, 2008 5:57 AM
Edited by: user783927 on Dec 1, 2008 5:59 AMThanks a lot for VU#. Also i got an idea about how to randomly select a link:
Private Sub RSWVBAPage_afterPlay()
Dim objReg As New RegExp
Dim objMatchCol As MatchCollection
Dim objMatch As Match
Dim objSubMatch As SubMatches
Dim doc As String
Dim str As String
Dim rNumb As Integer
RSWApp.GetHtml doc
With objReg
.Global = True
.IgnoreCase = True
'the kind of urls have the following special pattern
.Pattern = "pageid=34,([\d]{5})"
End With
Set objMatchCol = objReg.execute(doc)
Randomize
rNumb = objMatchCol.Count * Rnd
If objMatchCol.Count >= 1 Then
If rNumb = objMatchCol.Count Then
rNumb = objMatchCol.Count - 1
End If
End If
Set objMatch = objMatchCol.Item(rNumb)
Set objSubMatch = objMatch.SubMatches
str = objSubMatch.Item(0)
Call RSWApp.setCustomVariable("var_url", str)
RSWApp.WriteToLog str
Set objMatchCol = Nothing
Set objMatch = Nothing
End Sub -
I am using an xml data set in a form, and I am doing like
this page:
http://labs.adobe.com/technologies/spry/samples/data_region/DataSetMasterDetailSample.html .
I am trying to make it where the information can be reloaded into
the page for editing.
Problem is I have not be able to figure out how to have the
selections stored in the database selected upon reloading. Using
the above page as an example again, if I selected Tennessee, then
Knoxville, stored them in my database, how can I get Tennessee and
Knoxville to be pre-selected upon reload?Hi,
If you're reloading the page, you can tell it which one to
select via a param in the URL. Check out these samples that show
you how to use Spry's URL utils:
http://labs.adobe.com/technologies/spry/samples/utils/URLUtilsSample.html
http://labs.adobe.com/technologies/spry/samples/data_region/DataWithURLParams.html
--== Kin ==-- -
Pre-selected Mcafee = a true way to the heart of your users?
I often considered why most installers don't offer more things to be installed? I actually think that the money Adobe get from McAfee is too little and that really, they should pre-select a whole bunch of additional software that users _must_ want... especially those in a hurry with little time to de-select pre-selected non-essential additional software options that have a large impact on how my computer operates, these people need a lot of additional software, well, at least you could assume that by default when they are updating a browser plugin?
Not going to argue you with you Pat that other people also do it, I will argue that that doesn't make it okay and also, that this is a browser plugin that is pretty essential to getting around the internet (and has been for the past 10 years with at least video playback), unlike the applications you list.
Unless there are some laws against such practices, we just have to live with that fact, and be very, very careful when installing anything.
You know living in a world were anything goes unless there is an explicit law against it is a pretty sad world to be in. Wouldn't it be nice if people took some responsibility for the position they are in and change the world with simple gestures like not abusing a position of power (running a browser plugin which most people need to install), to make money (pre-selected McAfee install), that has a negative effect on its users experience (both installer and possibly unwanted software).
A simpler option, which literally no-one could object to, is to have the box de-selected by default - this is in-line with what we could expect; most people updating the flash plugin will probably not need or want McAfee. They could even be public about this decision and the reason they did it.
But I have no "tree hugging" world disillusion, my brand image of Adobe is already a bunch of greedy people running a company where a few nice clever people exist, but on the off chance, someone with some awareness, checks the Adobe.com forums, on the flash installer, they will see that their pre-selected checkbox isn't winning them any friends and can be causing difficulty and stress to some users (most of which wouldn't even know to post here).
And, when I come to implement video playback on my website, or consider technologies like flash, I will remember the pre-selected tick box. Just in the same way I remember Macromedia and their approach on accessibility/SEO with flash...
Again... I am not hating, just trying to be honest and helpful. For all I know Adobe could be on the ropes financially and that McAfee money could be keeping them in there... but I doubt it.
Maybe you are looking for
-
Differences in FI & PCA Substitution
All, I am primarily an SD consultant working on a small solution related to Goods Receipts and Profit Center Accounting. After searching all the available forums with all sorts of keywords, no similiar issue could be found; hence posting this questio
-
i was told it was coming on september 25 what happened?
-
What are CREATOR and REGISTRAR in the V$ARCHIVED_LOG view?
Environment: Oracle 11.2.0.3 EE on Solaris 10.5 I'm not sure exactly where this question belongs since it deals with database processes, RMAN and Data Guard all in one so I'll start here and see where it takes me. I have a Data Guard environment set
-
We recently upgraded from JBoss 4.2 to JBoss 5.1. Our Crystal reports were working fine in JBoss 4.2, but we've had several issues in 5.1. after resolving several issues, I have reached a point where the application iis unable to locate the .rpt fi
-
Ahh ...Entering other partitions trough file-manager [SOLVED]
Hi, I have Ubuntu, Windows and now Arch installed on my pc. Through Ubuntu I can detect all partitions and write to them. I just go to Computer in the Nautilus file manager and I see the other partitions. In Arch however my file-manager is pcmanfm an