I have a Pivot and 5 Pivot items inside it, by an xml I am adding and removing those pivot items as per the need but the thing is I want some of my ApplicationBarIcons visible on selection of certain pivotitems and collapse on certain pivotitems view,I cannot do this by the help of checking selectedindex because dynamically they are getting changed. How can I do it?
Not sure how you are handling the loading of the app bar. Are you doing in the the XAML code or C#?
If you are doing it in C#, there should be a Visible property for the ApplicationBar object.
Be sure to check out the Cimbalino toolkit for windows phone! It has a bindable application appbar, so you can tweak the IsVisible property when you switch through the pivots! > There is a SelectionChanged event on the Pivot to track what pivot is currently active, I would check the Name of the pivot or a Tag like Techloverr suggests
Example cimbalino http://code.msdn.microsoft.com/wpapps/cimbalino-windows-phone-4de77988
You can create ApplicationBar for certain pivot items of pivot page like this using id.If id =0,it will take automatically pivot Page(Item) 0 .By using this,you can choose which all AppBars has to be in whole pivot pages and in selective pivot pages(Items).
<phone:Pivot>
<i:Interaction.Triggers>
<appBarUtils:SelectedPivotItemChangedTrigger>
<appBarUtils:SelectedPivotItemChangedTrigger.SelectionMappings>
<appBarUtils:SelectionMapping SourceIndex="0" TargetIndex="0"/>
</appBarUtils:SelectedPivotItemChangedTrigger.SelectionMappings>
<appBarUtils:SwitchAppBarAction>
<appBarUtils:AppBar Id="0" BackgroundColor="{StaticResource AppBarBg}" ForegroundColor="{StaticResource Foreground}">
<appBarUtils:AppBarButton IconUri="/Assets\Images\appbar.home.png" Text="home" Command="{Binding HomeNavigationCommand}"/>
</appBarUtils:AppBar>
<appBarUtils:AppBar Id="1" BackgroundColor="{StaticResource AppBarBg}" ForegroundColor="{StaticResource Foreground}">
<appBarUtils:AppBarButton IconUri="/Assets\Images\appbar.home.png" Text="home" Command="{Binding HomeNavigationCommand}"/>
</appBarUtils:AppBar>
<appBarUtils:AppBar Id="2" BackgroundColor="{StaticResource AppBarBg}" ForegroundColor="{StaticResource Foreground}">
<appBarUtils:AppBarButton IconUri="/Assets\Images\appbar.home.png" Text="home" Command="{Binding HomeNavigationCommand}"/>
<appBarUtils:AppBarButton IconUri="/Assets\Images\appbar.money.png" Text="collection" Command="{Binding CollectionPageCommand}"/>
<appBarUtils:AppBarButton IconUri="/Assets\Images\appbar.check.rest.png" Text="ok" Command="{Binding OrderConfirmationButtonCommand}"/>
</appBarUtils:AppBar>
<appBarUtils:AppBar Id="3" BackgroundColor="{StaticResource AppBarBg}" ForegroundColor="{StaticResource Foreground}">
<appBarUtils:AppBarButton x:Name="ConfirmationAppBarButton" IconUri="/Assets\Images\appbar.cancel.rest.png" Text="cancel" Command="{Binding OrderCancelButtonCommand}"/>
<appBarUtils:AppBarButton IconUri="/Assets\Images\appbar.check.rest.png" Text="ok" Command="{Binding OrderConfirmationButtonCommand}" IsEnabled="{Binding Model.EnableCheck,Mode=TwoWay}" />
</appBarUtils:AppBar>
</appBarUtils:SwitchAppBarAction>
</appBarUtils:SelectedPivotItemChangedTrigger>
</i:Interaction.Triggers>
</phone:Pivot>
//Assuming your views are in View Folder
Use AppBarUtils from here and refer in code.
You can have different appbars for each pivot item using the above sample code.Hope this will help you.
Related
Magento 1.9
I want to create a new tab in System > Configuration.
In this tab, I need a group tab and in this group tab i want a textarea which is connected to a field of my database. If i edit my textarea, it will modify my database field too.
Look at this: https://prnt.sc/orwph1
I don't know how to connect my textarea with my db.. Create a new tab with a new group it's easy but connect it to the db..
Thanks!
let's assume you want a section that has 2 fields: multiselect, text area. In the multiselect you have all your customer and in the text are you get the modify to apply for a certain db field (related to the customer).
your system.xml should me something like this:
<config>
<tabs>
<admin_customTab_2 translate="label" module="sections">
<label>- TAB NAME -</label>
<sort_order>2</sort_order>
</admin_customTab_2>
</tabs>
<sections>
<customsection2 translate="label" module="sections">
<label>label name</label>
<tab>admin_customTab_2</tab>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<block translate="label">
<label>label name</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<block_customers>
<label>Select user</label>
<comment>user list</comment>
<frontend_type>multiselect</frontend_type>
<backend_model>sections/users</backend_model>
<source_model>sections/users</source_model> <!-- adding a source-model for the form's select -->
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</block_customers>
<block_textarea>
<label>changes to apply</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</block_textarea>
</fields>
</block>
</groups>
</customsection2>
</sections>
this is not enough for the configs, you need to tell Magento about the access control list (ACL) or admin-users will not see it. It is done in the config.xml
like this:
<adminhtml>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<customsection2>
<title>Customer Changes?</title>
</customsection2>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
all is setted, but doing nothing but showing us the tabs and forms.
If you was brave enough you noticed a tag in the system.xml code up here,
<backend_model>sections/users</backend_model>
<source_model>sections/users</source_model> <!-- adding a source-model for the form's select -->
this tell magento that you are using a model relating to this form, where you can do operations.
So, in your Model's path create the (in this example) User.php
and here we go:
you want to extend your custom class with this one.
class Admin_Sections_Model_Users extends Mage_Core_Model_Config_Data
yes but we still didn't insert any data in the form.
You can do this by just adding a special function toOptionArray() :
public function toOptionArray()
{
$collections = Mage::getModel("customer/customer")->getCollection();
foreach ($collections as $colletion){
$user = Mage::getModel("customer/customer")->load($colletion->getId());
$array[] = array('value'=>$user->getEntityId(),'label'=>Mage::helper("sections")->__($user->getName()));
}
return $array ;
}
this will set ALL the customer's name into the multi-select form.
"yeah, nice.. I asked about the text-area"
before telling you how to get Data from Store Configs, you should know that there are 2 main methods for elaborating the form data:
public function _afterSave()
{}
public function _beforeSave()
{}
in there you can put all your code, no need to explain what is the difference between them.
in this function you can easy get the Data from Store Config by doing:
$text_area_string = Mage::getStoreConfig('customsection2/block/block_textarea');
"yeah nice... but my main problem is to save things in DB"
you can use whenever you prefer the Mage::getModel('') method , this can connect you to the database. Lets make an example; modify the 'is_active' field on 'customer_entity' table.
$customer = Mage::getModel("customer/customer")->load($customer_id);
$customer->setData("is_active",0);
$customer->save();
this field doesn't do really anything, it is just a very fast example.
This should let you do what you are aiming for.
If something sounds strange, please let me know!
I use DisplayTag in my struts2 application and i want to hit query on clicking pagination.
Ex : When user click on the next page or any page then query is fire on action class.
FILE : displayTag.jsp
<display:table name="list1" sort="list" size="20" pagesize="5" id="table1" export="true" requestURI="" partialList="true">
<display:column property="no" group="1" sortable="true" headerClass="sortable"></display:column>
<display:column property="nam" group="2" sortable="true" headerClass="sortable"></display:column>
<display:column property="ct" group="3" sortable="true" headerClass="sortable" autolink="true"></display:column>
<display:setProperty name="export.excel.filename" value="diplayTag.xls"></display:setProperty>
<display:setProperty name="export.pdf.filename" value="diplayTag.pdf"></display:setProperty>
<display:setProperty name="export.csv.filename" value="diplayTag.csv"></display:setProperty>
<display:setProperty name="export.pdf" value="true"></display:setProperty>
</display:table>
I use request.setAttribute("list1", li); where i set all data in list1(ArrayList) and pass to the displayTag.jsp.
DisplayTag get all data and display in the table format. But my need is to pass only 5 data at a time and on clicking next page action class send other 5 data and so on.
I refer link : Display tag pagination problem
But i can not understand because i'm use MySql and also new on DisaplyTag.
DB : MySql
Framework : struts2
After researching and hard working i found answer.
FILE : displayTag.jsp
<display:table name="list1" sort="external" size="20" pagesize="5" id="table1" export="true" requestURI="disTag" partialList="true">
// code as above
</dispaly:table>
here requestURI="disTag" is a action name.
FILE : struts.xml
<action name="disTag" class="className">
<result name="success">/displayTag.jsp</result>
<result name="error">/error.jsp</result>
</action>
FILE : class file
page = Integer.parseInt(request.getParameter((new ParamEncoder("table1").encodeParameterName(TableTagParameters.PARAMETER_PAGE))));
if(page != 0)
{
start = (page - 1) * 5; //5 is row or data per page.
}
getData(start, 5); //getData is a method which store all data in ArrayList. Based on start index.
I am creating a native script application and I want my tab View to appear on the top for iOS. I know sticking the tabView on the top violates the human interface guideline, but I need to do it this way.
With the new Nativescript 6 there is a new component called "Tabs" that allows you to do this:
Here is how you would do it with Nativescript angular:
<Tabs selectedIndex="1" class="fas font-size">
<!-- Using icon fonts for each TabStripItem -->
<TabStrip>
<TabStripItem title="Home"></TabStripItem>
<TabStripItem title="Account"></TabStripItem>
<TabStripItem title="Search"></TabStripItem>
</TabStrip>
<TabContentItem>
<GridLayout>
<Label text="Home Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<TabContentItem>
<GridLayout>
<Label text="Account Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
<TabContentItem>
<GridLayout>
<Label text="Search Page" class="h2 text-center"></Label>
</GridLayout>
</TabContentItem>
</Tabs>
Here is a playground project I created.
Hereis a playground example with Nativescript typescript using both top and low tabs
Here you can find the documentation
important note: this widget is currently on beta
You can achieve that. Here's how i have done the similar thing -
<StackLayout row="0" col="0">
<StackLayout *ngIf="visibility1" id="mainView" visibility="{{ visibility1 ? 'visible' : 'collapsed' }}">
<FirstView></FirstView>
</StackLayout>
<StackLayout *ngIf="visibility2" id="mainView" visibility="{{ visibility2 ? 'visible' : 'collapsed' }}">
<SecondView></SecondView>
</StackLayout>
<StackLayout *ngIf="visibility3" id="mainView" visibility="{{ visibility3 ? 'visible' : 'collapsed' }}">
<ThirdView></ThirdView>
</StackLayout>
</StackLayout>
and change the visibility of each component based on the click events.
You can implement all manners of TabView behaviours/layouts using the SegmentedBar. See this answer for details
I create my bar chart as following:
{axisStroke}
{axisStroke}
{axisStroke}
<!-- horizontal axis -->
<mx:horizontalAxis>
<mx:LinearAxis id="ac" baseAtZero="true"/>
</mx:horizontalAxis>
<!-- horizontal axis renderer -->
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{ac}"
canDropLabels="true"
styleName="wsViewAxisLabel"
minorTickPlacement="none"
tickPlacement="none"
labelGap="0"
showLabels="false"
showLine="false">
<mx:axisStroke>{axisStroke}</mx:axisStroke>
<mx:tickStroke>{axisStroke}</mx:tickStroke>
<mx:minorTickStroke>{axisStroke}</mx:minorTickStroke>
</mx:AxisRenderer>
</mx:horizontalAxisRenderers>
<mx:series>
<mx:BarSeries id="barSeries" color="#FFFFFF" labelAlign="right"
displayName="{seriesName}"
filters="{[new DropShadowFilter(2,45,0,.3)]}" fontSize="11"
fontWeight="bold" labelField="{valueName}"
xField="{seriesName}"
showDataEffect="{interpolateIn}"
yField="{categoryName}">
<mx:fill>
<mx:LinearGradient id="linearGradient">
<mx:entries>
<fx:Array>
<mx:GradientEntry color="0x99ffcc"
ratio="0.0"
alpha="0.1" />
<mx:GradientEntry color="0x99ffcc"
ratio="1.0"
alpha="1.0"/>
</fx:Array>
</mx:entries>
</mx:LinearGradient>
</mx:fill>
</mx:BarSeries>
</mx:series>
<mx:annotationElements>
<mx:CartesianDataCanvas id="mCanvas"/>
</mx:annotationElements>
</mx:BarChart>
but when I change the series name and datacollection. the bar chart did not show data.
I try to debug code and find the barseries's items length is 0. it's dataprovider and series name, xfield, yfield is right. do not know why barseries did not create barseriesitems.
many thanks for help.
thanks
The dataProvider is bound to the original name, so the dataProvider assignment to the ID needs to be updated. The dataProvider is bound the the ArrayCollection, so the ArrayCollection assignment to the dataProvider needs to be updated as well.
References
Flex Mobile Performance Checklist
I have tried to do this refering to following link.
http://skypher.com/index.php/2008/07/28/function-list-for-php/
But no success.
Can you help me please.
It will be great if namesapces also parsed.
Never mind,
Notepad+= 5.4.5 unicode and function list 2.0 beta. I have succeded with
<Group name="Global Procedures" subgroup="" icon="8" child="16" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords=""> <Rules regexbeg="^proc\s+" regexfunc="[\w_]+" regexend="" bodybegin="{" bodyend="}" sep="" /> </Group> <Group name="Namespaces" subgroup="" icon="0" child="0" autoexp="4" matchcase="1" fendtobbeg="" bbegtobend="" keywords=""> <Rules regexbeg="^namespace\s+eval\s+::" regexfunc="[\w_]+" regexend="" bodybegin="" bodyend="" sep="" /> </Group>